博客地址:https://www.cnblogs.com/zylyehuo/
参考链接
Moveit!机械臂控制
文件下载-古月ROS教程视频配套资料
解决Could not find a package configuration file provided by “manipulation_msgs“
moveIt之Unable to identify any set of controllers that can actuate the specified joints问题解决
Unable to identify any set of controllers that can actuate the specified joints: joint1 joint2 …出错
环境配置
Ubuntu 18.04 melodic
成果图
Part 1: Rviz 机械臂仿真
step1: 下载机械臂模型
下载地址
文件下载-古月ROS教程视频配套资料
step2: 创建工作空间
mkdir -p 6R_mechanical_arm/src
cd 6R_mechanical_arm
catkin_make
step3: src文件夹
将之前下载的机械臂模型中 description、gazebo、planning文件夹复制到 src文件夹下
step4: 在 rviz 中显示机械臂模型
在终端中运行 roscore
在工作空间 6R_mechanical_arm 中打开终端
roslaunch marm_description view_arm.launch
step5: 安装 MoveIt
在终端执行以下命令
sudo apt-get install ros-melodic-moveit
step6: 启动 MoveIt
在终端执行以下命令
rosrun moveit_setup_assistant moveit_setup_assistant
step7: 配置 MoveIt
(1)Start
(2)Self-Collisions
(3)Planning Groups(核心)
检查是否与下图一致
(4)Robot Poses
(5)End Effectors
(6)Author Information
(7)Configuration Files
step8: 重新编译工作空间
step9: 启动demo文件,测试 rviz 仿真环境
拖动规划
直接鼠标拖动机械臂末端执行器
点击 plan ,进行路径规划
点击 excute ,机械臂运动
设置动画是否循环播放
随机目标点规划
设置初始位姿
添加场景物体
可通过拖动箭头变换位置
Part 2: MoveIt 基础编程
以下代码运行都是在 rviz 打开的前提下执行
关节空间规划
在工作空间中打开终端
source ./devel/setup.bash
rosrun marm_planning moveit_fk_demo.py
工作空间规划
在工作空间中打开终端
source ./devel/setup.bash
rosrun marm_planning moveit_ik_demo.py
笛卡尔路径规划
显示路径
走直线
在工作空间中打开终端
source ./devel/setup.bash
rosrun marm_planning moveit_cartesian_demo.py _cartesian:=True (走直线)
走曲线
在工作空间中打开终端
source ./devel/setup.bash
rosrun marm_planning moveit_cartesian_demo.py _cartesian:=False (走曲线)
*
避障规划
在工作空间中打开终端
source ./devel/setup.bash
rosrun marm_planning moveit_obstacles_demo.py
Part 3: Gazebo 机械臂仿真
step1: 依赖文件配置
(1)关节轨迹控制器
trajectory_control.yaml
arm_trajectory_controller.launch
(2)MoveIt 控制器
在 6R_mechanical_arm/src/marm_moveit_config/config 路径下新建 controllers.yaml 文件
6R_mechanical_arm/src/marm_moveit_config/config/controllers.yaml
controller_manager_ns: controller_manager
controller_list:
- name: arm/arm_joint_controller
action_ns: follow_joint_trajectory
type: FollowJointTrajectory
default: true
joints:
- joint1
- joint2
- joint3
- joint4
- joint5
- joint6
- name: arm/gripper_controller
action_ns: follow_joint_trajectory
type: FollowJointTrajectory
default: true
joints:
- finger_joint1
- finger_joint2
6R_mechanical_arm/src/marm_moveit_config/launch/arm_moveit_controller_manager.launch.xml
6R_mechanical_arm/src/marm_moveit_config/launch/moveit_planning_execution.launch
# The planning and execution components of MoveIt! configured to
# publish the current configuration of the robot (simulated or real)
# and the current state of the world as seen by the planner
# The visualization component of MoveIt!
[/arm/joint_states]
(3)启动环境
arm_world.launch
(4)联结所有 launch 文件
arm_bringup_moveit.launch
step2: 启动 gazebo 和 rviz 仿真环境
在工作空间路径下打开终端,输入以下命令
source ./devel/setup.bash
roslaunch marm_gazebo arm_bringup_moveit.launch
调整 rviz 设置
调整 gazebo 设置
存在模型抖动现象,暂时不调整
step3: 使用 MoveIt
调整机器人目标位置
点击 Plan & Execute
问题汇总
1、Could not find a package configuration file provided by “manipulation_msgs“
解决方法
参考地址:解决Could not find a package configuration file provided by “manipulation_msgs“
下载地址:
GitHub – ros-interactive-manipulation/manipulation_msgs: The package in this repo is DEPRECATED (see https://github.com/ros-interactive-manipulation/manipulation_msgs/issues/9)
GitHub – ros-interactive-manipulation/household_objects_database_msgs: Messages for the household_objects_database. The package in this repo is DEPRECATED and you’re advised to see moveit_msgs instead (see also https://github.com/ros-interactive-manipulation/household_objects_database_msgs/issues/5)
2、点击 plan&execute 后,rviz有变化,gazebo无变化
解决方案一:
在终端执行以下代码
sudo apt install ros-melodic-ros-controllers
解决方案二:
修改文件:
工作空间/src/marm_moveit_config/launch/trajectory_execution.launch.xml
将参数 pass_all_args="true" 删掉即可
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net