ROS2环境安装

MyCobot 280 RDKX5 版本自带Ubuntu(V-22.04)系统,内置开发环境,无需搭建和管理,更新mycobot_ros2包即可。

mycobot_ros2是大象机器人推出的适用于其mycobot系列桌面六轴机械臂的ROS2包。

ROS2项目地址: http://github.com/elephantrobotics/mycobot_ros2

机械臂API驱动库地址: https://github.com/elephantrobotics/pymycobot

更新 mycobot_ros2 包

为了保证用户能及时使用最新的官方包,可以通过文件管理器进入/home/sunrise/colcon_ws/src文件夹,打开控制台终端( 快捷键 Ctrl+Alt+T ) ,输入以下命令进行更新:

# 克隆github上的代码
cd colcon_ws/src  # 进入工作区的src文件夹中
# 克隆github上的代码
git clone --depth 1 https://github.com/elephantrobotics/mycobot_ros2.git
cd ..       # 返回工作区
colcon build  # 构建工作区中的代码
source install/setup.bash # 添加环境变量

为节省编译时间,可以选择单独编译某个功能包:

colcon build --packages-select 包名

例如只编译 mycobot_280_rdkx5这个功能包:

cd ~/colcon_ws
colcon build --packages-select mycobot_280_rdkx5
source install/setup.bash

注意: 如果在/home/sunrise/colcon_ws/src(相当于~/colcon_ws/src)目录下已经存在mycobot_ros2文件夹,则需要先删除原来的mycobot_ros2,然后再执行上述命令。 其中,目录路径中的sunrise为系统的用户名。 如有不一致,请修改。

至此ROS2环境搭建完成,ROS2的使用请参考Rviz介绍及使用章节

results matching ""

    No results matching ""