170112- robotic arm moveit! Crawl

Foreword

  • In this section there is a little high-level

reference

Mastering ROS

Learning Record

3D vision sensor using

  • This is the basis for crawling tasks
  • note! Gazebo by the sensor may be analog, and may be directly connected to the physical devices in the incoming Gazebo

Verify that the correct plugin work Gazebo

  • Use RViz View Gazebo plug-outgoing point cloud data
roslaunch seven_dof_arm_gazebo seven_dof_arm_bringup_grasping
# 这个命令打开gazebo,关节控制器,gazebo视觉传感器插件
  • Add tables and objects in the gazebo in
  • Open RViz view point cloud information

Member of the robot environment

  • Write some profile configuration Moveit plugin (built OctoMap Updater) will Gazebo simulation out of the point cloud data input to the planning scenario Moveit
  • Robot environment in general octree to represent, OctoMap already a plug-in Moveit, called Occupany Map Updater plugin can generate octree from different sensor sources, there are two Updater
    • PointCloud Occupancy Map Updater: This plugin can take input in the form of point clouds (sensor_msgs/PointCloud2)
    • Depth Image Occupancy Map Updater: This plugin can take input in the form of input depth images (sensor_msgs/Image)
  • The first step is to write some configuration files for these plug-ins, plug-ins used to define its properties
# 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
  • The second step is to write a boot file
# 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>

Startup file

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

Achieve crawl task

  • There is a ready packet, called moveit_simple_grasps, this is a simple operation of generating a gripper which receives the attitude data of the object being grasped, the grasping an object sequence generating operation, and filtered to remove the by multithreaded IK solver illegal act of grasping. This package comprises a gripping generator grasp generators, grasp filters, visualization tools. This tool has been supported by a number of robots and robotic arm, we can support their own robotic arm by a simple modification.
  • Copy moveit-simpl-grasps folder to the project
roslaunch seven_dof_arm_gazebo grasp_generator_server.launch
  • We need to provide a robotic arm to the server planning group and end-effector group, so it is necessary to do some definition in your startup file
<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>
  • Next, we need to define grasp_data.yaml
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'

Establish client and server

  • There are many ways to achieve crawling tasks, 1) defined in advance series joint angle values, this approach we need to grip the object to be placed in a predefined position 2) by the inverse kinematics to capture, providing a manually grasping an object pose 3) to capture visual servo manner, also depends inverse kinematics, but to obtain the pose of the object being grasped visually
  • Here we provide directly pose is grasping an object

In the simulation moveit demo

  • Use python grasp client
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客户端
  • Crawl process can be divided into six steps
      1. The client creates are grasping an object in the scene, to provide position and orientation information
      1. After obtaining pose information, sends it to the server to fetch grasp server, inverse kinematics solver, if the solution worked out, the robotic arm will pass
      1. Drop action place action

python client source code interpretation

  • An important is the information we create the physical environment in the gazebo should be reflected in the client, so we have to add obstacles and information is grasping an object in the client, but because grasp server is simple, so it is best Add simple geometric objects.
  • There are some news subscription and publication of function definitions
  • Define the action client

In the gazebo in simulation

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
  • In the real machine is the same, but plus motor controller controller

Guess you like

Origin www.cnblogs.com/lizhensheng/p/11117536.html