Turtlebot_navigation 使用记录
SLAM Map Building with TurtleBot
Bring up the robot:
roslaunch turtlebot_bringup minimal.launch
reason for kobuki no response: kobuki has no udev rules, to repair this:
rosrun kobuki_ftdi create_udev_rules
Run the gmapping demo app:
roslaunch turtlebot_navigation gmapping_demo.launch
note : I met “OpenNI2Driver, No matching device found”
Solve this:http://answers.ros.org/question/226236/openni2driver-no-matching-device-found/sudo apt-get install –reinstall ros-indigo-openni-camera ros-indigo-openni-launch
Add variable to the environment:
echo “export TURTLEBOT_3D_SENSOR=kinect” >> .bashrc
Actually this topic works instead of the topic above.
Remember that USB2.0 porter is needed.
Launch rviz:
roslaunch turtlebot_rviz_launchers view_navigation.launch
Using telop (keyboard, joystick, or other):
Keyboard Teleop:roslaunch turtlebot_teleop keyboard_teleop.launch –screen
Interactive Markers Teleop(teleoperate the robot from rviz):
- Installation:
sudo apt-get install ros-indigo-turtlebot-apps ros-indigo-turtlebot-interactions
sudo apt-get install ros-indigo-turtlebot-interactive-markers- Installation:
- Execute:
roslaunch turtlebot_interactive_markers interactive_markers.launch –screen
roslaunch turtlebot_rviz_launchers view_robot.launch
Save the map to file:
rosrun map_server map_saver -f /tmp/my_map
Note: Do not close the gmapping launch until saving the map.
Autonomous Navigation of a Known
The steps following is the same as the tutorial in the ros wiki
- Map with TurtleBotroslaunch turtlebot_navigation amcl_demo.launch map_file:=/tmp/my_map.yaml
roslaunch turtlebot_rviz_launchers view_navigation.launch –screen- In RVIZ:
- Localize the TurtleBot:
1.Click the “2D Pose Estimate” button
2.Click on the map where the TurtleBot approximately is and drag in the direction the TurtleBot is pointing. - To send a goal:
1.Click the “2D Nav Goal” button
2.Click on the map where you want the TurtleBot to drive and drag in the direction the TurtleBot should be pointing at the end.
- Localize the TurtleBot:
Combine the Launch file
In order to launch these steps in one step, changes to the launch file.
In addition, for farther change, I split the turtlebot_navigation module into my own workspace.
To launch turtlebot:<include file="$(find turtlebot_bringup)/launch/minimal.launch"/>
Copy the .rviz file in the ~/turtlebot/src/turtlebot_interactions/turtlebot_rviz_launchers/rviz to your workspace. Beside, add this:
<node name="rviz" pkg="rviz" type="rviz" respawn="true" args="-d $(find YOUR_PROJECT_NAME)/rviz/navigation.rviz"/>
Notice here, in the real practice, you will find that the rviz often failed to start. So I add the
respawn = “true”
in the node. It means that every time it fails to start, the process will retry to start this node again until it starts successfully or you interrupt the process. Another similar one is
required = “true”
It means once the node fails to start, the whole process will shut down.
- In RVIZ: