ros1-gazebo创建世界和机器人模型(单线雷达、多线雷达、相机)

说在前面

刚写这篇文章的时候在想 不会有人还在手撸urdf/xacro吧
但是在我整的过程中,发现这个gazebo真的太蠢了,遂放弃

gazebo图形界面版

注意:最后失败了,出现了奇怪的bug,开始仿真的时候整辆车只剩下底板

创建房间环境

gazebo界面->edit->building editor,里面可以画墙壁、门等,已经够用了

创建模型(如小车)

gazebo界面->edit->model editor
画几何体后右键->link inspector 修改参数,包含link、visual、collision三个菜单,里面都需要做相应的修改,尤其是pose、geometry这些参数,值得注意的是link菜单下的pose是这个link相对于世界坐标系的坐标,而inertial、visual、collision的pose则是相对于link自身坐标系的坐标

我的建议是尽量画在中心对称的地方,包含多个元件的时候可以分开画多个model,然后在一个model里同时导入,然后对齐、加joint等操作。

另外

图形化操作会有各种bug,觉得不对劲就重启一下gazebo

手写xacro、urdf版

本人的经历说明,对于我来说环境的文件是可以可视化界面绘制的,模型还是手写xacro、urdf。

一般xacro是得用到的,因为可以用宏、include、数值计算等。对一个四轮机器人的物理模型表示,我是这样写的:

.xacro文件

<?xml version='1.0'?>
 
<robot name="robot" 
  xmlns:xacro="http://www.ros.org/wiki/xacro">
 
  <xacro:include filename="robot.gazebo" />
  <xacro:property name="PI" value="3.1415926" />

  <link name="footprint"></link>

 
  <link name='base'>
    <pose>0 0 0.1 0 0 0</pose>
 
    <inertial>
      <mass value="1.50"/>
      <origin xyz="0.0 0 0" rpy=" 0 0 0"/>
      <inertia ixx="0.00282" ixy="0" ixz="0" iyy="0.00417" iyz="0" izz="0.00615" />
    </inertial>
 
    <collision name='collision'>
      <origin xyz="0 0 0" rpy=" 0 0 0"/>
      <geometry>
        <box size="0.3 0.24 0.1"/>
      </geometry>
    </collision>
 
    <visual name='base_visual'>
      <origin xyz="0 0 0" rpy=" 0 0 0"/>
      <geometry>
        <box size="0.3 0.24 0.1"/>
      </geometry>
    </visual>
 
  </link>

  <xacro:macro name="wheel_and_joint" params="name x y">

    <link name="${name}_wheel">
      <inertial>
        <mass value="0.50"/>
        <origin xyz="0.0 0 0" rpy=" 0 ${PI/2} ${PI/2}"/>
        <inertia ixx="0.0001" ixy="0" ixz="0" iyy="0.0001" iyz="0" izz="0.0001" />
      </inertial>
  
      <visual>
        <origin xyz="0.0 0 0" rpy=" 0 ${PI/2} ${PI/2}"/>
        <geometry>
          <cylinder length="0.05" radius="0.06"/>
        </geometry>
      </visual>
  
      <collision>
        <origin xyz="0.0 0 0" rpy=" 0 ${PI/2} ${PI/2}"/>
        <geometry>
          <cylinder length="0.05" radius="0.06"/>
        </geometry>
      </collision>
    </link>

    <joint type="continuous" name="${name}_wheel_joint">
      <origin xyz="${x} ${y} 0" rpy="0 0 0"/>
      <child link="${name}_wheel"/>
      <parent link="base"/>
      <axis xyz="0 1 0" rpy="0 0 0"/>
      <limit effort="10000" velocity="1000"/>
      <dynamics damping="1.0" friction="1.0"/>
    </joint>

    <gazebo reference="${name}_wheel">
      <material>Gazebo/Gray</material>
      <mu1>0.1</mu1>
      <mu2>0.1</mu2>
      <kp>500000.0</kp>
      <kd>10.0</kd>
      <minDepth>0.001</minDepth>
      <maxVel>0.1</maxVel>
      <fdir1>1 0 0</fdir1>
    </gazebo>

  </xacro:macro>

  <xacro:macro name="ball_wheel_and_joint" params="name x y z">

    <link name="${name}_ball_wheel">
      <inertial>
        <mass value="0.1"/>
        <origin xyz="0.0 0 0" rpy=" 0 0 0"/>
        <inertia ixx="0.0005" ixy="0" ixz="0" iyy="0.0005" iyz="0" izz="0.0005" />
      </inertial>
  
      <visual>
        <origin xyz="0.0 0 0" rpy=" 0 0 0"/>
        <geometry>
          <sphere radius="0.005"/>
        </geometry>
      </visual>
  
      <collision>
        <origin xyz="0.0 0 0" rpy=" 0 0 0"/>
        <geometry>
          <sphere radius="0.005"/>
        </geometry>
      </collision>
    </link>

    <joint type="fixed" name="${name}_ball_wheel_joint">
      <origin xyz="${x} ${y} ${z}" rpy="0 0 0"/>
      <child link="${name}_ball_wheel"/>
      <parent link="base"/>
      <axis xyz="0 0 1" rpy="0 0 0"/>
    </joint>

    <gazebo reference="${name}_ball_wheel">
      <material>Gazebo/Gray</material>
      <mu1>0.1</mu1>
      <mu2>0.1</mu2>
      <kp>1000000.0</kp>
      <kd>100.0</kd>
      <minDepth>0.001</minDepth>
      <maxVel>1.0</maxVel>
    </gazebo>
   
  </xacro:macro>

  <xacro:wheel_and_joint name="front_left" x="0.05" y="0.15"/>
  <!-- <xacro:wheel_and_joint name="back_left" x="-0.11" y="0.15"/> -->
  <xacro:wheel_and_joint name="front_right" x="0.05" y="-0.15"/>
  <!-- <xacro:wheel_and_joint name="back_right" x="-0.11" y="-0.15"/> -->
  <xacro:ball_wheel_and_joint name="back1" x="-0.11" y="0.1" z="-0.055"/>
  <xacro:ball_wheel_and_joint name="back2" x="-0.11" y="-0.1" z="-0.055"/>
  <link name="camera">
    <inertial>
      <mass value="0.1"/>
      <origin xyz="0.02 0.05 0.05" rpy=" 0 0 0"/>
      <inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
    </inertial>
 
    <visual name="camera_visual">
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <box size="0.02 0.05 0.05"/>
      </geometry>
    </visual>
 
    <collision name="camera_colision">
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <box size="0.02 0.05 0.05"/>
      </geometry>
    </collision>
  </link>
 
  <link name="vodyne">
    <inertial>
      <mass value="1e-5"/>
      <origin xyz="0 0 0" rpy=" 0 0 0"/>
      <inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
    </inertial>
 
    <visual name="vodyne_visual">
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <cylinder length="0.05" radius="0.06"/>
      </geometry>
    </visual>
 
    <collision name="vodyne_colision">
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
          <cylinder length="0.05" radius="0.03"/>
      </geometry>
    </collision>
  </link>
 
  
  <joint name="footprint_joint" type="fixed">
    <origin xyz="0 0 0" rpy="0 0 0" />
    <parent link="footprint"/>
    <child link="base" />
  </joint>

  <joint type="fixed" name="camera_joint">
    <origin xyz="0.175 0 0" rpy="0 0 0"/>
    <child link="camera"/>
    <parent link="base"/>
    <axis xyz="0 0 1" rpy="0 0 0"/>
  </joint>
 
  <joint type="fixed" name="vodyne_joint">
    <origin xyz="0.08 0 0.075" rpy="0 0 0"/>
    <child link="vodyne"/>
    <parent link="base"/>
    <axis xyz="0 0 1" rpy="0 0 0"/>
  </joint>
 
  <gazebo reference="base">
    <material>Gazebo/White</material>
  </gazebo>
 
  <gazebo reference="camera">
    <material>Gazebo/Black</material>
  </gazebo>
 
  <gazebo reference="vodyne">
    <material>Gazebo/Black</material>
  </gazebo>

 
