Ask Your Question
0

[Resolved] Communication between Arduino and model in RVIZ

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

zpguedes gravatar image

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

Hello,

  • 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"/>

</launch>

This is the error that is giving: https://www.youtube.com/watch?v=z2xiv.. .

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

Comments

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 -0500 )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 -0500 )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 -0500 )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 -0500 )edit

thank you, you were right hehehe

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

2 Answers

Sort by ยป oldest newest most voted
0

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

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

Comments

thank you but problems remain...

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

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

zpguedes gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 542 times

Last updated: Nov 03 '16