源码获取
直接从github下载源码包mavros-2.6.0.tar.gz
拷贝到ubuntu22的树莓派中, 解压
tar -xf mavros-2.6.0.tar.gz
进入项目中
cd mavros-2.6.0
总共需要编译两个文件包
mavros
mavros_msgs
先编译mavros_msgs
colcon build --packages-select mavros_msgs
这步一般不会报错
编译完后source一下
source install/setup.sh
编译mavros
colcon build --packages-select mavros
中间可能要安装很多依赖,总结如下
sudo apt-get install ros-kinetic-mavlink
sudo apt-get install geographiclib-tools
sudo apt-get install ros-humble-geographic-msgs
sudo apt-get install ros-humble-libmavconn
sudo apt-get install ros-humble-geographic-*
sudo apt-get install geographiclib-*
sudo apt-get install libgeographic-*
sudo apt-get install ros-humble-eigen-stl-containers
sudo apt-get install ros-humble-diagnostic-updater
最后source一下
运行
修改串口名称和波特率,最后
ros2 launch mavros apm.launch