Syncing Move Group joint states with robot in simulation
Hi,
I have been trying to use a physics engine to do experiments instead of my real robot. As I was connecting MoveIt with the physics engine, one problem that I encountered was that move group is not changing the joint states according to my robot in simulation.
All joint states are published with correct names to the topic "/yumi/joint_states", and I have joint_state_publisher and robot_state_publisher launched as well.
<node name="yumi_joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
<rosparam param="source_list">["/yumi/joint_states"]</rosparam>
</node>
<node name="yumi_robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>
Just in case that the move group did not subscribe to the joint states correctly, I echoed "/move_group/monitored_planning_scene/robot_state/joint_state". By manipulating the robot in the physics engine, I am affirmative that the joint states fed into MoveIt are from the physics engine. Here is a sample result of the echo command:
header:
seq: 0
stamp:
secs: 1611415632
nsecs: 622175931
frame_id: "yumi_base_link"
name: [yumi_joint_1_l, yumi_joint_2_l, yumi_joint_7_l, yumi_joint_3_l, yumi_joint_4_l, yumi_joint_5_l,
yumi_joint_6_l, gripper_l_joint, gripper_l_joint_m, yumi_joint_1_r, yumi_joint_2_r,
yumi_joint_7_r, yumi_joint_3_r, yumi_joint_4_r, yumi_joint_5_r, yumi_joint_6_r,
gripper_r_joint, gripper_r_joint_m]
position: [6.463619115493202e-07, -0.039591364562511444, 0.04112724959850311, 0.009112260304391384, 8.23559503260185e-07, 0.01217526476830244, -3.0866064548717986e-07, 0.0, 0.0, -3.3755272852431517e-06, -0.03959168866276741, -0.04112748056650162, 0.009136912412941456, 5.3803930200047034e-08, 0.012184608727693558, 3.047164298664029e-09, 0.0, 0.0]
velocity: []
effort: []
However, the robot in RVIZ always returns to its default shape after executing trajectories. And I don't see robot moving in RVIZ when I move it in the physics engine as well.
Has anybody worked on connecting MoveIt with real robots? Is there anything else I need to do to get the joint states updated in MoveIt?
I am using ROS melodic on Ubuntu 18.04.
Any idea is appreciated! Thanks!
Please clarify what "echo command" you are using, how you are starting up MoveIt (which launch files?), and any other details that might be relevant from your setup.
Also, you say "the robot in Rviz always returns to its default shape after executing trajectories". Can the trajectories be executed? Does the robot in your physics engine move when you do? Are there errors in your terminal when you execute a trajectory?
out of curiosity: which "physics engine" are you using?
I was using Unity3D. Sorry for the late reply. Hope this helps.