</robot>


.gazebo文件

其中robot.gazebo如下,包含了一些控制插件


<?xml version="1.0"?>
<robot>
 
  <!--skid_steer_drive_controller-->
  <gazebo>
    <plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
      <alwaysOn>false</alwaysOn>
      <legacyMode>false</legacyMode>
      <publishTf>true</publishTf>
      <publishWheelJointState>true</publishWheelJointState>
      <updateRate>60</updateRate>
      <leftJoint>front_left_wheel_joint</leftJoint>
      <rightJoint>front_right_wheel_joint</rightJoint>

      <wheelSeparation>0.30 </wheelSeparation>
      <wheelDiameter>0.12</wheelDiameter>
      <robotBaseFrame>footprint</robotBaseFrame>
      <torque>20</torque>
      <commandTopic>cmd_vel</commandTopic>
      <odometryTopic>odom</odometryTopic>
      <odometryFrame>odom</odometryFrame>
      <odometrySource>world</odometrySource>
      
      <wheelAcceleration>1</wheelAcceleration>
      <wheelTorque>10</wheelTorque>
      <rosDebugLevel>na</rosDebugLevel>

    </plugin>
  </gazebo>

  <!-- camera -->
  <gazebo reference="camera">
    <sensor type="camera" name="camera_sensor">
      <update_rate>30.0</update_rate>
      <always_on>1</always_on>
 
      <camera name="camera">
        <horizontal_fov>1.3962634</horizontal_fov>
        <image>
          <width>800</width>
          <height>800</height>
          <format>R8G8B8</format>
        </image>
        <clip>
          <near>0.02</near>
          <far>300</far>
        </clip>
        <distortion>
          <k1>0.0</k1>
          <k2>0.0</k2>
          <k3>0.0</k3>
          <p1>0.0</p1>
          <p2>0.0</p2>
          <center>0.5 0.5</center>
        </distortion>
      </camera>
      <plugin name="camera_controller" filename="libgazebo_ros_camera.so">
        <ros>
          <namespace>/robot</namespace>
          <argument>camera/image_raw:=/robot/camera/image</argument>
          <argument>camera/camera_info:=/robot/camera/image/camera_info</argument>
        </ros>
        <camera_name>camera</camera_name>
        <frame_name>camera</frame_name>
        <hack_baseline>0.07</hack_baseline>
      </plugin>
    </sensor>
  </gazebo>
  <gazebo reference="vodyne">
    <sensor type="ray" name="vodyne16">
      <pose>0 0 0 0 0 0</pose>
      <visualize>true</visualize>
      <update_rate>10</update_rate>
      <ray>
        <scan>
          <horizontal>
            <samples>1200</samples> <!-- Change this to 500 if gazebo keeps timing out -->
            <resolution>1</resolution>
            <min_angle>-1.0471975</min_angle>
            <max_angle>1.0471975</max_angle>
          </horizontal>
          <vertical>
            <samples>64</samples>
            <resolution>1</resolution>
            <min_angle>-0.26179938</min_angle>
            <max_angle>0.26179938</max_angle>
          </vertical>
        </scan>
        <range>
          <min>0.055</min>
          <max>100.0</max>
          <resolution>0.1</resolution>
        </range>
        <noise>
          <type>gaussian</type>
          <mean>0.00</mean>
          <stddev>0.01</stddev>
        </noise>
      </ray>
      <plugin name="gazebo_ros_laser_controller" filename="libgazebo_ros_velodyne_laser.so">
        <topicName>/scan</topicName>
        <frameName>laser</frameName>
        <min_range>0.9</min_range>
        <max_range>130.0</max_range>
        <gaussianNoise>0.0</gaussianNoise>
      </plugin>
    </sensor>
  </gazebo>
  
