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

publishing negative values from command line

asked 2013-04-26 03:49:11 -0600

da-na gravatar image

Hi!

Is it possible to publish negative values via rostopic pub ? I tried

rostopic pub -1 /my_point geometry_msgs/Point 1 2 3

with no problem, but when I try

rostopic pub -1 /my_point geometry_msgs/Point 1 -2 3

it says an error:

Usage: rostopic pub /topic type [args...]

rostopic: error: no such option: -2

Is it anyhow possible to publish negative values from terminal?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
5

answered 2013-04-27 03:35:10 -0600

updated 2013-04-27 03:36:21 -0600

See also the comment here on using negative numbers with ROS command-line tools. As described in the link, you can use the -- flag to tell the parser to stop looking for additional command-line options.

So, the following should also work:

rostopic pub -1 /my_point geometry_msgs/Point -- 1 -2 3
edit flag offensive delete link more
3

answered 2013-04-26 03:57:09 -0600

yigit gravatar image

updated 2013-04-26 04:02:07 -0600

You can try

rostopic pub -1 /my_point geometry_msgs/Point '{x: 1, y: -2, z: 3}'

Here is the page YAML on the ROS command line

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-04-26 03:49:11 -0600

Seen: 5,761 times

Last updated: Apr 27 '13