Skip to content

Creating a two wheeled Differential drive robot model in URDF and visualizing it in rviz and gazebo for simulations studies

Notifications You must be signed in to change notification settings

Rakee003/Differential_drive_robot-Model

Repository files navigation

Differential_drive_robot-Model

Creating a Simple Two Wheeled Mobile Robot using the Primitive shapes in URDF . differentila_drive_robot_model

Packages

  • differential_drive_robot_description
  • differential_drive_robot_gazebo
  • differential_drive_robot_control

Dependencies

  • geometry_msgs
  • rospy
  • std_msgs

Package Explanation :

differential_drive_robot_description:

This package contains the urdf description of the robot which is used to do all kinds of simulation works.

differential_drive_robot_gazebo :

This package is used to deploy the robot model into the gazebo simulation world.

differential_drive_robot_control:

As the name suggests this package is used to control the motion of the robot. Alternatively we can also use rqt robot steering for motion control.

How to launch the robot ?

Create a workspace for example catkin_ws and paste all the three packages in the src folder

Run the command in terminal

catkin_make

The Robot model is designed using various xacro files found at ~catkin_ws/src/differential_drive_robot_description/urdf :

  • differential_drive_robot.xacro - Main Robot description
  • differentila_drive_robot.gazebo - Gazebo description
  • xacro_variables.xacro - xacro variables description
  • materials.xacro - Colors description

Visualization

To view the robot model in rviz :

Run the command in terminal

roslaunch differential_drive_robot_description rviz_visualize.launch

Screenshot from 2021-07-07 14-11-34

To view the robot model also in gazebo atmosphere :

Run the command in terminal

roslaunch differential_drive_robot_gazebo differential_drive_robot_rviz_gazebo.launch

Screenshot from 2021-07-07 14-12-07

Control

Now into the control part. We can control the robot motion using two methods,

  • rqt robot steering
  • differential_drive_robot_control package

Robot steering :

Run the command in terminal

rqt

rqt_robotSteering

In rqt we can find the robot steering under Plugins

Plugins-->Robot Tools-->Robot Steering

Screenshot from 2021-07-07 13-51-40

The robot steering appears in which we are able to change the linear and angluar motion velocity i.e., we are actually changing cmd_vel parameter .

differential_drive_robot_control :

In this package the motion is controlled using the keyboard. The corresponding script which is used for this purpose can be found at

~catkin_ws/src/differential_drive_robot_control/nodes/teleop.py

There is already a standard teleop node implementation available (for the turtlebot), we simply reused the node. Then a remapping is done from the turtlebot_teleop_keyboard/cmd_vel to /cmd_vel of our robot in the teleop.launch file.

Launching

Run the following commands in terminal :

  • Start Rviz and Gazebo to visualize
roslaunch differential_drive_robot_gazebo differential_drive_robot_rviz_gazebo.launch
  • Start the teleop:
roslaunch differential_drive_robot_control teleop.launch

Screenshot from 2021-07-05 20-33-17

You can find the end result >>here<<.

About

Creating a two wheeled Differential drive robot model in URDF and visualizing it in rviz and gazebo for simulations studies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published