Home » Turtlebot3与仿真 » Turtlebot3与仿真-Standalone Gazebo Plugin

Turtlebot3与仿真-Standalone Gazebo Plugin

说明

  • 介绍如何在没用到ROS的情况下使用tb3进行仿真

  • 测试环境:Ubuntu 16.04 + ROS Kinetic

操作步骤

  • 安装相关的包及库
$ sudo apt-get install libgazebo7-dev
$ git clone https://github.com/ROBOTIS-GIT/turtlebot3_gazebo_plugin
$ vim ~/.bashrc
## 添加下面两段话到内容的最后面,保存退出
export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:${turtlebot3_gazebo_plugin path}/build
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:${turtlebot3_gazebo_plugin path}/models

## 编译
$ cd ${turtlebot3_gazebo_plugin path}
$ mkdir build
$ cd build
$ cmake ..
$ make

TIP: turtlebot3_gazebo_plugin path = ~/turtlebot3_gazebo_plugin

  • 新终端,运行插件
$ cd ${turtlebot3_gazebo_plugin}
$ gazebo worlds/turtlebot3_${TB3_MODEL}.world
## TURTLEBOT3_MODEL有burger, waffle或waffle_pi三种

请输入图片描述

请输入图片描述

  • 键盘控制
w - set linear velocity up
x - set linear velocity down
d - set angular velocity up
a - set angular velocity down
s - set all velocity to zero
  • 新终端,查看topic
$ gz topic -l
  • 新终端,订阅scan数据
$ gz topic -e /gazebo/default/user/turtlebot3_${TB3_MODEL}/lidar/hls_lfcd_lds/scan
  • 新终端,订阅 image 数据
## waffle
$ gz topic -e /gazebo/default/user/turtlebot3_waffle/image/intel_realsense_r200/image
## Waffle Pi
$ gz topic -e /gazebo/default/user/turtlebot3_waffle_pi/image/raspberry_pi_cam/image
  • 新终端,启动监听
$ cd ${turtlebot3_gazebo_plugin}/build
$ ./lidar_listener ${TB3_MODEL}
  • 新终端,启动监听
$ cd ${turtlebot3_gazebo_plugin}/build
$ ./lidar_listener ${TB3_MODEL}

参考链接

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: turtlebot3与仿真