Creating a Simple Two Wheeled Mobile Robot using the Primitive shapes in URDF .
- differential_drive_robot_description
- differential_drive_robot_gazebo
- differential_drive_robot_control
- geometry_msgs
- rospy
- std_msgs
This package contains the urdf description of the robot which is used to do all kinds of simulation works.
This package is used to deploy the robot model into the gazebo simulation world.
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.
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
To view the robot model in rviz :
Run the command in terminal
roslaunch differential_drive_robot_description rviz_visualize.launch
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
Now into the control part. We can control the robot motion using two methods,
- rqt robot steering
- differential_drive_robot_control package
Run the command in terminal
rqt
In rqt we can find the robot steering under Plugins
Plugins-->Robot Tools-->Robot Steering
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 .
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.
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
You can find the end result >>here<<.