</robot>



而gazebo调用机器人模型得通过urdf文件,使用我们还要进一步生成urdf文件(用xacro是为了方便),这个我就放最后面去,不放这边了,感兴趣的可以对照看

生成urdf文件

运行以下命令

rosrun xacro xacro xxx.xacro > xxx.urdf

也可以在之后的launch文件里,把 <arg name="urdf_robot_file" default="$(find robot)/urdf/robot.urdf" /><param name="robot_description" textfile = "$(arg urdf_robot_file)"/> 两行替换成 <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find robot)/urdf/robot.urdf.xacro'" />

launch文件

下面为初始化一个世界和一个机器人模型的模板launch文件,包含了世界生成、模型生成、坐标变换三个要素,以后只要对着这个改就行


<launch>

  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="x" default="-3.0" />
  <arg name="y" default="-9.0" />
  <arg name="z" default="0.0" />
  <arg name="roll" default="0"/>
  <arg name="pitch" default="0"/>
  <arg name="yaw" default="1.5707963"/>

  <!-- <arg name="urdf_robot_file" default="$(find robot)/urdf/robot.urdf" /> -->
  <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find robot)/urdf/robot.urdf.xacro'" /> 
  <arg name="robot_name" default="robot" />
  
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="verbose" value="true"/>
    <arg name="world_name" value="$(find robot)/worlds/maze.world"/>
    <arg name="debug" value="$(arg debug)" />
    <arg name="gui" value="$(arg gui)" />
    <arg name="paused" value="$(arg paused)"/>
    <arg name="use_sim_time" value="$(arg use_sim_time)"/>
    <arg name="headless" value="$(arg headless)"/>
  </include>
 

  <!-- <param name="robot_description" textfile = "$(arg urdf_robot_file)"/>  -->

  <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen"
  args="-urdf -x $(arg x) -y $(arg y) -z $(arg z) -R $(arg roll) -P $(arg pitch) -Y $(arg yaw) -model $(arg robot_name) -param robot_description"/>

  <node name="tf_scan_pub" pkg="tf2_ros" type="static_transform_publisher" args="0.08 0 0.075 0 0 0 /footprint /laser"/> 

</launch>

附录:maze.world

