<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:green;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600">First, separate it from the node and nodelet API. (not sure if this is in the gsoc description on not)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600">Second, api should include a mechanism to manually check for a parameter change i.e. not use callbacks. We write a large amount of real-time capable code, where callbacks are
 bad. ROS is not used for this code, our main interest in the matter is to increase interoperability/quality of code. A manual check simplifies thread safety and algorithm design.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600">The api should be as simple as possible. I have a configuration system which is similar in capability as what the GSoC is asking for (but I cannot share code but am allowed
 to discuss interfaces).  It is a singleton, where get() and set() are implemented as templates, and use polymorphism to handle either single or arrays of parameter values. Get also has a specialized “startup” version which allows setting of default values
 for metadata if the parameter does not exist.  Error codes are returned for all possible cases, no exceptions are thrown.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600">At startup:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600">   Configuration & config = Configuration::instance();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600">   double width;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600">   // either get the value, or add it to the store with value of 3.5 & the given description. As get is a template, internally it sets the type as double<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600">   config.get(“param name”,width_,3.5,”width between points A and B”);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600">At runtime:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600">   If (Configuration::instance().get(“param name”,width_) == rframe::Error::CHANGED)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600">            cout << “width changed to “ << width << endl;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600">The values for each parameter are currently: key, value, comment, dirty, and type. Type is a enum mapping to int, bool, string, double, etc.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:#006600">As the get<>() and set<>() calls are templates, there is no need for separate getTYPENAME calls to do the type conversion.  This is an aesthetic choice which simplifies the
 interface for us.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:green"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:green">The singleton is nice as it allows threadsafe access to the configuration from anywhere in the code.  I do not currently support ranges for values.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:green"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:green"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> ros-users-bounces@code.ros.org [mailto:ros-users-bounces@code.ros.org]
<b>On Behalf Of </b>Dave Hershberger<br>
<b>Sent:</b> Wednesday, April 17, 2013 5:09 PM<br>
<b>To:</b> User discussions<br>
<b>Subject:</b> Re: [ros-users] New Parameter Server<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">+1 on the project, I'm glad to see this getting attention!<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">For the Qt version of rviz, I wrote a property hierarchy system in C++ which I have been fairly happy with.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">For example usage, see map_display.cpp: <a href="https://github.com/ros-visualization/rviz/blob/groovy-devel/src/rviz/default_plugin/map_display.cpp">https://github.com/ros-visualization/rviz/blob/groovy-devel/src/rviz/default_plugin/map_display.cpp</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">That system uses Qt slots to receive notice of property changes when needed. (If Qt is undesirable you could probably go with Boost slots or even just member function pointers.)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The bit about rviz's property API that is perhaps unique is that the Property object actually owns the data.  That means any time you want one of the property values you say something like "width_property_->getInt()" or "name_property_->getString()".
  What is returned by the Property object is always the latest value.  If you need to learn about updates, you don't need any parameters coming through the update function, because you can just ask the parameter object for the latest value from inside the update
 function.  This felt simpler to me than requiring API users to implement get/set functions for every parameter, which is how it had been implemented before.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Dave<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Wed, Apr 17, 2013 at 12:43 PM, Thibault Kruse <<a href="mailto:kruset@in.tum.de" target="_blank">kruset@in.tum.de</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">I found my draft rep, and now put it on github:<br>
<a href="https://github.com/tkruse/rep/blob/nodeparam/nodeparam-REP.rst" target="_blank">https://github.com/tkruse/rep/blob/nodeparam/nodeparam-REP.rst</a><br>
<br>
Note this was work in progress when I stopped working on it.<br>
<br>
Other things I considered back then:<br>
- whether to support complex parameter types like poses (rather than just primitive values)<br>
- how to organize parameter naming (I think there were some inconsistencies between rospy and roscpp around the '~')<br>
- using the same system for logger levels<br>
- grouping of parameters instead of having flat lists<br>
- whether to support batch updates of multiple parameters as one operation (e.g. when parameter validation would else deadlock changing two interdependent parameters)<br>
<br>
cheers,<br>
  Thibault<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org" target="_blank">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p><b><font color="red">------------------------------------------------------</font></b></p>
<p><font color="darkblue">This is an e-mail from General Dynamics Robotic Systems. It is for the intended recipient only and may contain confidential and privileged information. No one else may read, print, store, copy, forward or act in reliance on it or its attachments. If you are not the intended recipient, please return this message to the sender and delete the message and any attachments from your computer. Your cooperation is appreciated.</font><br /></p>
</body>
</html>