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

Revision history [back]

click to hide/show revision 1
initial version

There were actually two issues with what you were trying

  1. You were trying to publish a negative UInt16
  2. rostopic pub saw the negative value as command line option

Solution:

  1. Like everyone said, negative UInt16 values makes no sense. Unsigned numbers cannot be negative. Please read up on them.
  2. Using a - when using the command line usually signals that you're using a flag (option). As the error

    rostopic: error: no such option: -8
    

    tells you, it thinks that you're trying to use 8 as an option (which isn't what you want). You can either publish it like you said in the comment to @mig 's answer or use

    rostopic pub servo std_msgs/Int16 -- -8
    

Note: in the future, you can use Google to help you find the answer by entering the following as your search term:

rostopic pub no such option site:answers.ros.org

which will limit your search to Google's index of ROS Answers. Next time, just replace rostopic pub no such option with whatever error you have. This time the first result would have led you to the solution for #2.

There were actually two issues with what you were trying

  1. You were trying to publish a negative UInt16
  2. rostopic pub saw the negative value as command line option

Solution:

  1. Like everyone said, negative UInt16 values makes no sense. Unsigned numbers cannot be negative. Please read up on them.
  2. Using a - when using the command line usually signals that you're using a flag (option). As the error

    rostopic: error: no such option: -8
    

    tells you, it thinks that you're trying to use 8 as an option (which isn't what you want). You can either publish it like you said in the comment to @mig 's answer or use

    rostopic pub servo std_msgs/Int16 -- -8
    

Note: in the future, you can use Google to help you find the answer by entering the following as your search term:

rostopic pub no such option site:answers.ros.org

which will limit your search to Google's index of ROS Answers. Next time, just replace rostopic pub no such option with whatever error you have. This time the first result would have led you to the solution for #2.

#2: #q61598