0
$\begingroup$

Rosanswers logo

I want to visualize the UR5 robot model in RViz. For that, I am using the following launch file,

<launch>
  <arg name="limited" default="false" doc="If true, limits joint range [-PI, PI] on all joints." />
  <arg name="gui" default="true" />

  <param unless="$(arg limited)" name="robot_description" command="$(find xacro)/xacro --inorder '$(find ur5_description)/urdf/ur5_robot.urdf.xacro' " />  
  <node if="$(arg gui)" name="joint_state_publisher" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui" />
  <node unless="$(arg gui)" 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" />
</launch>

Then I ran the RViz node in another terminal and found that the TF frames are plotted correctly as per the joint angles provided in the joint_state node's GUI window but the robot model is fixed at the neutral (wrong) pose. The screenshot of the situation is given below. Any help to resolve the problem will be appreciated.

image description


Originally posted by anirban on ROS Answers with karma: 64 on 2020-11-15

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I figured out the reason why robot model was not following the TF frames. The reason was that I had been using Robot_State from moveit_ros_visualization instead of RobotModel offered by rviz. Changing the robot model display method as stated, resolved the problem.


Originally posted by anirban with karma: 64 on 2020-11-16

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.