http://www.guyuehome.com/435
MoveIt!由ROS中一系列移动操作的功能包组成,包含运动规划,操作控制,3D感知,运动学,碰撞检测等等,而且提供友好的GUI。
用以下命令安装MoveIt:
sudo apt-get install ros-indigo-moveit-full
使用MoveIt!的第一步是要使用 Setup Assistant工具完成一些配置工作。Setup Assistant会根据用户导入的机器人的urdf模型,生成SRDF( Semantic Robot Description Format)文件,从而生成一个MoveIt!的功能包,来完成机器人的互动、可视化和仿真。
首先,来运行setup assistant:
roscore
rosrun moveit_setup_assistant moveit_setup_assistant
/home/kmxz/catkin_ws/src/mastering_ros_robot_description_pkg/urdf/seven_dof_arm.xacro
2. Self-Collision
点击左侧第二项Self-Collision,配置自碰撞矩阵,这里我们选择默认的采样点数量是10000个,按照这个默认值生成碰撞矩阵。
3. Virtual Joints
如果一个机械手固定在移动机器人上,我们需要定义一个虚拟关节,虚拟关节可以与移动基座关联,这里的机械手是固定不动的,所以可以不需要虚拟关节。
4. Planning Groups
在这个机械手的计划组中,为达到目标位姿我们需要建立joints、links两个规划组,一个是机械臂部分,一个是夹具部分。
在arm组中我们添加base_link作为grasping_frame第一环节
在gripper组中我们添加joints和links
建好之后
定义文件夹seven_dof_moveit_config:
roslaunch seven_dof_moveit_config setup_assistant.launch
roslaunch seven_dof_moveit_config demo.launch
创建一个从MoveIt!到Gazebo的控制文件controllers.yaml,在seven_dof_arm_config/config文件夹下:
controller_manager_ns: controller_manager controller_list:
•name: seven_dof_arm/seven_dof_arm_joint_controller
action_ns: follow_joint_trajectory
type: FollowJointTrajectory
default: true joints:
shoulder_pan_joint
shoulder_pitch_joint
elbow_roll_joint
elbow_pitch_joint
wrist_roll_joint
wrist_pitch_joint
gripper_roll_joint
•name: seven_dof_arm/gripper_controller
action_ns: follow_joint_trajectory
type: FollowJointTrajectory
default: true joints:
finger_joint1
finger_joint2
在launch文件夹下创建seven_dof_arm_moveit_controller_manager.launch文件:
<launch>
<arg name="moveit_controller_manager" default="moveit_simple_ controller_manager/MoveItSimpleControllerManager" />
<param name="moveit_controller_manager" value="$(arg moveit_ controller_manager)"/>
<arg name="use_controller_manager" default="true" />
<param name="use_controller_manager" value="$(arg use_controller_ manager)" />
<rosparam file="$(find seven_dof_arm_config)/config/controllers. yaml"/>
launch>
创建trajectory_control.yaml文件,在mastering_ros_robot_description_pkg/config文件夹下:
seven_dof_arm: seven_dof_arm_joint_controller:
type: "position_controllers/JointTrajectoryController" joints:
- shoulder_pan_joint
- shoulder_pitch_joint - elbow_roll_joint
- elbow_pitch_joint - wrist_roll_joint - wrist_pitch_joint - gripper_roll_joint
gains:
shoulder_pan_joint: {p: 1000.0, i: 0.0, d: 0.1, i_clamp: 0.0}
shoulder_pitch_joint: {p: 1000.0, i: 0.0, d: 0.1, i_clamp: 0.0}
elbow_roll_joint: {p: 1000.0, i: 0.0, d: 0.1, i_clamp: 0.0}
elbow_pitch_joint: {p: 1000.0, i: 0.0, d: 0.1, i_clamp:
0.0}
wrist_roll_joint: {p: 1000.0, i: 0.0, d: 0.1, i_clamp: 0.0}
wrist_pitch_joint: {p: 1000.0, i: 0.0, d: 0.1, i_clamp:
0.0}
gripper_roll_joint: {p: 1000.0, i: 0.0, d: 0.1, i_clamp: 0.0}
gripper_controller:
type: "position_controllers/JointTrajectoryController" joints:
•finger_joint1
•finger_joint2 gains:
finger_joint1: {p: 50.0, d: 1.0, i: 0.01, i_clamp: 1.0}
finger_joint2: {p: 50.0, d: 1.0, i: 0.01, i_clamp: 1.0}
创建seven_dof_arm_bringup_moveit.launch文件:
<launch>
<include file="$(find mastering_ros_robot_description_pkg)/launch/seven_dof_arm_world.launch" />
<include file="$(find mastering_ros_robot_description_pkg)/launch/seven_dof_arm_gazebo_states.launch" />
<include file="$(find seven_dof_arm_moveit_config)/launch/seven_dof_arm_trajectory_controller.launch" />
<include file="$(find seven_dof_arm_moveit_config)/launch/moveit_planning_execution.launch" />
launch>
运行:
roslaunch seven_dof_arm_moveit_config seven_dof_arm_bringup_moveit.launch
seven_dof_arm_gazebo
apt-cache search seven_dof_arm_gazebo
Moveit输出规划轨迹到Gazebo
http://blog.csdn.net/yaked/article/details/51436262