Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
Customising the Turtle
Description: Pre-load your own customisations/configuration on the turtle.Keywords: turtlebot rapp
Tutorial Level: INTERMEDIATE
Next Tutorial: Create your First Rapp
Set environment variables, args or create a parent launcher for starting your customised turtlebot. |
Goal
There are various levels at which you can influence the configuration of your turtlebot. Depending on how much you want to reconfigure, choose the level that is appropriate for your circumstance.
Roslaunch Args
The turtlebot launcher minimal.launch is designed in such a way so that all of the important variables for a turtlebot are exposed via roslaunch args:
> roslaunch turtlebot_bringup minimal.launch --ros-args
As a temporary way of configuring variables, you can do this from the command line in the usual way.
> roslaunch turtlebot_bringup minimal.launch robot_name:=bob --screen
To verify the name change
> rocon_master_info
Environment Variables
A very few of the core variables listed with --ros-args have been implemented as environment variables so you can modify the turtlebot minimal launch without having to write a new launcher. These are typically for hardware, map filenames and/or pre-loaded applications.
> env | grep TURTLEBOT_ TURTLEBOT_STAGE_MAP_FILE=/maps/maze.yaml TURTLEBOT_3D_SENSOR=asus_xtion_pro TURTLEBOT_STACKS=hexagons TURTLEBOT_SIMULATION=false TURTLEBOT_RAPP_PACKAGE_WHITELIST=[rocon_apps, turtlebot_rapps] TURTLEBOT_STDR_MAP_FILE=/maps/sparse_obstacles.yaml TURTLEBOT_SERIAL_PORT=/dev/kobuki TURTLEBOT_BASE=kobuki TURTLEBOT_RAPP_PACKAGE_BLACKLIST=[] TURTLEBOT_TYPE=turtlebot TURTLEBOT_STAGE_WORLD_FILE=/maps/stage/maze.world TURTLEBOT_BATTERY=/sys/class/power_supply/BAT0 TURTLEBOT_MAP_FILE=/opt/turtlebot/src/turtlebot_apps/turtlebot_navigation/maps/willow-2010-02-18-0.10.yaml TURTLEBOT_INTERACTIONS_LIST=[turtlebot_bringup/documentation.interactions, my_rapps_tutorial/my.interactions] TURTLEBOT_NAME=turtlebot
To change the name as done previously:
> export TURTLEBOT_NAME=bob > roslaunch turtlebot_bringup minimal.launch --screen
Save in your setup.bashrc or somewhere similar for permanent effect.
Launcher
Finally to make a significant modification to the turtlebot customisation, create a launcher:
Run it:
> roslaunch my_turtle.launch --screen
You can check the changes again with rocon_master_info.
What Next?
Create your First Rapp or return to TurtleBot main page.