<sdf version='1.7'>
  <world name='default'>
    <light name='sun' type='directional'>
      <cast_shadows>1</cast_shadows>
      <pose>0 0 10 0 -0 0</pose>
      <diffuse>0.8 0.8 0.8 1</diffuse>
      <specular>0.2 0.2 0.2 1</specular>
      <attenuation>
        <range>1000</range>
        <constant>0.9</constant>
        <linear>0.01</linear>
        <quadratic>0.001</quadratic>
      </attenuation>
      <direction>-0.5 0.1 -0.9</direction>
      <spot>
        <inner_angle>0</inner_angle>
        <outer_angle>0</outer_angle>
        <falloff>0</falloff>
      </spot>
    </light>
    <model name='ground_plane'>
      <static>1</static>
      <link name='link'>
        <collision name='collision'>
          <geometry>
            <plane>
              <normal>0 0 1</normal>
              <size>100 100</size>
            </plane>
          </geometry>
          <surface>
            <friction>
              <ode>
                <mu>100</mu>
                <mu2>50</mu2>
              </ode>
              <torsional>
                <ode/>
              </torsional>
            </friction>
            <contact>
              <ode/>
            </contact>
            <bounce/>
          </surface>
          <max_contacts>10</max_contacts>
        </collision>
        <visual name='visual'>
          <cast_shadows>0</cast_shadows>
          <geometry>
            <plane>
              <normal>0 0 1</normal>
              <size>100 100</size>
            </plane>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Grey</name>
            </script>
          </material>
        </visual>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
    </model>
    <gravity>0 0 -9.8</gravity>
    <magnetic_field>6e-06 2.3e-05 -4.2e-05</magnetic_field>
    <atmosphere type='adiabatic'/>
    <physics type='ode'>
      <max_step_size>0.001</max_step_size>
      <real_time_factor>1</real_time_factor>
      <real_time_update_rate>1000</real_time_update_rate>
    </physics>
    <scene>
      <ambient>0.4 0.4 0.4 1</ambient>
      <background>0.7 0.7 0.7 1</background>
      <shadows>1</shadows>
    </scene>
    <wind/>
    <spherical_coordinates>
      <surface_model>EARTH_WGS84</surface_model>
      <latitude_deg>0</latitude_deg>
      <longitude_deg>0</longitude_deg>
      <elevation>0</elevation>
      <heading_deg>0</heading_deg>
    </spherical_coordinates>
    <state world_name='default'>
      <sim_time>2549 610000000</sim_time>
      <real_time>2562 864281356</real_time>
      <wall_time>1659430410 402862747</wall_time>
      <iterations>2549610</iterations>
      <model name='ground_plane'>
        <pose>0 0 0 0 -0 0</pose>
        <scale>1 1 1</scale>
        <link name='link'>
          <pose>0 0 0 0 -0 0</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
      </model>
      <model name='maze_big'>
        <pose>-4.5354 -0.426624 0 0 -0 0</pose>
        <scale>1 1 1</scale>
        <link name='Wall_47'>
          <pose>-23.4402 1.32338 0 0 -0 1.5708</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_48'>
          <pose>-4.51517 7.24838 0 0 -0 0</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_49'>
          <pose>14.4098 -0.426624 0 0 0 -1.5708</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_50'>
          <pose>6.7348 -8.10162 0 0 -0 3.14159</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_51'>
          <pose>-0.94017 -5.42662 0 0 -0 1.5708</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_53'>
          <pose>-21.3056 -0.232422 0 0 -0 0</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_54'>
          <pose>-19.1306 -1.78242 0 0 0 -1.5708</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_55'>
          <pose>-17.0806 -3.33242 0 0 -0 0</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_56'>
          <pose>-15.0306 0.092578 0 0 -0 1.5708</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_57'>
          <pose>-17.5806 3.51758 0 0 -0 3.14159</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_62'>
          <pose>-14.2247 -8.0808 0 0 -0 0</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_63'>
          <pose>-5.04972 -4.0308 0 0 -0 1.5708</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_64'>
          <pose>2.87528 0.019196 0 0 -0 0</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_65'>
          <pose>10.8003 -2.4058 0 0 0 -1.5708</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_68'>
          <pose>3.01778 -2.2456 0 0 0 -1.5708</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_70'>
          <pose>7.1847 -5.36534 0 0 -0 1.5708</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_72'>
          <pose>-1.02778 1.85077 0 0 -0 1.5708</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_73'>
          <pose>5.27222 3.65077 0 0 -0 0</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_76'>
          <pose>-4.57778 3.65077 0 0 -0 3.14159</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_78'>
          <pose>-10.1249 -3.22677 0 0 -0 0</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_79'>
          <pose>-8.82487 -4.27677 0 0 0 -1.5708</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_81'>
          <pose>-6.84972 0.019196 0 0 -0 3.14159</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
        <link name='Wall_85'>
          <pose>-11.4249 1.94823 0 0 -0 1.5708</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
      </model>
      <light name='sun'>
        <pose>0 0 10 0 -0 0</pose>
      </light>
    </state>
    <model name='maze_big'>
      <pose>-4.5354 -0.426624 0 0 -0 0</pose>
      <link name='Wall_47'>
        <collision name='Wall_47_Collision'>
          <geometry>
            <box>
              <size>12 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_47_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>12 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>-18.9048 1.75 0 0 -0 1.5708</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_48'>
        <collision name='Wall_48_Collision'>
          <geometry>
            <box>
              <size>38 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_48_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>38 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>0.020227 7.675 0 0 -0 0</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_49'>
        <collision name='Wall_49_Collision'>
          <geometry>
            <box>
              <size>15.5 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_49_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>15.5 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>18.9452 -0 0 0 -0 -1.5708</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_50'>
        <collision name='Wall_50_Collision'>
          <geometry>
            <box>
              <size>15.5 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_50_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>15.5 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>11.2702 -7.675 0 0 -0 3.14159</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_51'>
        <collision name='Wall_51_Collision'>
          <geometry>
            <box>
              <size>5.5 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_51_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>5.5 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>3.59523 -5 0 0 -0 1.5708</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_53'>
        <collision name='Wall_53_Collision'>
          <geometry>
            <box>
              <size>4.5 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_53_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>4.5 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>-16.7702 0.194202 0 0 -0 0</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_54'>
        <collision name='Wall_54_Collision'>
          <geometry>
            <box>
              <size>3.25 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_54_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>3.25 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>-14.5952 -1.3558 0 0 -0 -1.5708</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_55'>
        <collision name='Wall_55_Collision'>
          <geometry>
            <box>
              <size>4.25 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_55_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>4.25 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>-12.5452 -2.9058 0 0 -0 0</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_56'>
        <collision name='Wall_56_Collision'>
          <geometry>
            <box>
              <size>7 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_56_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>7 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>-10.4952 0.519202 0 0 -0 1.5708</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_57'>
        <collision name='Wall_57_Collision'>
          <geometry>
            <box>
              <size>5.25 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_57_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>5.25 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>-13.0452 3.9442 0 0 -0 3.14159</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_62'>
        <collision name='Wall_62_Collision'>
          <geometry>
            <box>
              <size>18.5 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_62_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>18.5 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>-9.68932 -7.65418 0 0 -0 0</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_63'>
        <collision name='Wall_63_Collision'>
          <geometry>
            <box>
              <size>8.25 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_63_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>8.25 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>-0.514317 -3.60418 0 0 -0 1.5708</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_64'>
        <collision name='Wall_64_Collision'>
          <geometry>
            <box>
              <size>16 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_64_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>16 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>7.41068 0.44582 0 0 -0 0</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_65'>
        <collision name='Wall_65_Collision'>
          <geometry>
            <box>
              <size>5 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_65_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>5 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>15.3357 -1.97918 0 0 -0 -1.5708</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_68'>
        <collision name='Wall_68_Collision'>
          <geometry>
            <box>
              <size>4.5 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_68_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>4.5 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>7.55318 -1.81898 0 0 -0 -1.5708</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_70'>
        <collision name='Wall_70_Collision'>
          <geometry>
            <box>
              <size>5.5 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_70_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>5.5 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>11.7201 -4.93872 0 0 -0 1.5708</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_72'>
        <collision name='Wall_72_Collision'>
          <geometry>
            <box>
              <size>3.75 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_72_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>3.75 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>3.50762 2.27739 0 0 -0 1.5708</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_73'>
        <collision name='Wall_73_Collision'>
          <geometry>
            <box>
              <size>12.75 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_73_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>12.75 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>9.80762 4.07739 0 0 -0 0</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_76'>
        <collision name='Wall_76_Collision'>
          <geometry>
            <box>
              <size>7.25 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_76_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>7.25 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>-0.042383 4.07739 0 0 -0 3.14159</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_78'>
        <collision name='Wall_78_Collision'>
          <geometry>
            <box>
              <size>2.75 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_78_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>2.75 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>-5.58947 -2.80015 0 0 -0 0</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_79'>
        <collision name='Wall_79_Collision'>
          <geometry>
            <box>
              <size>2.25 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_79_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>2.25 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>-4.28947 -3.85015 0 0 -0 -1.5708</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_81'>
        <collision name='Wall_81_Collision'>
          <geometry>
            <box>
              <size>3.75 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_81_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>3.75 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>-2.31432 0.44582 0 0 -0 3.14159</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <link name='Wall_85'>
        <collision name='Wall_85_Collision'>
          <geometry>
            <box>
              <size>10.5 0.15 2.5</size>
            </box>
          </geometry>
          <pose>0 0 1.25 0 -0 0</pose>
          <max_contacts>10</max_contacts>
          <surface>
            <contact>
              <ode/>
            </contact>
            <bounce/>
            <friction>
              <torsional>
                <ode/>
              </torsional>
              <ode/>
            </friction>
          </surface>
        </collision>
        <visual name='Wall_85_Visual'>
          <pose>0 0 1.25 0 -0 0</pose>
          <geometry>
            <box>
              <size>10.5 0.15 2.5</size>
            </box>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Wood</name>
            </script>
            <ambient>1 1 1 1</ambient>
          </material>
          <meta>
            <layer>0</layer>
          </meta>
        </visual>
        <pose>-6.88947 2.37485 0 0 -0 1.5708</pose>
        <self_collide>0</self_collide>
        <enable_wind>0</enable_wind>
        <kinematic>0</kinematic>
      </link>
      <static>1</static>
    </model>
    <gui fullscreen='0'>
      <camera name='user_camera'>
        <pose>-61.3252 -25.5797 25.1052 0 0.265797 0.513018</pose>
        <view_controller>orbit</view_controller>
        <projection_type>perspective</projection_type>
      </camera>
    </gui>
  </world>
