获取MoveIt 2源代码
你可以从GitHub上获取MoveIt 2的源代码:
cd ~/moveit2_ws/src
git clone https://github.com/ros-planning/moveit2.git -b galactic
安装依赖项
使用rosdep安装所有必需的依赖项:
cd ~/moveit2_ws
rosdep install -y --from-paths src --ignore-src --rosdistro galactic
编译MoveIt 2
使用colcon工具编译MoveIt 2:
cd ~/moveit2_ws
colcon build --event-handlers desktop_notification- status- --cmake-args -DCMAKE_BUILD_TYPE=Release
源代码环境
在你的bashrc文件中添加以下行以便在新的终端中自动源代码环境:
echo 'source ~/moveit2_ws/install/setup.bash' >> ~/.bashrc
source ~/.bashrc
下载并运行MoveIt 2的demo
你可以从GitHub上获取MoveIt 2的demo:
cd ~/moveit2_ws/src
git clone https://github.com/ros-planning/moveit2_tutorials.git -b galactic
然后编译并运行demo:
cd ~/moveit2_ws
colcon build --event-handlers desktop_notification- status- --cmake-args -DCMAKE_BUILD_TYPE=Release
ros2 launch moveit2_tutorials demo.launch.py
以上就是在ROS 2 Galactic版本中安装MoveIt 2并运行一些demo测试其基本功能的步骤。如果在安装过程中遇到任何问题,你可以参考MoveIt 2的GitHub页面或者在ROS社区中寻求帮助。