< >
Home » ROS与Web入门教程 » ROS与web入门教程-安装ROS与仿真

ROS与web入门教程-安装ROS与仿真

ROS与web入门教程-安装ROS与仿真

说明:

  • 介绍如何安装ros
  • 介绍如何安装turtlesim仿真和turtlebot3仿真
  • ubuntu18.04 + melodic

步骤:

  • 参考ros安装教程
  • 根据上述安装,可能会出现,因为我们之前先安装了LNMP导致安装mysqlclient会有问题
unable to open '/usr/include/mysql/plugin.h.dpkg-new': No such file or directory
cd /usr/include
sudo rm -rf  mysql
sudo ln -s /usr/local/mysql/include mysql
  • 再通过
sudo apt --fix-broken install
  • 即可继续安装

安装turtlesim仿真

  • 安装仿真, 采用ros-melodic-desktop-full ,已经安装上。

turtlebot3仿真

  • 安装依赖
  • 安装turtlebot3
  • 安装依赖
sudo apt-get install ros-melodic-joy ros-melodic-teleop-twist-joy ros-melodic-teleop-twist-keyboard ros-melodic-laser-proc ros-melodic-rgbd-launch ros-melodic-depthimage-to-laserscan ros-melodic-rosserial-arduino ros-melodic-rosserial-python ros-melodic-rosserial-server ros-melodic-rosserial-client ros-melodic-rosserial-msgs ros-melodic-amcl ros-melodic-map-server ros-melodic-move-base ros-melodic-urdf ros-melodic-xacro ros-melodic-compressed-image-transport ros-melodic-rqt-image-view ros-melodic-gmapping ros-melodic-navigation ros-melodic-interactive-markers
  • 安装源码
$ mkdir -p ~/catkin_ws/src/ && cd ~/catkin_ws/src/
$ git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
$ git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
$ cd ~/catkin_ws && catkin_make
  • 安装turtlebot3_simulations
  • 安装依赖
sudo apt-get install -y ros-melodic-navigation ros-melodic-teb-local-planner* ros-melodic-ros-control ros-melodic-ros-controllers ros-melodic-gazebo-ros-control ros-melodic-ackermann-msgs ros-melodic-serial qt4-default ros-melodic-effort-controllers ros-melodic-joint-state-controller ros-melodic-tf2-ros ros-melodic-tf
  • 安装源码
$ cd ~/catkin_ws/src/
$ git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
$ cd ~/catkin_ws && catkin_make
  • 增加工作空间到bashrc
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
  • 增加指定turtlebot3机型:
echo "export TURTLEBOT3_MODEL=burger" >> ~/.bashrc

安装rosbridge

  • 安装rosbridge
sudo apt install ros-melodic-rosbridge-suite
  • 安装web-video-server,替代mjpeg-server
sudo apt install ros-melodic-web-video-server

测试:

  • 测试turtlesim_node
  • 二个终端分别执行
$ roscore    
$ rosrun turtlesim turtlesim_node
  • 效果如下:
    请输入图片描述

  • 测试turtlebot3

roscd turtlebot3_bringup 
roslaunch turtlebot3_gazebo turtlebot3_world.launch
  • 顺利的话,能正常打开gazebo和world地图
  • 效果如下:
    请输入图片描述

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

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


标签: ros与web入门教程