终端运行:
sudo apt install ros-melodic-desktop-full 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 ros-melodic-turtlebot3-gazebo
sudo apt install ros-melodic-desktop-full 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 ros-melodic-turtlebot3-gazebo
(1)创建工作空间
mkdir -p ~/catkin_ws/src
(2)进入src文件夹下面,将其初始化为ROS工作空间
cd ~/catkin_ws/src
catkin_init_workspace
(3)编译工作空间
cd ..
(4)设置环境变量
source devel/setup.bash
gedit ~/.bashrc
source ~/catkin_ws/devel/setup.bash
下载源码到src文件中:
终端运行:
- cd ~/catkin_ws/src
- git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
编译源码:
cd ~/catkin_ws && catkin_make
设置机型burger、waffle或waffle pi,写入bashrc中:
终端运行:
gedit ~/.bashrc
写入:
export TURTLEBOT3_MODEL=burger
前提:turtlebot3、主机需要在一个局域网中!!!(解释:turtlebot3连接wifi、主机连接从wifi出来的网线或wifi)
主机:自己电脑;从机:turtlebot3;
终端输入:
ifconfig
IP:inet 192.168.3.16
hostname
终端运行:
gedit ~/.bashrc
写入:
export ROS_MASTER_URI=http://192.168.3.16:11311 注意:这里是主机IP
export ROS_HOSTNAME=192.168.3.16 注意:这里是主机IP
终端运行:
sudo gedit /etc/hosts
写入turtlebot3的IP和hostname:
192.168.3.13 robot
source ~/.bashrc
终端运行:
sudo nano /etc/hosts
写入 主机的IP和hostname:
192.168.3.16 w19-19a405
终端运行:
nano ~/.bashrc
写入:
export ROS_MASTER_URI=http://192.168.3.16:11311 注意:这里是主机IP
export ROS_HOSTNAME=192.168.3.13 注意:这里是turtlebot3的IP
终端运行:
source ~/.bashrc
成功Ubuntu18.04 ROS melodic安装Cartograhper+Ceres1.13.0,以及错误总结_静心、尽心-est的博客-CSDN博客_ros安装ceres
(1)打开一个终端,运行roscore;
(2)打开一个终端,启动ssh、运行turtlebot3:
ssh
ssh robot@192.168.3.13
检查是否连接成功,查看是否订阅roscore话题:
rostopic list
roslaunch turtlebot3_bringup turtlebot3_robot.launch
(3)打开一个新终端,运行cartographer:
roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=cartographer
(4)打开一个新终端,运行运动控制:
roslaunch mbot_teleop mbot_teleop.launch
(5)结束,开始测试!
(6)退出ssh
Ctrl+D
或
exit