Gazebo仿真

1. Gazebo

Simulation with Gazebo

1.1 Import models from the model library and simulation via .word file

EG:

<?xml version="1.0"?> 
<sdf version="1.4">
  <world name="default">

    <!-- Ground Plane -->
    <include>
      <uri>model://ground_plane</uri>
    </include>

    <include>
      <uri>model://sun</uri>
    </include>

    <model name="box">
      <pose>0 0 0.5 0 0 0</pose>
      <link name="link">
        <collision name="collision">
          <geometry>
            <box>
              <size>1 1 1</size>
            </box>
          </geometry>
        </collision>

        <visual name="visual">
          <geometry>
            <box>
              <size>1 1 1</size>
            </box>
          </geometry>
        </visual>
      </link>

      <plugin name="model_push" filename="libmodel_push.so"/>
    </model>        
  </world>
</sdf>

add models path and start simulation (PATH–ubuntu–ROS–building_robot)

******Creat "build"

cmake ../
make

******Back to main menu

export GAZEBO_MODEL_PATH=/home/juniper/Documents/ROS/building_robot/models:$GAZEBO_MODEL_PAT

export GAZEBO_PLUGIN_PATH=/home/juniper/Documents/ROS/building_robot/build:$GAZEBO_PLUGIN_PATH

sudo cp build/libbuilding_robot.so /usr/lib/x86_64-linux-gnu/gazebo-9/plugins/libbuilding_robot.so

gazebo --verbose building_robot.world

public building simulation

<?xml version="1.0"?> 
<sdf version="1.4">
  <world name="building_robot_world">
 
    <!-- Ground Plane -->
    <include>
      <uri>model://ground_plane</uri>
    </include>
 
    <include>
      <uri>model://sun</uri>
    </include>
 


    <model name='robot'>
      <pose>15.7 0 8.672 0 0 0</pose>
      <include>
        <uri>model://robotcarryer2</uri>
      </include>
 
    </model>


    <model name="public">
      <pose>-20 -100 80 0 0 -1.24</pose>
      <static>true</static>
      <link name="link">
        <visual name="visual">
          <geometry>
            <mesh><uri>model://pub.stl</uri></mesh>
          </geometry>
        </visual>
        <collision name="collision">
          <geometry>
            <mesh><uri>model://pub.stl</uri></mesh>
          </geometry>
        </collision>
      </link>
    </model>

      
  </world>
</sdf>
      <plugin name="push_animate" filename="libanimated_box.so"/>

polyu

<?xml version="1.0"?> 
<sdf version="1.4">
  <world name="building_robot_world">
 
    <!-- Ground Plane -->
    <include>
      <uri>model://ground_plane</uri>
    </include>
 
    <include>
      <uri>model://sun</uri>
    </include>
 


    <model name='robot'>
      <pose>32 -2 23 0 0 0</pose>
      <include>
        <uri>model://robotcarryer3</uri>
      </include>
 
    </model>




    <model name="public">
      <pose>0 0 6 0 0 1.76</pose>
      <static>true</static>
      <link name="link">
        <visual name="visual">
          <geometry>
            <mesh><uri>model://polyuinverse.dae</uri></mesh>
          </geometry>
        </visual>
        <collision name="collision">
          <geometry>
            <mesh><uri>model://polyuinverse.dae</uri></mesh>
          </geometry>
        </collision>
      </link>
    </model>


      
  </world>
</sdf>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值