Turtlebot3 Waffle_Pi + WSL ubuntu18 学习记录

Turtlebot3 Waffle_Pi + WSL ubuntu18 学习记录

0. Turtlebot3 组装

这个机器的安装非常的蠢。。正常安装好是有灯点亮,注意针孔线的接插方向,缺点防呆设计。。

1. remote_pc ros 安装

先前就在wsl上安好了的ros melodic,因为18支持的是melodic,可参考以下文章以及官方文档
官方文档
WSL install ROS - CSDN

2. turtlebot3 安装

主要还是参考官方文档,记录下踩坑的地方
Turtlebot3 guide
Turtlebot3 中文翻译指导

2.1 SD 卡的系统烧录

采用的是官方推荐的Ubuntu mate,选32位的ubuntu mate for raspberry。先装了64位的ubuntu mate,然后后面装摄像头,兼容出了问题,搞了半天,最后重装了32位的系统。
插上sd卡,然后就是熟悉的ubuntu安装。
win32diskmanger来刻录

2.2 turtlebot3 ssh 设置

sudo apt-get install openssh-server
sudo systemctl enable ssh
sudo dpkg-reconfigure openssh-server # 需要这一步生成keys之类的,才能ssh连接

2.3 turtlebot3 ros melodic安装

把以下所有的kinetic 换成melodic,先不着急装camera,会pop一些dependent packages,加上sudo apt-get install ros-melodic-xxx就可以了

sudo apt-get update
sudo apt-get upgrade
wget https://raw.githubusercontent.com/ROBOTIS-GIT/robotis_tools/master/install_ros_melodic_rp3.sh && chmod 755 ./install_ros_melodic_rp3.sh && bash ./install_ros_melodic_rp3.sh
sudo apt-get install ros-melodic-rosserial-python ros-melodic-tf
sudo apt-get install ros-melodic-urdf ros-melodic-xacro ros-melodic-interactive-markers ros-melodic-diagnostics

Reboot and then rebuild packages

source /opt/ros/melodic/setup.bash
cd ~/catkin_ws && catkin_make -j1

2.4 raspberry camera install

turtlebot3 raspberry camera guide
参照官方的链接,enable camera interface, reboot,一定要确保rapistill 可以用,否则可能装不好,我第一次用64位系统,就一直卡在这,最后换了32位才可以用

raspistill -v -o test.jpg

接下来参考github 上raspicam node的文章,用官方推荐的装不了,一直提示我vchostif缺失

cd ~/catkin_ws/src
git clone https://github.com/UbiquityRobotics/raspicam_node.git

修改的文件/etc/ros/rosdep/sources.list.d/30-ubiquity.list 添加上最后一行 yaml https://raw.githubusercontent.com/UbiquityRobotics/rosdep/master/raspberry-pi.yaml
Note:按照官方ros安装可能没有这个rosdep,这个地方需要自行安装一下

sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
sudo apt install python-rosdep
sudo rosdep init
rosdep update

这样才能修改这个文件,然后接着

cd ~/catkin_ws
# rosdep install --from-paths src --ignore-src --rosdistro=kinetic -y
rosdep install --from-paths src --ignore-src -y

# compile code
catkin_make

这里需要略去kinetic,但也是也不能换成melodic,才能装好。查看了github issue,别人是这么说的,对于ubuntu 18, melodic,just skip kinectic
github issue link

3. 网络配置

根据官网文档走就可以了,注意的是,turtlebot3 master uri 是远程电脑,hostname是自己的。远程电脑,两个都是自己的ip address

4. 连接测试

用ros的时候,在每个电脑的terminal都激活一下,不激活会出现各种找不到文件和package

source /devel/setup.bash

Terminal 1: Run on Turtlebot3

roslaunch turtlebot3_bringup turtlebot3_robot.launch

出现官方文档中的calibration end

Terminal 2: Run on remote pc

roscore

Terminal 3: Run on remote pc
注意这里${TB3_MODEL} 要换成自己的机器型号,否则后面找不到文件,比如我的是waffle_pi

# export TURTLEBOT3_MODEL=${TB3_MODEL}
export TURTLEBOT3_MODEL=waffle_pi
roslaunch turtlebot3_bringup turtlebot3_remote.launch

Terminal 4: Run on remote pc

rosrun rviz rviz -d "<full path to turtlebot3_description>/rviz/model.rviz"

然后就会pop out一个rviz的界面,显示你的robot了
Turtlebot3 on RVIZ
Note: WSL 是没有界面的,需要装一个xserver,我用的是VcSrv,参看以下这篇文章
WSL install ROS - CSDN
要注意的就是
multiple windows
display number : 0
取消native opengl

5. 后续开发有坑再补

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值