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

Revision history [back]

I am having the exact same problem. I also modified the code so that the Arduino publishes the value of "cmd_msg.data" into a topic called "/pose". I have the following observations:

  • When ROS Serial Python Node is launched for the first time everything works fine and I am able to receive the published pose. When I send the command "rostopic pub servo std_msgs/UInt16 180 -1" to change the servo arm angle I get the correct response and the published pose is now "180".

  • When I enter the next command "rostopic pub servo std_msgs/UInt16 90 -1" the servo remains in its 180 position and the /pose topic is now publishing "254".

  • No matter how many time I try to send a new servo command the servo remains in its position and the /pose topic keeps on publishing "254"

  • If I hit the reset button onboard the Arduino the servo returns to its 90 degree state momentarily and then goes back to the 180 degree state with /pose still publishing "254".

It seems to me that the ROS Serial Python Node is (a) not sending the correct message after the first message is sent and (b) loses communication with the subscribed topic /servo.

I am using Ubuntu 11.04 with ROS Electric. The Arduino IDE is version 22 and my board is the Nano with ATMEGA328.