Mubashir
Mubashir

Reputation: 145

Rviz is not updating /joint_states

I have a custom URDF mobile robot. The robot is moving in the gazebo by /cmd_vel but the wheel of the robot is not moving in Rviz. The robot is spilling over the surface in Rviz.enter image description here

here is the joint_info.yaml

my_robot: 
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50

and this is robot.launch file

<launch>
  <param name="robot_description" textfile="$(find my_robot)/urdf/my_robot.urdf"/>
  <arg name="world_file" default="$(find my_robot)/world/Untitled/model2.world"/>
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(arg world_file)"/>
  </include>
  

<!-- Spawn custom robot the URDF -->
  <node
    name="spawn_model"
    pkg="gazebo_ros"
    type="spawn_model"
    args="-file $(find my_robot)/urdf/my_robot.urdf -urdf -model my_robot"
    output="screen" />

  <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" >
      <param name="use_sim_time" value="false"/>
</node>

<!-- Publishing joint state  -->
<node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher" >
  <remap from="joint_state_publisher" to ="joint_states" />
</node>

<!-- Joint COnfiguration yaml file -->
<rosparam file="$(find my_robot)/config/joint_info.yaml" command="load"/>
<node name="my_robot" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="joint_state_controller"/>

<!-- Gmapping  -->
<node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="screen" >
  <remap from="scan" to="scan"/>
</node>

<!-- open Rviz -->
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find my_robot)/rviz/robot.rviz" />

</launch>

when I check the /joint_states by rostopic echo /joint_states the joint states where not updating here is the imageenter image description here. wheel_j1 wheel_j2 wheel_j3 wheel_j4 is not updating. How can I fix it?

Upvotes: 0

Views: 636

Answers (0)

Related Questions