</sdf>

附录:robot.urdf


<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- |    This document was autogenerated by xacro from robot.urdf.xacro               | -->
<!-- |    EDITING THIS FILE BY HAND IS NOT RECOMMENDED                                 | -->
<!-- =================================================================================== -->
<robot name="robot">
  <!--skid_steer_drive_controller-->
  <gazebo>
    <plugin filename="libgazebo_ros_diff_drive.so" name="differential_drive_controller">
      <alwaysOn>false</alwaysOn>
      <legacyMode>false</legacyMode>
      <publishTf>true</publishTf>
      <publishWheelJointState>true</publishWheelJointState>
      <updateRate>60</updateRate>
      <leftJoint>front_left_wheel_joint</leftJoint>
      <rightJoint>front_right_wheel_joint</rightJoint>
      <wheelSeparation>0.30 </wheelSeparation>
      <wheelDiameter>0.12</wheelDiameter>
      <robotBaseFrame>footprint</robotBaseFrame>
      <torque>20</torque>
      <commandTopic>cmd_vel</commandTopic>
      <odometryTopic>odom</odometryTopic>
      <odometryFrame>odom</odometryFrame>
      <odometrySource>world</odometrySource>
      <wheelAcceleration>1</wheelAcceleration>
      <wheelTorque>10</wheelTorque>
      <rosDebugLevel>na</rosDebugLevel>
    </plugin>
  </gazebo>
  <!-- camera -->
  <gazebo reference="camera">
    <sensor name="camera_sensor" type="camera">
      <update_rate>30.0</update_rate>
      <always_on>1</always_on>
      <camera name="camera">
        <horizontal_fov>1.3962634</horizontal_fov>
        <image>
          <width>800</width>
          <height>800</height>
          <format>R8G8B8</format>
        </image>
        <clip>
          <near>0.02</near>
          <far>300</far>
        </clip>
        <distortion>
          <k1>0.0</k1>
          <k2>0.0</k2>
          <k3>0.0</k3>
          <p1>0.0</p1>
          <p2>0.0</p2>
          <center>0.5 0.5</center>
        </distortion>
      </camera>
      <plugin filename="libgazebo_ros_camera.so" name="camera_controller">
        <ros>
          <namespace>/robot</namespace>
          <argument>camera/image_raw:=/robot/camera/image</argument>
          <argument>camera/camera_info:=/robot/camera/image/camera_info</argument>
        </ros>
        <camera_name>camera</camera_name>
        <frame_name>camera</frame_name>
        <hack_baseline>0.07</hack_baseline>
      </plugin>
    </sensor>
  </gazebo>
  <gazebo reference="vodyne">
    <sensor name="vodyne16" type="ray">
      <pose>0 0 0 0 0 0</pose>
      <visualize>true</visualize>
      <update_rate>10</update_rate>
      <ray>
        <scan>
          <horizontal>
            <samples>1200</samples>
            <!-- Change this to 500 if gazebo keeps timing out -->
            <resolution>1</resolution>
            <min_angle>-1.0471975</min_angle>
            <max_angle>1.0471975</max_angle>
          </horizontal>
          <vertical>
            <samples>64</samples>
            <resolution>1</resolution>
            <min_angle>-0.26179938</min_angle>
            <max_angle>0.26179938</max_angle>
          </vertical>
        </scan>
        <range>
          <min>0.055</min>
          <max>100.0</max>
          <resolution>0.1</resolution>
        </range>
        <noise>
          <type>gaussian</type>
          <mean>0.00</mean>
          <stddev>0.01</stddev>
        </noise>
      </ray>
      <plugin filename="libgazebo_ros_velodyne_laser.so" name="gazebo_ros_laser_controller">
        <topicName>/scan</topicName>
        <frameName>laser</frameName>
        <min_range>0.9</min_range>
        <max_range>130.0</max_range>
        <gaussianNoise>0.0</gaussianNoise>
      </plugin>
    </sensor>
  </gazebo>
  <link name="footprint"/>
  <link name="base">
    <pose>0 0 0.1 0 0 0</pose>
    <inertial>
      <mass value="1.50"/>
      <origin rpy=" 0 0 0" xyz="0.0 0 0"/>
      <inertia ixx="0.00282" ixy="0" ixz="0" iyy="0.00417" iyz="0" izz="0.00615"/>
    </inertial>
    <collision name="collision">
      <origin rpy=" 0 0 0" xyz="0 0 0"/>
      <geometry>
        <box size="0.3 0.24 0.1"/>
      </geometry>
    </collision>
    <visual name="base_visual">
      <origin rpy=" 0 0 0" xyz="0 0 0"/>
      <geometry>
        <box size="0.3 0.24 0.1"/>
      </geometry>
    </visual>
  </link>
  <link name="front_left_wheel">
    <inertial>
      <mass value="0.50"/>
      <origin rpy=" 0 1.5707963 1.5707963" xyz="0.0 0 0"/>
      <inertia ixx="0.0001" ixy="0" ixz="0" iyy="0.0001" iyz="0" izz="0.0001"/>
    </inertial>
    <visual>
      <origin rpy=" 0 1.5707963 1.5707963" xyz="0.0 0 0"/>
      <geometry>
        <cylinder length="0.05" radius="0.06"/>
      </geometry>
    </visual>
    <collision>
      <origin rpy=" 0 1.5707963 1.5707963" xyz="0.0 0 0"/>
      <geometry>
        <cylinder length="0.05" radius="0.06"/>
      </geometry>
    </collision>
  </link>
  <joint name="front_left_wheel_joint" type="continuous">
    <origin rpy="0 0 0" xyz="0.05 0.15 0"/>
    <child link="front_left_wheel"/>
    <parent link="base"/>
    <axis rpy="0 0 0" xyz="0 1 0"/>
    <limit effort="10000" velocity="1000"/>
    <dynamics damping="1.0" friction="1.0"/>
  </joint>
  <gazebo reference="front_left_wheel">
    <material>Gazebo/Gray</material>
    <mu1>0.1</mu1>
    <mu2>0.1</mu2>
    <kp>500000.0</kp>
    <kd>10.0</kd>
    <minDepth>0.001</minDepth>
    <maxVel>0.1</maxVel>
    <fdir1>1 0 0</fdir1>
  </gazebo>
  <link name="front_right_wheel">
    <inertial>
      <mass value="0.50"/>
      <origin rpy=" 0 1.5707963 1.5707963" xyz="0.0 0 0"/>
      <inertia ixx="0.0001" ixy="0" ixz="0" iyy="0.0001" iyz="0" izz="0.0001"/>
    </inertial>
    <visual>
      <origin rpy=" 0 1.5707963 1.5707963" xyz="0.0 0 0"/>
      <geometry>
        <cylinder length="0.05" radius="0.06"/>
      </geometry>
    </visual>
    <collision>
      <origin rpy=" 0 1.5707963 1.5707963" xyz="0.0 0 0"/>
      <geometry>
        <cylinder length="0.05" radius="0.06"/>
      </geometry>
    </collision>
  </link>
  <joint name="front_right_wheel_joint" type="continuous">
    <origin rpy="0 0 0" xyz="0.05 -0.15 0"/>
    <child link="front_right_wheel"/>
    <parent link="base"/>
    <axis rpy="0 0 0" xyz="0 1 0"/>
    <limit effort="10000" velocity="1000"/>
    <dynamics damping="1.0" friction="1.0"/>
  </joint>
  <gazebo reference="front_right_wheel">
    <material>Gazebo/Gray</material>
    <mu1>0.1</mu1>
    <mu2>0.1</mu2>
    <kp>500000.0</kp>
    <kd>10.0</kd>
    <minDepth>0.001</minDepth>
    <maxVel>0.1</maxVel>
    <fdir1>1 0 0</fdir1>
  </gazebo>
  <link name="back1_ball_wheel">
    <inertial>
      <mass value="0.1"/>
      <origin rpy=" 0 0 0" xyz="0.0 0 0"/>
      <inertia ixx="0.0005" ixy="0" ixz="0" iyy="0.0005" iyz="0" izz="0.0005"/>
    </inertial>
    <visual>
      <origin rpy=" 0 0 0" xyz="0.0 0 0"/>
      <geometry>
        <sphere radius="0.005"/>
      </geometry>
    </visual>
    <collision>
      <origin rpy=" 0 0 0" xyz="0.0 0 0"/>
      <geometry>
        <sphere radius="0.005"/>
      </geometry>
    </collision>
  </link>
  <joint name="back1_ball_wheel_joint" type="fixed">
    <origin rpy="0 0 0" xyz="-0.11 0.1 -0.055"/>
    <child link="back1_ball_wheel"/>
    <parent link="base"/>
    <axis rpy="0 0 0" xyz="0 0 1"/>
  </joint>
  <gazebo reference="back1_ball_wheel">
    <material>Gazebo/Gray</material>
    <mu1>0.1</mu1>
    <mu2>0.1</mu2>
    <kp>1000000.0</kp>
    <kd>100.0</kd>
    <minDepth>0.001</minDepth>
    <maxVel>1.0</maxVel>
  </gazebo>
  <link name="back2_ball_wheel">
    <inertial>
      <mass value="0.1"/>
      <origin rpy=" 0 0 0" xyz="0.0 0 0"/>
      <inertia ixx="0.0005" ixy="0" ixz="0" iyy="0.0005" iyz="0" izz="0.0005"/>
    </inertial>
    <visual>
      <origin rpy=" 0 0 0" xyz="0.0 0 0"/>
      <geometry>
        <sphere radius="0.005"/>
      </geometry>
    </visual>
    <collision>
      <origin rpy=" 0 0 0" xyz="0.0 0 0"/>
      <geometry>
        <sphere radius="0.005"/>
      </geometry>
    </collision>
  </link>
  <joint name="back2_ball_wheel_joint" type="fixed">
    <origin rpy="0 0 0" xyz="-0.11 -0.1 -0.055"/>
    <child link="back2_ball_wheel"/>
    <parent link="base"/>
    <axis rpy="0 0 0" xyz="0 0 1"/>
  </joint>
  <gazebo reference="back2_ball_wheel">
    <material>Gazebo/Gray</material>
    <mu1>0.1</mu1>
    <mu2>0.1</mu2>
    <kp>1000000.0</kp>
    <kd>100.0</kd>
    <minDepth>0.001</minDepth>
    <maxVel>1.0</maxVel>
  </gazebo>
  <link name="camera">
    <inertial>
      <mass value="0.1"/>
      <origin rpy=" 0 0 0" xyz="0.02 0.05 0.05"/>
      <inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6"/>
    </inertial>
    <visual name="camera_visual">
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <box size="0.02 0.05 0.05"/>
      </geometry>
    </visual>
    <collision name="camera_colision">
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <box size="0.02 0.05 0.05"/>
      </geometry>
    </collision>
  </link>
  <link name="vodyne">
    <inertial>
      <mass value="1e-5"/>
      <origin rpy=" 0 0 0" xyz="0 0 0"/>
      <inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6"/>
    </inertial>
    <visual name="vodyne_visual">
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <cylinder length="0.05" radius="0.06"/>
      </geometry>
    </visual>
    <collision name="vodyne_colision">
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <cylinder length="0.05" radius="0.03"/>
      </geometry>
    </collision>
  </link>
  <joint name="footprint_joint" type="fixed">
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <parent link="footprint"/>
    <child link="base"/>
  </joint>
  <joint name="camera_joint" type="fixed">
    <origin rpy="0 0 0" xyz="0.175 0 0"/>
    <child link="camera"/>
    <parent link="base"/>
    <axis rpy="0 0 0" xyz="0 0 1"/>
  </joint>
  <joint name="vodyne_joint" type="fixed">
    <origin rpy="0 0 0" xyz="0.08 0 0.075"/>
    <child link="vodyne"/>
    <parent link="base"/>
    <axis rpy="0 0 0" xyz="0 0 1"/>
  </joint>
  <gazebo reference="base">
    <material>Gazebo/White</material>
  </gazebo>
  <gazebo reference="camera">
    <material>Gazebo/Black</material>
  </gazebo>
  <gazebo reference="vodyne">
    <material>Gazebo/Black</material>
  </gazebo>
