[ros-users] Best way to set the parameters for the controllers (param or message?)

Ugo Cupcic ugo at shadowrobot.com
Tue Apr 20 08:30:19 UTC 2010


Hi all,

Thanks a lot for your answers. I'll have a look at the 
dynamic_reconfigure stack. It seems to be exactly what I was looking for!

Cheers,

Ugo

On 19/04/10 20:30, Dejan Pangercic wrote:
> Ugo,
>
> as our guru Lorenz just pointed out, please note that the earlier
> attached code was actually taking 100% of CPU.
> I am attaching an improved version with added sleep in the spin function.
> D.
>
> On Mon, Apr 19, 2010 at 8:18 PM, Dejan Pangercic
> <dejan.pangercic at gmail.com>  wrote:
>    
>> Hi Ugo,
>>
>> I am by no means authority but this is the way I update parameters in my nodes:
>> Define node's member function, e.g.:
>> /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>>   double param_;
>>   void
>>       updateParametersFromServer ()
>>     {
>>       nh_.getParam ("my_param", param_);
>>     }
>> and then constantly call it in that node's spin function:
>>
>>       updateParametersFromServer ();
>>
>> See also an attached example file.
>>
>> Furthermore, I just recently stumbled upon
>> http://www.ros.org/wiki/dynamic_reconfigure which "facilitates dynamic
>> node reconfiguration". However I do not really understand in how far
>> is it different to conventional updating of parameters as discussed
>> before. But maybe Blaise can tell here more.
>>
>> D.
>> On Mon, Apr 19, 2010 at 6:56 PM, Ugo Cupcic<ugo at shadowrobot.com>  wrote:
>>      
>>> Hi,
>>>
>>> I'm currently setting the parameters for the controllers (PID and so on)
>>> via a message (I have a subscriber which updates the values when it
>>> receives the corresponding message).
>>>
>>> It works well, but I wanted to know what was the recommended way of
>>> doing that in ROS. Is it better to do it using parameters? (But then how
>>> can I  change the corresponding values when the parameters are updated?)
>>>
>>> Cheers,
>>>
>>> Ugo
>>>
>>> --
>>> Ugo Cupcic         |  Shadow Robot Company | ugo at shadowrobot.com
>>> Software Engineer      251 Liverpool Road
>>> need a Hand?           London  N1 1LX       | +44 20 7700 2487
>>> http://www.shadowrobot.com/hand/              @shadowrobot
>>>
>>>
>>> _______________________________________________
>>> ros-users mailing list
>>> ros-users at code.ros.org
>>> https://code.ros.org/mailman/listinfo/ros-users
>>>
>>>        
>>
>>
>> --
>> MSc. Dejan Pangercic
>> PhD Student/Researcher
>> Computer Science IX
>> Technische Universität München
>> Telephone: +49 (89) 289-17780
>> E-Mail: dejan.pangercic at in.tum.de
>> WWW: http://ias.cs.tum.edu/people/pangercic
>>
>>      
>
>
>    
>
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>    

-- 
Ugo Cupcic         |  Shadow Robot Company | ugo at shadowrobot.com
Software Engineer      251 Liverpool Road
need a Hand?           London  N1 1LX       | +44 20 7700 2487
http://www.shadowrobot.com/hand/              @shadowrobot


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20100420/eddb9659/attachment-0003.html>


More information about the ros-users mailing list