Ask Your Question

AddTwoInts example with minus

asked 2011-04-06 09:05:55 -0600

updated 2014-01-28 17:09:29 -0600

ngrennan gravatar image

Probably very simple and dumb question. I have code similar to AddTwoInts example. How to enter negative values there?

tonu@hp:~/tyros/phippi/ros/phippi$ rosservice call phippi_motors -0.2 0.2
Usage: rosservice call /service [args...]

rosservice: error: no such option: -0
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2011-04-06 10:16:37 -0600

Eric Perko gravatar image

This tool uses the YAML commandline syntax described here.

To fix this particular problem, you would separate your arguments from the command's options using --. For example, rosservice call phippi_motors -- -0.2 0.2 should work.

edit flag offensive delete link more


Uff, I was looking for this. You have just resolved my problem! Thanks!

Rikki gravatar image Rikki  ( 2012-02-12 23:43:46 -0600 )edit

answered 2011-04-06 09:50:36 -0600


tonu@hp:~$ rosservice call phippi_motors '{a: 1, b: 2}'
result: Go done
tonu@hp:~$ rosservice call phippi_motors '{a: -0.1, b: 0}'
result: Go done
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


Asked: 2011-04-06 09:05:55 -0600

Seen: 635 times

Last updated: Apr 06 '11