</robot>

附录:ros2的控制器参考

<gazebo>
    <plugin filename="libgazebo_ros_diff_drive.so" name="skid_steer_drive_controller">
      <ros>
        <namespace>/mobot</namespace>
        <argument>/cmd_vel:=mr_cme_vel</argument>
        <argument>/odom:=odom</argument>
      </ros>
      <update_rate>100.0</update_rate>
      <num_wheel_pairs>2</num_wheel_pairs>
      <odometry_frame>odom</odometry_frame>
      <left_joint>front_left_wheel_joint</left_joint>
      <left_joint>back_left_wheel_joint</left_joint>
      <wheel_separation>0.4</wheel_separation>
      <wheel_diameter>0.2</wheel_diameter>
      <right_joint>front_right_wheel_joint</right_joint>
      <right_joint>back_right_wheel_joint</right_joint>
      <wheel_separation>0.4</wheel_separation>
      <wheel_diameter>0.2</wheel_diameter>
      <robot_base_frame>robot_footprint</robot_base_frame>
      <max_wheel_torque>20</max_wheel_torque>
      <publish_odom>true</publish_odom>
      <publish_odom_tf>true</publish_odom_tf>
      <publish_wheel_tf>true</publish_wheel_tf>
      <odometry_source>world</odometry_source>
    </plugin>
  </gazebo>

