Re: [ros-users] parameter types

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Ken Conley
Date:  
To: ros-users
Subject: Re: [ros-users] parameter types
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 <> 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
>
> https://code.ros.org/mailman/listinfo/ros-users
>