一、SSH登录
1.1 串口配置+串口登录
1.1.1无线网络配置
1.2 SSH登录
1.3 修改文件 用vim
1.4 安装togetherROS
1.4.1 安装ROS2-foxy
安装基础功能包
sudo apt install ros-foxy-ros-base ros-foxy-demo-nodes-cpp
sudo apt install ros-foxy-image-transport
sudo apt install ros-foxy-image-transport-plugins安装编译工具
sudo apt install python3-colcon-common-extensions安装git
sudo apt install git
1.4.2raw.githubusercontent.com“报错
1.4.3 source
source /opt/tros/local_setup.bash
1.5 CPU调频
二、导航
2.1安装SLAM-Toolbox
sudo apt-get install ros-foxy-slam-toolbox建立软连接
cd /opt/tros
sudo python3 create_soft_link.py --foxy /opt/ros/foxy/ --tros /opt/tros/
2.2安装Nav2
sudo apt update
# 安装graphicsmagick++
sudo apt install libgraphicsmagick++-q16-12sudo apt install ros-foxy-navigation2cd /opt/tros
# 使用/opt/tros目录下的create_soft_link.py创建ROS package至TogetherROS的软连接
sudo python3 create_soft_link.py --foxy /opt/ros/foxy/ --tros /opt/tros/
仿真功能包可选
sudo apt install ros-foxy-gazebo-*
sudo apt install ros-foxy-turtlebot3*sudo apt install ros-foxy-nav2-bringup
三、虚拟机
由于X3安装的是无图形化界面显示的系统,故rviz2、rqt等需要通过通信在PC机上显示,又因为需要在windows上通过SSH登录X3,所以选择在PC机上安装虚拟机,操作简单、方便、省事。
3.1 VMware安装包,提取码:b6qa
3.2 Ubuntu20.04镜像,提取码:if3l
3.3 环境配置
基本工具安装参考
3.4 安装ROS2 环境变量参考
添加ROS apt源sudo apt update && sudo apt install curl gnupg2 lsb-release
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null安装ROS2
sudo apt install ros-foxy-desktop source /opt/ros/foxy/setup.bashPC的ROS2安装成功后安装Gazebo和Turtlebot3相关的功能包,安装方法为:sudo apt-get install ros-foxy-gazebo-*
sudo apt install ros-foxy-turtlebot3
sudo apt install ros-foxy-turtlebot3-bringup
sudo apt install ros-foxy-turtlebot3-simulations
sudo apt install ros-foxy-teleop-twist-keyboardsudo apt install ~nros-foxy-rqt*
3.4.1 ros2话题命令
ros2 topic list # 查看话题列表
ros2 topic info <topic_name> # 查看话题信息
ros2 topic hz <topic_name> # 查看话题发布频率
ros2 topic bw <topic_name> # 查看话题传输带宽
ros2 topic echo <topic_name> # 查看话题数据
ros2 topic pub <topic_name> <msg_type> <msg_data> # 发布话题消息
3.4.2 编译工作空间
colcon build
3.5 与ROS2通信只需要将网络改为桥接,参考
3.6下载源码
git clone https://ghproxy.com/https://github.com/ros-planning/navigation2.git -b foxy-develhttps://ghproxy.com/为github加速代理git clone https://github.com/ROBOTIS-GIT/turtlebot3.git -b foxy-develgit clone https://github.com/SteveMacenski/slam_toolbox.git -b foxy-devel
四、零拷贝
前提准备
安装ROS2软件包构建系统ament_cmake
apt update;
apt-get install python3-catkin-pkg;
pip3 install empy
参考
五、双机导航与显示(仿真)
PC机
source /opt/ros/foxy/setup.bash
export TURTLEBOT3_MODEL=waffle
ros2 launch turtlebot3_gazebo turtlebot3_world.launch.pyX3:
source /opt/tros/setup.bashros2 launch nav2_bringup bringup_launch.py use_sim_time:=True map:=/opt/tros/share/nav2_bringup/maps/turtlebot3_world.yamlPC机
source /opt/ros/foxy/setup.bash
ros2 launch nav2_bringup rviz_launch.py
六、vscode远程开发
6.1 安装插件 remote development
6.2 ctrl+shift+p remote-ssh conenct to host
6.3 输入ssh链接
6.4 使用:重复6.2 ;文件-打开文件夹
6.5 一键安装远程扩展,不然不会有代码补全和提示