[ros-users] parameter types

Ken Conley kwc at willowgarage.com
Wed Jun 30 20:53:38 UTC 2010


Hi Aaron,

rosparam's arguments are YAML syntax (the shell strips your outer
quotes so they aren't meaningful). There are two ways to override:

$ rosparam set foo/ser2 "'00000303'"
$ rosparam set foo/ser2 '!!str 00000303'

This isn't ideal, but we didn't want to write our own markup language
with its own quirks instead.

hope this helps,
Ken


On Wed, Jun 30, 2010 at 1:47 PM, Aaron Solochek <aarons-ros at aberrant.org> wrote:
> I'm trying to store two serial numbers as ros parameters.  The first,
> 00000292 works in that I can rosparam set it and get the same value.
>
> The second 00000303 is apparently assumed to be in octal, so when I read
> it I get 195 decimal.
>
> To be clear:
>
>> rosparam set /foo/ser1 "00000292"
>> rosparam set /foo/ser2 "00000303"
>> rosparam get /foo/ser1
> 00000292
>> rosparam get /foor/ser2
> 195
>
> Now if I set them programmatically, I get a different inconsistency.
>
> n_.setParam("/foo/Ser1", "00000292");
> n_.setParam("/foo/Ser2", "00000303");
>
>> rosparam get /foo/ser1
> 00000292
>> rosparam get /foo/ser2
> '00000303'
>
> So my general question is how can I force my parameter to be
>  a certain type?
>
> -Aaron
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>



More information about the ros-users mailing list