附录:多线雷达的添加

这里需要把原代码中的 hokuyo_link换为vodyne,安装相关插件sudo apt-get install ros-noetic-velodyne-simulator并且在.gazebo中把雷达插件部分脚本更改如下,其他不变

<gazebo reference="vodyne">
    <sensor type="ray" name="vodyne16">
      <pose>0 0 0 0 0 0</pose>
      <visualize>true</visualize>
      <update_rate>10</update_rate>
      <ray>
        <scan>
          <horizontal>
            <samples>1200</samples> <!-- Change this to 500 if gazebo keeps timing out -->
            <resolution>1</resolution>
            <min_angle>-1.0471975</min_angle>
            <max_angle>1.0471975</max_angle>
          </horizontal>
          <vertical>
            <samples>64</samples>
            <resolution>1</resolution>
            <min_angle>-0.26179938</min_angle>
            <max_angle>0.26179938</max_angle>
          </vertical>
        </scan>
        <range>
          <min>0.055</min>
          <max>100.0</max>
          <resolution>0.1</resolution>
        </range>
        <noise>
          <type>gaussian</type>
          <mean>0.00</mean>
          <stddev>0.01</stddev>
        </noise>
      </ray>
      <plugin name="gazebo_ros_laser_controller" filename="libgazebo_ros_velodyne_laser.so">
        <topicName>/scan</topicName>
        <frameName>laser</frameName>
        <min_range>0.9</min_range>
        <max_range>130.0</max_range>
        <gaussianNoise>0.0</gaussianNoise>
      </plugin>
    </sensor>
  </gazebo>
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
搭建自己的机器人模型需要进行以下步骤: 1. 安装ROS仿真工具包 2. 创建ROS包和机器人模型 3. 编写机器人控制程序 4. 启动仿真环境并加载机器人模型 5. 运行机器人控制程序,观察仿真结果 下面是一个简单的机器人模型搭建示例,使用ROS Kinetic和Gazebo仿真工具包: 1. 安装ROS仿真工具包 在Ubuntu系统中使用以下命令安装ROS Kinetic和Gazebo仿真工具包: ``` sudo apt-get update sudo apt-get install ros-kinetic-desktop-full sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control ``` 2. 创建ROS包和机器人模型 使用以下命令创建一个名为my_robot的ROS包,并在其中创建一个名为urdf的目录用于存放机器人模型文件: ``` mkdir -p ~/catkin_ws/src cd ~/catkin_ws/src catkin_create_pkg my_robot cd my_robot mkdir urdf ``` 在urdf目录中创建一个名为my_robot.urdf的机器人模型文件,内容如下: ```xml <?xml version="1.0"?> <robot name="my_robot" xmlns:xacro="http://www.ros.org/wiki/xacro"> <link name="base_link"> <visual> <geometry> <box size="0.3 0.3 0.1"/> </geometry> </visual> </link> <joint name="base_joint" type="fixed"> <parent link="world"/> <child link="base_link"/> <origin xyz="0 0 0.05"/> </joint> <link name="left_wheel_link"> <visual> <geometry> <cylinder length="0.05" radius="0.1"/> </geometry> </visual> </link> <joint name="left_wheel_joint" type="continuous"> <parent link="base_link"/> <child link="left_wheel_link"/> <origin xyz="0.15 0 -0.05"/> <axis xyz="0 1 0"/> </joint> <link name="right_wheel_link"> <visual> <geometry> <cylinder length="0.05" radius="0.1"/> </geometry> </visual> </link> <joint name="right_wheel_joint" type="continuous"> <parent link="base_link"/> <child link="right_wheel_link"/> <origin xyz="0.15 0 0.05"/> <axis xyz="0 1 0"/> </joint> </robot> ``` 这个机器人模型由一个长方体的底座和两个圆柱形的轮子组成,使用URDF格式描述。其中base_link表示机器人的底座,left_wheel_link和right_wheel_link分别表示左右两个轮子。 3. 编写机器人控制程序 在ROS包的src目录中创建一个名为my_robot_control.cpp的控制程序文件,内容如下: ```cpp #include <ros/ros.h> #include <geometry_msgs/Twist.h> int main(int argc, char** argv) { ros::init(argc, argv, "my_robot_control"); ros::NodeHandle nh; ros::Publisher cmd_vel_pub = nh.advertise<geometry_msgs::Twist>("cmd_vel", 10); ros::Rate loop_rate(10); while (ros::ok()) { geometry_msgs::Twist cmd_vel; cmd_vel.linear.x = 0.1; cmd_vel.angular.z = 0.5; cmd_vel_pub.publish(cmd_vel); ros::spinOnce(); loop_rate.sleep(); } return 0; } ``` 这个控制程序使用ROS的Twist消息类型发布机器人的线速度和角速度,以控制机器人的运动。在这个示例中,机器人线速度为0.1,角速度为0.5。 4. 启动仿真环境并加载机器人模型 使用以下命令启动Gazebo仿真环境,并加载机器人模型: ``` roslaunch my_robot my_robot.launch ``` 在my_robot包中创建一个名为my_robot.launch的启动文件,内容如下: ```xml <?xml version="1.0"?> <launch> <arg name="model" default="$(find my_robot)/urdf/my_robot.urdf"/> <param name="robot_description" textfile="$(arg model)" /> <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model my_robot -param robot_description -x 0 -y 0 -z 0"/> <node name="my_robot_control" type="my_robot_control" pkg="my_robot"/> <node name="gazebo_gui" pkg="gazebo" type="gazebo"/> </launch> ``` 这个启动文件首先将机器人模型文件加载到ROS参数服务器中,然后使用gazebo_ros包的spawn_model节点将机器人模型加载到Gazebo仿真环境中。同时运行my_robot_control程序节点控制机器人运动。最后启动Gazebo仿真环境的GUI界面。 5. 运行机器人控制程序,观察仿真结果 使用以下命令运行my_robot_control程序节点,控制机器人运动: ``` rosrun my_robot my_robot_control ``` 可以观察到仿真环境中的机器人开始运动,同时在控制程序的终端输出中可以看到机器人的线速度和角速度。 下图为搭建自己的机器人模型的结果截图: ![ROS机器人仿真结果截图](https://i.imgur.com/lv9v5a1.png)

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

萧易风船长

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值