<html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>area_provider: roi_services.cpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="jquery.js"></script>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">roi_services.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="roi__services_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="rois_8h.html">lib/rois.h</a>&quot;</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160; </div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="keyword">using namespace </span>std;</div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="keyword">using namespace </span>ros;</div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160; </div>
<div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="roi__services_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">   12</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="roi__services_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv)</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;{</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;    <span class="comment">// init ros node</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;    init(argc, argv, <span class="stringliteral">&quot;rois&quot;</span>);</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;    NodeHandle <a class="code" href="classrois.html#a33a4af83392e7307f08d8c78cb683d68">nh</a>;</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160; </div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;    <span class="comment">// roi library</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    <a class="code" href="classrois.html">rois</a> rois_lib;</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160; </div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    <span class="comment">// advertise services</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    ServiceServer <a class="code" href="classrois.html#a6946931f6d8e7586297222c786b3a991">get_all</a>              = <a class="code" href="classrois.html#a33a4af83392e7307f08d8c78cb683d68">nh</a>.advertiseService(<span class="stringliteral">&quot;rois/get_all&quot;</span>,      &amp;<a class="code" href="classrois.html#a6946931f6d8e7586297222c786b3a991">rois::get_all</a>, &amp;rois_lib);</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    ServiceServer get_closest_service  = <a class="code" href="classrois.html#a33a4af83392e7307f08d8c78cb683d68">nh</a>.advertiseService(<span class="stringliteral">&quot;rois/get_closest&quot;</span>,  &amp;<a class="code" href="classrois.html#aa39882fe494b1fb1a160c19a0f159bcc">rois::get_closest</a>, &amp;rois_lib);</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    ServiceServer get_distance_service = <a class="code" href="classrois.html#a33a4af83392e7307f08d8c78cb683d68">nh</a>.advertiseService(<span class="stringliteral">&quot;rois/get_distance&quot;</span>, &amp;<a class="code" href="classrois.html#acc25fe958ead2f9314a0f12935950d42">rois::get_distance</a>, &amp;rois_lib);</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    ServiceServer get_map_service      = <a class="code" href="classrois.html#a33a4af83392e7307f08d8c78cb683d68">nh</a>.advertiseService(<span class="stringliteral">&quot;rois/get_map&quot;</span>,      &amp;<a class="code" href="classrois.html#a83fcce3ec987c560d1655c7c21bd368e">rois::get_map</a>, &amp;rois_lib);</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    ServiceServer reload_service       = <a class="code" href="classrois.html#a33a4af83392e7307f08d8c78cb683d68">nh</a>.advertiseService(<span class="stringliteral">&quot;rois/reload&quot;</span>,       &amp;<a class="code" href="classrois.html#ad84dbc0a1e6d774d1b7222ffcc24201d">rois::reload</a>, &amp;rois_lib);</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    ROS_DEBUG(<span class="stringliteral">&quot;ROI_PROV - ROI services are ready&quot;</span>);</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    spin();</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="arois_8h_html"><div class="ttname"><a href="rois_8h.html">rois.h</a></div></div>
<div class="ttc" id="aroi__services_8cpp_html_a3c04138a5bfe5d72780bb7e82a18e627"><div class="ttname"><a href="roi__services_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a></div><div class="ttdeci">int main(int argc, char **argv)</div><div class="ttdoc">Main function to be executed by ROS.</div><div class="ttdef"><b>Definition:</b> <a href="roi__services_8cpp_source.html#l00012">roi_services.cpp:12</a></div></div>
<div class="ttc" id="aclassrois_html"><div class="ttname"><a href="classrois.html">rois</a></div><div class="ttdoc">A class that manages several regions of interest (ROIs).</div><div class="ttdef"><b>Definition:</b> <a href="rois_8h_source.html#l00020">rois.h:20</a></div></div>
<div class="ttc" id="aclassrois_html_ad84dbc0a1e6d774d1b7222ffcc24201d"><div class="ttname"><a href="classrois.html#ad84dbc0a1e6d774d1b7222ffcc24201d">rois::reload</a></div><div class="ttdeci">bool reload(std_srvs::SetBool::Request &amp;req, std_srvs::SetBool::Response &amp;res)</div><div class="ttdoc">Reload ROIs from files.</div><div class="ttdef"><b>Definition:</b> <a href="rois_8cpp_source.html#l00144">rois.cpp:144</a></div></div>
<div class="ttc" id="aclassrois_html_a6946931f6d8e7586297222c786b3a991"><div class="ttname"><a href="classrois.html#a6946931f6d8e7586297222c786b3a991">rois::get_all</a></div><div class="ttdeci">bool get_all(cpswarm_msgs::GetMultiPoints::Request &amp;req, cpswarm_msgs::GetMultiPoints::Response &amp;res)</div><div class="ttdoc">Return all ROIs.</div><div class="ttdef"><b>Definition:</b> <a href="rois_8cpp_source.html#l00022">rois.cpp:22</a></div></div>
<div class="ttc" id="aclassrois_html_acc25fe958ead2f9314a0f12935950d42"><div class="ttname"><a href="classrois.html#acc25fe958ead2f9314a0f12935950d42">rois::get_distance</a></div><div class="ttdeci">bool get_distance(cpswarm_msgs::GetDist::Request &amp;req, cpswarm_msgs::GetDist::Response &amp;res)</div><div class="ttdoc">Return the distance to a given ROI.</div><div class="ttdef"><b>Definition:</b> <a href="rois_8cpp_source.html#l00101">rois.cpp:101</a></div></div>
<div class="ttc" id="aclassrois_html_a83fcce3ec987c560d1655c7c21bd368e"><div class="ttname"><a href="classrois.html#a83fcce3ec987c560d1655c7c21bd368e">rois::get_map</a></div><div class="ttdeci">bool get_map(cpswarm_msgs::GetMap::Request &amp;req, cpswarm_msgs::GetMap::Response &amp;res)</div><div class="ttdoc">Return the map that correspond to a given ROI.</div><div class="ttdef"><b>Definition:</b> <a href="rois_8cpp_source.html#l00124">rois.cpp:124</a></div></div>
<div class="ttc" id="aclassrois_html_a33a4af83392e7307f08d8c78cb683d68"><div class="ttname"><a href="classrois.html#a33a4af83392e7307f08d8c78cb683d68">rois::nh</a></div><div class="ttdeci">NodeHandle nh</div><div class="ttdoc">A node handle for the main ROS node.</div><div class="ttdef"><b>Definition:</b> <a href="rois_8h_source.html#l00098">rois.h:98</a></div></div>
<div class="ttc" id="aclassrois_html_aa39882fe494b1fb1a160c19a0f159bcc"><div class="ttname"><a href="classrois.html#aa39882fe494b1fb1a160c19a0f159bcc">rois::get_closest</a></div><div class="ttdeci">bool get_closest(cpswarm_msgs::GetDist::Request &amp;req, cpswarm_msgs::GetDist::Response &amp;res)</div><div class="ttdoc">Return the closest ROI.</div><div class="ttdef"><b>Definition:</b> <a href="rois_8cpp_source.html#l00080">rois.cpp:80</a></div></div>

<br clear="all" />
<hr size="1"><div style="align: right;">
<a href="http://wiki.ros.org/area_provider">area_provider</a><br />
Author(s): Micha Sende <sende@lakeside-labs.com></br />
<small>autogenerated on Mon Jan 10 2022 15:13:45</small>
</div>
</body>
</html>
