Up:Tutorial?    Previous:Control of humanoid agent by BVH file     Next: Distance sensor  


Wheeled mobile robot

This tutorial explains how to control a wheeled mobile robot.

(※This sample code is valid only for later than v2.1.1)

Model of a mobile robot

The following model is used in this tutorial.

mobile_robot_top_view.jpg
           Figure from overhead view
 
mobile_robot_bottom_view.jpg
           Figure from bottom view

This mobile robot has two wheels on both sides and two casters attached on back and forth. The both of two wheels are connected to the main body with joint name "JOINT_LWHEEL" and "JOINT_RWHEEL", respectively. In this example, the wheels are rotated by setting the angular velocity of these joint angles. The radius of the wheel (8cm) and the size of the robot 20x8x25(cm) are defined in a 3D model file such as "mobile_base.xml" The mass, color and so on are also defined in the 3D model file.

Creating a controller

$ emacs wheelController.cpp

wheelController.cpp

You can control the velocity of the two wheels by sending messages. For example, if you want to set the velocity of the left wheel as 1.5[rad/s] and the right wheel as 2.0[rad/s], you should send "1.5 2" to the robot agent.

Compile the controller by the following command.

$ ./sigmake.sh wheelController.cpp

World file

$ emacs wheelWorld.xml

wheelWorld.xml

This world file specifies the 3D model file of the mobile robot as "mobile_base.xml" A camera is attached on a link named "LINK_CENTER" which is the main body of the mobile robot. A plastic bottle is also appeared as an obstacle.

Execution

$ sigserver.sh -w ./wheelWorld.xml

You can see a plastic bottle in front of the mobile robot.

For example, send a message "1 0.5" from the SIGViewer. The mobile robot will move to the right ahead.

mobile_robot_result.PNG

The robot can go backward.

Up:Tutorial?    Previous:Control of humanoid agent by BVH file     Next: Distance sensor  

Counter: 3640, today: 2, yesterday: 0

Attach file: fileMobileBase_2.1.0.tar.gz 946 download [Information] filemobile_robot_result.PNG 1712 download [Information] filemobile_robot_bottom_view.jpg 1716 download [Information] filemobile_robot_top_view.jpg 1817 download [Information]

Front page   Edit Freeze Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes
Last-modified: 2014-02-07 (Fri) 14:48:04 (3724d)