Attach Gripper to Robot

本教程介绍了怎样从现有的机器人零件,如移动基体,简单手臂和手抓等,来生成一个复杂的机器人。

Robot Components

启动gazebo,并且确保你可以从以前的教程中导入模型

Mobile Base

在教程Mobile Robot tutorial中,你将有你自己的移动机器人。

1.在本教程中,修改~/.gazebo/models/my_robot/model.sdf来确保模型足够的大,以便模型足够大,可以完成抓取。

gedit ~/.gazebo/models/my_robot/model.sdf

更新内容,来确保模型体足够大,并且重新定位相应的车轮。

<?xml version='1.0'?>
<sdf version='1.4'>
  <model name="mobile_base">
    <link name='chassis'>
      <pose>0 0 .25 0 0 0</pose>

      <inertial>
        <mass>20.0</mass>
        <pose>-0.1 0 -0.1 0 0 0</pose>
        <inertia>
          <ixx>0.5</ixx>
          <iyy>1.0</iyy>
          <izz>0.1</izz>
        </inertia>
      </inertial>

      <collision name='collision'>
        <geometry>
          <box>
            <size>2 1 0.3</size>
          </box>
        </geometry>
      </collision>

      <visual name='visual'>
        <geometry>
          <box>
            <size>2 1 0.3</size>
          </box>
        </geometry>
      </visual>

      <collision name='caster_collision'>
        <pose>-0.8 0 -0.125 0 0 0</pose>
        <geometry>
          <sphere>
            <radius>.125</radius>
          </sphere>
        </geometry>

        <surface>
          <friction>
            <ode>
              <mu>0</mu>
              <mu2>0</mu2>
            </ode>
          </friction>
        </surface>
      </collision>

      <visual name='caster_visual'>
        <pose>-0.8 0 -0.125 0 0 0</pose>
        <geometry>
          <sphere>
            <radius>.125</radius>
          </sphere>
        </geometry>
      </visual>
    </link>
    <link name="left_wheel">
      <pose>0.8 0.6 0.125 0 1.5707 1.5707</pose>
      <collision name="collision">
        <geometry>
          <cylinder>
            <radius>.125</radius>
            <length>.05</length>
          </cylinder>
        </geometry>
      </collision>
      <visual name="visual">
        <geometry>
          <cylinder>
            <radius>.125</radius>
            <length>.05</length>
          </cylinder>
        </geometry>
      </visual>
    </link>

    <link name="right_wheel">
      <pose>0.8 -0.6 0.125 0 1.5707 1.5707</pose>
      <collision name="collision">
        <geometry>
          <cylinder>
            <radius>.125</radius>
            <length>.05</length>
          </cylinder>
        </geometry>
      </collision>
      <visual name="visual">
        <geometry>
          <cylinder>
            <radius>.125</radius>
            <length>.05</length>
          </cylinder>
        </geometry>
      </visual>
    </link>

    <joint type="revolute" name="left_wheel_hinge">
      <pose>0 0 -0.03 0 0 0</pose>
      <child>left_wheel</child>
      <parent>chassis</parent>
      <axis>
        <xyz>0 1 0</xyz>
      </axis>
    </joint>

    <joint type="revolute" name="right_wheel_hinge">
      <pose>0 0 0.03 0 0 0</pose>
      <child>right_wheel</child>
      <parent>chassis</parent>
      <axis>
        <xyz>0 1 0</xyz>
      </axis>
    </joint>

  </model>
 </sdf>
Attach Gripper to Robot_第1张图片

Assembling a Composite Robot

1.用一个简单的抓手安装在移动机器人上,生成一个新的模型目录。

mkdir ~/.gazebo/models/simple_mobile_manipulator

并且编辑配置文件

gedit ~/.gazebo/models/simple_mobile_manipulator/model.config

将下文复制进去

<?xml version="1.0"?>
<model>
  <name>Simple Mobile Manipulator</name>
  <version>1.0</version>
  <sdf version='1.4'>manipulator.sdf</sdf>

  <author>
    <name>My Name</name>
    <email>[email protected]</email>
  </author>

  <description>
    My simple mobile manipulator
  </description>
</model>

2.生成模型的SDF文件

gedit ~/.gazebo/models/simple_mobile_manipulator/manipulator.sdf

将下文复制进去

<?xml version="1.0" ?>
<sdf version="1.3">
  <model name="simple_mobile_manipulator">

    <include>
      <uri>model://my_gripper</uri>
      <pose>1.3 0 0.1 0 0 0</pose>
    </include>

    <include>
      <uri>model://my_robot</uri>
      <pose>0 0 0 0 0 0</pose>
    </include>

    <joint name="arm_gripper_joint" type="revolute">
      <parent>mobile_base::chassis</parent>
      <child>simple_gripper::riser</child>
      <axis>
        <limit>
          <lower>0</lower>
          <upper>0</upper>
        </limit>
        <xyz>0 0 1</xyz>
      </axis>
    </joint>

    <!-- attach sensor to the gripper -->
    <include>
      <uri>model://hokuyo</uri>
      <pose>1.3 0 0.3 0 0 0</pose>
    </include>

    <joint name="hokuyo_joint" type="revolute">
      <child>hokuyo::link</child>
      <parent>simple_gripper::palm</parent>
      <axis>
        <xyz>0 0 1</xyz>
        <limit>
          <upper>0</upper>
          <lower>0</lower>
        </limit>
      </axis>
    </joint>

  </model>
</sdf>

3.确保model.config和manipulator.sdf文件被保存,启动gazebo,在 insert tab中添加模型 Simple Mobile Manipulator

Attach Gripper to Robot_第2张图片



你可能感兴趣的:(Attach Gripper to Robot)