<html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>area_provider: rois.h 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_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_a61f22007e0f347cded0d82030ee545d.html">lib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">rois.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="rois_8h.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">#ifndef ROIS_H</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define ROIS_H</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160; </div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;fstream&gt;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;filesystem&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;nlohmann/json.hpp&gt;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;ros/package.h&gt;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;std_msgs/MultiArrayDimension.h&gt;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &lt;std_msgs/MultiArrayLayout.h&gt;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;std_srvs/SetBool.h&gt;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;cpswarm_msgs/GetMultiPoints.h&gt;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;cpswarm_msgs/PointArrayEvent.h&gt;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="roi_8h.html">lib/roi.h</a>&quot;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160; </div>
<div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="rois_8h.html#ab701e3ac61a85b337ec5c1abaad6742d">   15</a></span>&#160;<span class="keyword">using</span> <a class="code" href="rois_8h.html#ab701e3ac61a85b337ec5c1abaad6742d">json</a> = <a class="code" href="rois_8h.html#ab701e3ac61a85b337ec5c1abaad6742d">nlohmann::json</a>;</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160; </div>
<div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="classrois.html">   20</a></span>&#160;<span class="keyword">class </span><a class="code" href="classrois.html">rois</a></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;{</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <a class="code" href="classrois.html#a73eb30742ff10fa11e586b3edfc5553d">rois</a> ();</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160; </div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classrois.html#a6946931f6d8e7586297222c786b3a991">get_all</a> (cpswarm_msgs::GetMultiPoints::Request &amp;req, cpswarm_msgs::GetMultiPoints::Response &amp;res);</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; </div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classrois.html#aa39882fe494b1fb1a160c19a0f159bcc">get_closest</a> (cpswarm_msgs::GetDist::Request&amp; req, cpswarm_msgs::GetDist::Response&amp; res);</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classrois.html#acc25fe958ead2f9314a0f12935950d42">get_distance</a> (cpswarm_msgs::GetDist::Request&amp; req, cpswarm_msgs::GetDist::Response&amp; res);</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160; </div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classrois.html#a83fcce3ec987c560d1655c7c21bd368e">get_map</a> (cpswarm_msgs::GetMap::Request &amp;req, cpswarm_msgs::GetMap::Response &amp;res);</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160; </div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classrois.html#ad84dbc0a1e6d774d1b7222ffcc24201d">reload</a> (std_srvs::SetBool::Request&amp; req, std_srvs::SetBool::Response&amp; res);</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classrois.html#a9ce154b9e4478c059165f50edaaea36b">add_roi</a> (vector&lt;double&gt; x, vector&lt;double&gt; y);</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160; </div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classrois.html#aea128dd731c6305595dc005dbef5beab">exists</a> (<a class="code" href="classroi.html">roi</a> <a class="code" href="classroi.html">roi</a>);</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160; </div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classrois.html#a3662e97501d7aa8af2c6dbe0d174246d">from_file</a> ();</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160; </div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classrois.html#a2272f63cf000f3916d11a1714f3d435d">roi_callback</a> (<span class="keyword">const</span> cpswarm_msgs::PointArrayEvent::ConstPtr&amp; event);</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160; </div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="classrois.html#a33a4af83392e7307f08d8c78cb683d68">   98</a></span>&#160;    NodeHandle <a class="code" href="classrois.html#a33a4af83392e7307f08d8c78cb683d68">nh</a>;</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160; </div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="classrois.html#a94446e4609b4581a5df85c4740437920">  103</a></span>&#160;    Subscriber <a class="code" href="classrois.html#a94446e4609b4581a5df85c4740437920">roi_subscriber</a>;</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160; </div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="classrois.html#aa30ac3d81ac12e296cb437e2d1b7aaf2">  108</a></span>&#160;    Publisher <a class="code" href="classrois.html#aa30ac3d81ac12e296cb437e2d1b7aaf2">roi_publisher</a>;</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160; </div>
<div class="line"><a name="l00113"></a><span class="lineno"><a class="line" href="classrois.html#ae9ff6ab824d2d3cd149682343a4005e4">  113</a></span>&#160;    set&lt;roi&gt; <a class="code" href="classrois.html#ae9ff6ab824d2d3cd149682343a4005e4">regions</a>;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="line" href="classrois.html#aac45b23ccec86b78ae98666ba8bec3c5">  118</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classrois.html#aac45b23ccec86b78ae98666ba8bec3c5">duplicates</a>;</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160; </div>
<div class="line"><a name="l00123"></a><span class="lineno"><a class="line" href="classrois.html#a051e5b24fbeeef20511439f208705bfe">  123</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classrois.html#a051e5b24fbeeef20511439f208705bfe">publish</a>;</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;};</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160; </div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;<span class="preprocessor">#endif // ROIS_H</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclassrois_html_ae9ff6ab824d2d3cd149682343a4005e4"><div class="ttname"><a href="classrois.html#ae9ff6ab824d2d3cd149682343a4005e4">rois::regions</a></div><div class="ttdeci">set&lt; roi &gt; regions</div><div class="ttdoc">All ROIs with IDs.</div><div class="ttdef"><b>Definition:</b> <a href="rois_8h_source.html#l00113">rois.h:113</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_aea128dd731c6305595dc005dbef5beab"><div class="ttname"><a href="classrois.html#aea128dd731c6305595dc005dbef5beab">rois::exists</a></div><div class="ttdeci">bool exists(roi roi)</div><div class="ttdoc">Check whether a given ROI is already known.</div><div class="ttdef"><b>Definition:</b> <a href="rois_8cpp_source.html#l00195">rois.cpp:195</a></div></div>
<div class="ttc" id="aclassrois_html_a94446e4609b4581a5df85c4740437920"><div class="ttname"><a href="classrois.html#a94446e4609b4581a5df85c4740437920">rois::roi_subscriber</a></div><div class="ttdeci">Subscriber roi_subscriber</div><div class="ttdoc">Subscriber object to receive ROI coordinates from event messages.</div><div class="ttdef"><b>Definition:</b> <a href="rois_8h_source.html#l00103">rois.h:103</a></div></div>
<div class="ttc" id="aclassrois_html_aac45b23ccec86b78ae98666ba8bec3c5"><div class="ttname"><a href="classrois.html#aac45b23ccec86b78ae98666ba8bec3c5">rois::duplicates</a></div><div class="ttdeci">bool duplicates</div><div class="ttdoc">Whether to allow duplicate ROIs, i.e., ROIs with identical coordinates.</div><div class="ttdef"><b>Definition:</b> <a href="rois_8h_source.html#l00118">rois.h:118</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_a3662e97501d7aa8af2c6dbe0d174246d"><div class="ttname"><a href="classrois.html#a3662e97501d7aa8af2c6dbe0d174246d">rois::from_file</a></div><div class="ttdeci">void from_file()</div><div class="ttdoc">Read ROI coordinates from files at the folder specified with the roi_dir param.</div><div class="ttdef"><b>Definition:</b> <a href="rois_8cpp_source.html#l00207">rois.cpp:207</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="arois_8h_html_ab701e3ac61a85b337ec5c1abaad6742d"><div class="ttname"><a href="rois_8h.html#ab701e3ac61a85b337ec5c1abaad6742d">json</a></div><div class="ttdeci">nlohmann::json json</div><div class="ttdef"><b>Definition:</b> <a href="rois_8h_source.html#l00015">rois.h:15</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_aa30ac3d81ac12e296cb437e2d1b7aaf2"><div class="ttname"><a href="classrois.html#aa30ac3d81ac12e296cb437e2d1b7aaf2">rois::roi_publisher</a></div><div class="ttdeci">Publisher roi_publisher</div><div class="ttdoc">Event publisher for ROI coordinates.</div><div class="ttdef"><b>Definition:</b> <a href="rois_8h_source.html#l00108">rois.h:108</a></div></div>
<div class="ttc" id="aclassrois_html_a2272f63cf000f3916d11a1714f3d435d"><div class="ttname"><a href="classrois.html#a2272f63cf000f3916d11a1714f3d435d">rois::roi_callback</a></div><div class="ttdeci">void roi_callback(const cpswarm_msgs::PointArrayEvent::ConstPtr &amp;event)</div><div class="ttdoc">Receive ROI coordinates from an event message.</div><div class="ttdef"><b>Definition:</b> <a href="rois_8cpp_source.html#l00287">rois.cpp:287</a></div></div>
<div class="ttc" id="aclassrois_html_a73eb30742ff10fa11e586b3edfc5553d"><div class="ttname"><a href="classrois.html#a73eb30742ff10fa11e586b3edfc5553d">rois::rois</a></div><div class="ttdeci">rois()</div><div class="ttdoc">Constructor that initializes the ROIs.</div><div class="ttdef"><b>Definition:</b> <a href="rois_8cpp_source.html#l00003">rois.cpp:3</a></div></div>
<div class="ttc" id="aclassrois_html_a9ce154b9e4478c059165f50edaaea36b"><div class="ttname"><a href="classrois.html#a9ce154b9e4478c059165f50edaaea36b">rois::add_roi</a></div><div class="ttdeci">void add_roi(vector&lt; double &gt; x, vector&lt; double &gt; y)</div><div class="ttdoc">Add an ROI.</div><div class="ttdef"><b>Definition:</b> <a href="rois_8cpp_source.html#l00158">rois.cpp:158</a></div></div>
<div class="ttc" id="aclassroi_html"><div class="ttname"><a href="classroi.html">roi</a></div><div class="ttdoc">A class that holds a region of interest (ROI).</div><div class="ttdef"><b>Definition:</b> <a href="roi_8h_source.html#l00009">roi.h:9</a></div></div>
<div class="ttc" id="aclassrois_html_a051e5b24fbeeef20511439f208705bfe"><div class="ttname"><a href="classrois.html#a051e5b24fbeeef20511439f208705bfe">rois::publish</a></div><div class="ttdeci">bool publish</div><div class="ttdoc">Whether to publish any newly imported ROI as event.</div><div class="ttdef"><b>Definition:</b> <a href="rois_8h_source.html#l00123">rois.h:123</a></div></div>
<div class="ttc" id="aroi_8h_html"><div class="ttname"><a href="roi_8h.html">roi.h</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>
