Robot Model does not follow TF frames in RViz
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.