Rosanswers logo

Hi all, I have a car simulation in ROS Melodic with 4 wheels and a joint on top of it and I am getting behavior that I don't know how to solve even after searching that in the forum.

The wheels are actuated according to the following plugin

<!-- Add Skid Steer Plugin -->
        <plugin name="skid_steer_drive_controller" filename="libgazebo_ros_skid_steer_drive.so">

While the joints on top of the car are actuated using the transmission element like this one:

        <transmission name="chassi_boom_transmission">
            <joint name="base_mount_joint">
            <actuator name="chassi_boom_actuator">

The problem is... Whenever I spawn the joint_state_publisher, both gazebo and joint_state_publisher publish to the topic joint_states. However, the gazebo never updates its joint_state causing my simulation model to flicker.

$ rostopic info /my_car/joint_states 

Type: sensor_msgs/JointState

 * /gazebo (http://ps-imr:42743/)
 * /joint_state_publisher (http://ps-imr:38597/)

 * /robot_state_publisher (http://ps-imr:38075/)

I currently have one launch file to start the simulation and another one to start the ros_control layer.

part of My_car.launch:

<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
        <remap from="/joint_states" to="/my_car/joint_states" />
        <!-- Spawn the example robot -->
    <arg name="my_car_model" default="tesla" />
    <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find my_car_description)/urdf/tesla_my_car.urdf.xacro' my_car_model:=$(arg my_car_model)" />
    <node pkg="gazebo_ros" type="spawn_model" name="spawn_model" args="-urdf -param /robot_description -model my_car" />

    <!-- Publish TFs -->
    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
        <param name="publish_frequency" type="double" value="50.0" />
        <remap from="/joint_states" to="/my_car/joint_states" />

And that is part of my control.launch

<!-- Load joint controller configurations from YAML file to parameter server -->
<rosparam file="$(find belt_loader_control)/config/belt_loader_control.yaml" command="load" />

<!-- load the controllers -->
<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" ns="/my_car" args="my_car_controller flex_ramp_controller joint_state_controller" />

Any thoughts about why that could be happening?

Originally posted by ignacio on ROS Answers with karma: 68 on 2021-03-18

Post score: 0

Original comments

Comment by gvdhoorn on 2021-03-18:\

Whenever I spawn the joint_state_publisher,

why do you do this?

Comment by ignacio on 2021-03-18:
because otherwise I won't see the wheels in place in RViz. Even though I am still able to move it by publishing a message in /cmd_vel

Comment by ignacio on 2021-03-18:
I mean ... they are not event shown in my Robot Model. It states No transform from [wheel_front_left] to [base_footprint]

Comment by gvdhoorn on 2021-03-18:
The JSP will publish JointState messages for all joints in your URDF. So starting the JSP in addition to Gazebo will cause conflicting messages to be published on /joint_states. That's probably the reason you see "flickering" (which is really just two different states being visualised in rapid succession by RViz).


1 Answer 1


Rosanswers logo

I just realized I didn't add the transmission to the wheels

<transmission name="wheel_transmission_${position}">
    <joint name="base_wheel_${position}">
    <actuator name="wheel_actuator_${position}">

Originally posted by ignacio with karma: 68 on 2021-03-18

This answer was ACCEPTED on the original site

Post score: 0


Your Answer

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