sudo apt-get install ros-kinetic-ros-controllers ros-kinetic-gazebo* ros-kinetic-moveit* ros-kinetic-dynamixel-sdk ros-kinetic-dynamixel-workbench-toolbox ros-kinetic-ar-track-alvar ros-kinetic-ar-track-alvar-msgs ros-kinetic-industrial-core libsdl1.2-dev libsdl-image1.2-dev
mkdir -p ~/turtlebot_ws/src
cd ~/turtlebot_ws/src
git clone https://github.com/GJXS1980/TurtleBot-Tutorial.git
git clone https://github.com/GJXS1980/slam_gmapping.git
git clone https://github.com/GJXS1980/navigation.git
cd ~/turtlebot_ws
catkin_make
echo "source ~/turtlebot_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
export TURTLEBOT3_MODEL=${TB3_MODEL}
export TURTLEBOT3_MODEL=waffle_pi
export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:~/turtlebot/src/turtlebot3/turtlebot3_gazebo_plugin/build
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:~/turtlebot/src/turtlebot3/turtlebot3_gazebo_plugin/models
在终端输入
source .bashrc
使环境生效
调出TurtleBot3机器人模型
roslaunch turtlebot3_fake turtlebot3_fake.launch
使TurtleBot3可以通过键盘控制
roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
(1)调出TurtleBot3机器人模型
roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch
(2)urtleBot3世界
TurtleBot3 world是由构成TurtleBot3符号形状的简单对象组成的地图。TurtleBot3世界主要用于SLAM和导航等测试。
roslaunch turtlebot3_gazebo turtlebot3_world.launch
(3)TurtleBot3房子
TurtleBot3 House是用房屋图纸制作的地图。它适用于涉及更复杂任务性能的测试。
roslaunch turtlebot3_gazebo turtlebot3_house.launch
(1)遥控操作
为了使用键盘控制TurtleBot3,请在新的终端窗口中使用以下命令启动遥控操作功能
roslaunch turtlebot3_gazebo turtlebot3_house.launch
打开新终端
roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
(2)避免碰撞
为了自主驱动TurtleBot3世界的TurtleBot3,打开一个新的终端窗口并输入以下命令。
roslaunch turtlebot3_gazebo turtlebot3_world.launch
打开一个新的终端窗口并输入下面的命令
roslaunch turtlebot3_gazebo turtlebot3_simulation.launch
当模拟运行时,RViz可视化发布的主题。您可以通过输入以下命令在新的终端窗口中启动RViz
roslaunch turtlebot3_gazebo turtlebot3_gazebo_rviz.launch
对于Gazebo中的虚拟SLAM,您可以选择上面提到的各种环境和机器人模型,而不是运行实际的机器人,而SLAM相关命令将使用SLAM部分中使用的ROS软件包。以下命令是使用TurtleBot3 Waffle Pi模型和turtlebot3_world环境的示例。
roslaunch turtlebot3_gazebo turtlebot3_world.launch
roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping
roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
rosrun map_server map_saver -f ~/map
####6.虚拟导航与TurtleBot3
对于Gazebo中的虚拟导航,您可以选择上面提到的各种环境和机器人模型,而不是运行实际的机器人,导航相关命令将使用导航部分中使用的ROS软件包。
roslaunch turtlebot3_gazebo turtlebot3_world.launch
roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml
roslaunch turtlebot3_gazebo multi_turtlebot3.launch
roslaunch turtlebot3_gazebo multi_turtlebot3_slam.launch ns:=tb3_0
roslaunch turtlebot3_gazebo multi_turtlebot3_slam.launch ns:=tb3_1
roslaunch turtlebot3_gazebo multi_turtlebot3_slam.launch ns:=tb3_2
roslaunch turtlebot3_gazebo multi_map_merge.launch
rosrun rviz rviz -d `rospack find turtlebot3_gazebo`/rviz/multi_turtlebot3_slam.rviz
rosrun turtlebot3_teleop turtlebot3_teleop_key cmd_vel:=tb3_0/cmd_vel
rosrun map_server map_saver -f ~/map
export TURTLEBOT3_MODEL=burger
export TURTLEBOT3_MODEL=waffle
export TURTLEBOT3_MODEL=waffle_pi
在终端输入
source .bashrc
使环境生效
roslaunch open_manipulator_with_tb3_description open_manipulator_with_tb3_rviz.launch
教程参考:OpenCR Setup
roslaunch open_manipulator_with_tb3_description open_manipulator_with_tb3_model.launch use_gazebo:=false
roslaunch open_manipulator_with_tb3_tools open_manipulator_with_tb3_slam.launch use_gazebo:=false open_rviz:=true
roslaunch open_manipulator_with_tb3_tools open_manipulator_with_tb3_navigation.launch use_gazebo:=false open_rviz:=true
roslaunch open_manipulator_ar_markers ar_pose.launch
roslaunch open_manipulator_with_tb3_tools open_manipulator_with_tb3_manipulation.launch use_gazebo:=false open_rviz:=true
为了控制OpenManipulator的抓取器,请使用下面的命令在新的终端窗口中使用主题发布
rostopic pub /open_manipulator_with_tb3/gripper std_msgs/String "data: 'grip_off'" --once
这里提供移动操作的拾取和放置示例。此示例由控制器启动,即自动启动和停止导航堆栈MoveIt!,通过传送ROS消息来选择和放置启动文件。用户可以修改此节点以应用其环境。
roslaunch open_manipulator_with_tb3_tools open_manipulator_with_tb3_controller.launch
在Gazebo模拟器上用OpenManipulator加载TurtleBot3并单击Play按钮
roslaunch open_manipulator_with_tb3_gazebo open_manipulator_with_tb3_gazebo.launch
键入rostopic list以检查哪个主题已激活。
rostopic pub /joint4_position/command std_msgs/Float64 "data: 0.21" --once
参考网站:
http://emanual.robotis.com/docs/en/platform/turtlebot3/simulation/#simulation
https://github.com/ROBOTIS-GIT/emanual/blob/master/docs/en/platform/turtlebot3/simulation.md