环境搭建

环境配置

1. 安装moveit!

sudo apt install ros-melodic-moveit
sudo apt install ros-melodic-moveit-*

2. 安装catkin工具

sudo apt-get install ros-melodic-catkin python-catkin-tools

开发依赖

1. 安装依赖

cd ws/src
rosdep install -y --from-paths . --ignore-src --rosdistro melodic

2. package.xml配置

<build_depend>moveit_visual_tools</build_depend>
<build_depend>moveit_core</build_depend>
<build_depend>moveit_msgs</build_depend>
<build_depend>moveit_planners_ompl</build_depend>
<build_depend>moveit_ros_move_group</build_depend>
<build_depend>moveit_ros_planning_interface</build_depend>
<build_depend>moveit_ros_visualization</build_depend>

<exec_depend>moveit_visual_tools</exec_depend>
<exec_depend>moveit_core</exec_depend>
<exec_depend>moveit_msgs</exec_depend>
<exec_depend>moveit_planners_ompl</exec_depend>
<exec_depend>moveit_ros_move_group</exec_depend>
<exec_depend>moveit_ros_planning_interface</exec_depend>
<exec_depend>moveit_ros_visualization</exec_depend>

3. CMakeLists.txt配置

find_package(catkin REQUIRED COMPONENTS
    roscpp
    rosmsg
    rospy

    moveit_core
    moveit_msgs
    moveit_planners_ompl
    moveit_visual_tools
    moveit_ros_move_group
    moveit_ros_planning_interface
    moveit_ros_visualization
)

Tip

moveit_core: moveit核心库。

moveit_msgs:moveit消息库。

moveit_planners_ompl:moveit运动路径规划库。

moveit_visual_tools:moveit可视化工具。

moveit_ros_move_group: moveit ros移动接口库。

moveit_ros_planning_interface: moveit ros路径规划接口库。

moveit_ros_visualization: moveit ros可视化接口。