Ask Your Question
1

Rosparam fails silenntly with a wrong param?

asked 2017-03-24 10:09:23 -0500

LbrRobix gravatar image

How can I see the type of parameter I can pass to when I set a Rosparam?

I do

$rosparam list

and got:

/background_r

/background_g

/background_b

etc

those are intuitive enough to predict that are ints

but if i need the type by doing

$rosparam type /background_r

I got an error since that command is not existing...

on the other hand, doing:

$rosparam set /background_r "foo"

fails silently...

what am doing wrong?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2017-03-24 10:15:12 -0500

Actually Ros has a parameter server that is nothing else as a Dictionary, parameter there has not type as you are specting...

so to the question: when you do:

$rosparam set /background_r "foo"

How you now it is failing? is not actually, you just wrote the parameter /background_r to "foo" in the dictionary

you can verify that by getting the value: just do:

$rosparam get /background_r

and you will get foo

edit flag offensive delete link more
0

answered 2017-03-24 16:34:54 -0500

jayess gravatar image

rosparam is not failing silently, it's doing exactly what you're telling it to. As ΦXocę 웃 Пepeúpa ツ said, you're actually setting the parameter to that value. According to the rosparam wiki, the syntax for setting a parameter via the command line is:

rosparam set parameter_name value

where, in your case, parameter_name is /background_r and value is "foo". If you were to call

rosparam get /background_r

after running the command that "silently fails" you would see that it actually has the value of "foo". The parameter server just stores a bunch of dictionary values that you can set, use, and even delete.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2017-03-24 10:09:23 -0500

Seen: 125 times

Last updated: Mar 24 '17