ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

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
tonu@hp:~/tyros/phippi/ros/phippi$
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
10

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

Comments

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
2

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

Solved.

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
tonu@hp:~$
edit flag offensive delete link more

Question Tools

Stats

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

Seen: 1,487 times

Last updated: Apr 06 '11