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

[Resolved] Communication between Arduino and model in RVIZ

asked 2016-10-30 22:23:52 -0600

zpguedes gravatar image

updated 2016-11-03 15:41:57 -0600


  • I developed a urdf of a robotic arm

  • managed to control servos using Arduino + ROS,

Now I do not know how to join the two, that is, how do I change the value of the joint using joint_state_publisher in rviz also change the position of the servos?

ROS: Kinetic; Arduino: Mega; Servo: Micro Servo 9g SG90.

Launch file:

<launch &gt;="" <arg="" name="simulate" default="true"/>

<param name="robot_description" command="cat $(find comau_ns)/conf/comau_ns.urdf" />

<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />

<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>

<node name="rviz" pkg="rviz" type="rviz"/>


This is the error that is giving: .

It is as if the model of the robotic arm to follow the servos and had a static shadow...Help-me!!

edit retag flag offensive close merge delete


When posting a large chunk of code, it is much easier to read if put into code tags, or use a service like pastebin For monitoring, try rqt_graph to start. It will show you which nodes are communicating to other nodes, and on what topics.

Robot_Cpak gravatar image Robot_Cpak  ( 2016-11-02 13:32:54 -0600 )edit

It will be a dead giveaway if you see multiple nodes publishing to the same topic, or multiple nodes/topics going to your rviz display.

Robot_Cpak gravatar image Robot_Cpak  ( 2016-11-02 13:33:43 -0600 )edit

Thanks for the help, sorry, next time use the tags. I used rqt_graph but I'm not able to solve the problem.

graph obtained in rqt_graph:

/joint_state_publisher ---(/joint_states)-->/robot_state_publisher<--(/joint_states)--/serial_node

Any suggestion?

zpguedes gravatar image zpguedes  ( 2016-11-02 20:31:16 -0600 )edit

You have two nodes publishing on the same topic to the same subscriber node. I'll bet one of them is the "zero" position that the simulation keeps jumping between.

Robot_Cpak gravatar image Robot_Cpak  ( 2016-11-03 07:16:00 -0600 )edit

thank you, you were right hehehe

zpguedes gravatar image zpguedes  ( 2016-11-03 15:41:15 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2016-11-01 18:41:13 -0600

JoshMarino gravatar image

You need to create a joint state publisher and robot state publisher to publish the joint states to the topic /joint_states (or similar) such that Rviz knows to update the joints when the robot physically moves. An example for Dynamixel motors can be found at this ROS Answers question.

edit flag offensive delete link more


thank you but problems remain...

zpguedes gravatar image zpguedes  ( 2016-11-02 12:00:49 -0600 )edit

answered 2016-11-03 11:34:53 -0600

zpguedes gravatar image
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-10-30 22:23:52 -0600

Seen: 696 times

Last updated: Nov 03 '16