I am trying to make a 4 wheeled robot simulation in Gazebo Sim (formerly Ignition). I am using the differential drive plugin for driving the robot using teleop through /cmd_vel topic.
My system details
- OS : Ubuntu 22.04
- ROS 2 version : Humble
- Gazebo Sim version : Fortress
Here is my gazebo plugin for differential drive where I have mentioned 4 wheel joints
<gazebo>
<plugin filename="ignition-gazebo-diff-drive-system" name="ignition::gazebo::systems::DiffDrive">
<left_joint>left_front_joint</left_joint>
<right_joint>right_front_joint</right_joint>
<left_joint>left_back_joint</left_joint>
<right_joint>right_back_joint</right_joint>
<odom_publish_frequency>60</odom_publish_frequency>
<wheel_separation>0.40</wheel_separation>
<wheel_radius>0.17</wheel_radius>
<topic>/cmd_vel</topic>
<odom_topic>/odom</odom_topic>
<frame_id>odom</frame_id>
<child_frame_id>base_link</child_frame_id>
</plugin>
The Gazebo sim bridge for the ROS 2 topics is defined in the gz-sim.launch.py file
gz_ros2_bridge = Node(
package="ros_gz_bridge",
executable="parameter_bridge",
arguments=[
"/cmd_vel@geometry_msgs/msg/[email protected]",
"/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock",
"/odom@nav_msgs/msg/Odometry[gz.msgs.Odometry",
"/model/skid_steer_robot/tf@tf2_msgs/msg/TFMessage[gz.msgs.Pose_V",
"/scan@sensor_msgs/msg/LaserScan[gz.msgs.LaserScan",
"/imu@sensor_msgs/msg/Imu[ignition.msgs.IMU",
],
remappings=[
('/model/skid_steer_robot/tf', '/tf')
]
)
But as you can see in below images, the data visualization in Rviz2 is not working properly. The topics in rviz2 is somewhat not correclty visualized as compared to the simulation.
The below attached video will help you understand the problem I am facing more clearly.
Here is the complete description package for the skid steer robot nilutpolkashyap/skid_steer_robot
Here is the video showing the error skid_steer_error.webm video
Thank you for your time