其他分享
首页 > 其他分享> > 170112-机械臂moveit!抓取

170112-机械臂moveit!抓取

作者:互联网

前言

参考

Mastering ROS

学习记录

使用3D视觉传感器

确认Gazebo插件正确工作

roslaunch seven_dof_arm_gazebo seven_dof_arm_bringup_grasping
# 这个命令打开gazebo,关节控制器,gazebo视觉传感器插件

构件机器人环境

# seven_dof_arm_config/config/sensors_rgbd.yaml
sensors:
- sensor_plugin: occupancy_map_monitor/PointCloudOctomapUpdater
point_cloud_topic: /rgbd_camera/depth/points # 订阅的主题
max_range: 10 # 加入规划场景处理的范围
padding_offset: 0.01 # 其他定义
padding_scale: 1.0
point_subsample: 1
filtered_cloud_topic: output_cloud
# seven_dof_arm_config/launch/seven_dof_arm_moveit_sensor_manager.launch
<launch>
<rosparam command="load" file="$(find seven_dof_arm_config)/config/
sensors_rgbd.yaml" />
</launch> # 简单地加载参数到参数服务器
# sensor_manager.launch
<launch>
<!-- This file makes it easy to include the settings for sensor
managers -->
<!-- Params for the octomap monitor -->
<!-- <param name="octomap_frame" type="string" value="some frame in
which the robot moves" /> -->
# 这句话是注释的,因为书本上的示例机器人是静止的,如果机械臂固结在移动机器人上,那么需要定义八叉树地图的坐标系
<param name="octomap_resolution" type="double" value="0.015" />
<param name="max_range" type="double" value="5.0" />
# 这是分辨率和范围
<!-- Load the robot specific sensor manager; this sets the moveit_
sensor_manager ROS parameter -->
<arg name="moveit_sensor_manager" default="seven_dof_arm" />
<include file="$(find seven_dof_arm_config)/launch/$(arg moveit_
sensor_manager)_moveit_sensor_manager.launch.xml" />
</launch>

启动文件

roslaunch seven_dof_arm_gazebo seven_dof_arm_bringup_grasping.launch
# 启动gazebo,加入桌子和物体
roslaunch seven_dof_arm_config moveit_planning_execution.launch
# 启动Moveit规划器,这是在RViz中的规划界面
# 现在RViz中可以看到八叉树地图了

实现抓取任务

roslaunch seven_dof_arm_gazebo grasp_generator_server.launch
<launch>
  <arg name="robot" default="cyton_gamma_1500"/>

  <arg name="group"        default="arm"/>
  <arg name="end_effector" default="gripper"/>


  <node pkg="moveit_simple_grasps" type="moveit_simple_grasps_server" name="moveit_simple_grasps_server">
    <param name="group"        value="$(arg group)"/>
    <param name="end_effector" value="$(arg end_effector)"/>

    <rosparam command="load" file="$(find gamma_1500_gazebo)/config/$(arg robot)_grasp_data.yaml"/>

  </node>


</launch>
base_link: 'base_link'

gripper:
  end_effector_name: 'gripper'

  # Default grasp params
  joints: ['gripper_joint', 'gripper_joint2']

  pregrasp_posture: [0.0, 0.0]
  pregrasp_time_from_start: 4.0

  grasp_posture: [1.0, 1.0]
  grasp_time_from_start: 4.0

  postplace_time_from_start: 4.0

  # Desired pose from end effector to grasp [x, y, z] + [R, P, Y]
  grasp_pose_to_eef: [0.0, 0.0, 0.0]
  grasp_pose_to_eef_rotation: [0.0, 0.0, 0.0]

  end_effector_parent_link: 'wrist_roll'

建立客户端和服务端

在moveit demo中仿真

roslaunch seven_dof_config demo.launch
# 启动RViz界面
roslaunch seven_dof_arm_gazebo grasp_generator_server
# 启动moveit grasp 服务器
rosrun seven_dof_arm_gazebo pick_and_place.py
# 启动python客户端

python客户端源码解读

在gazebo中仿真

roslaunch seven_dof_arm_gazebo seven_dof_arm_bringup_grasping.launch
roslaunch seven_dof_arm_config moveit_planning_execution.launch
roslaunch seven_dof_arm_gazebo grasp_generator_server
rosrun seven_dof_arm_gazebo pick_and_place.py

标签:seven,dof,抓取,170112,grasp,gazebo,arm,moveit
来源: https://www.cnblogs.com/lizhensheng/p/11117536.html