ROS_Kinetic_29 kamtoa simulation学习与示例分析(一)

致谢源代码网址:https://github.com/Tutorgaming/kamtoa-simulation

kamtoa simulation学习与示例分析(一)

源码学习与分析是学习ROS,包括RVIZ和Gazebo等必须的过程,大量代码的阅读能够提高加快理解熟练使用ROS Kinetic。

首先,先看文件组织:

一般README中有详细的使用说明,包括安装,使用和示例教程。

CMakeLists.txt:

# toplevel CMakeLists.txt for a catkin workspace
# catkin/cmake/toplevel.cmake

cmake_minimum_required(VERSION 2.8.3)

set(CATKIN_TOPLEVEL TRUE)

# search for catkin within the workspace
set(_cmd "catkin_find_pkg" "catkin" "${CMAKE_SOURCE_DIR}")
execute_process(COMMAND ${_cmd}
  RESULT_VARIABLE _res
  OUTPUT_VARIABLE _out
  ERROR_VARIABLE _err
  OUTPUT_STRIP_TRAILING_WHITESPACE
  ERROR_STRIP_TRAILING_WHITESPACE
)
if(NOT _res EQUAL 0 AND NOT _res EQUAL 2)
  # searching fot catkin resulted in an error
  string(REPLACE ";" " " _cmd_str "${_cmd}")
  message(FATAL_ERROR "Search for 'catkin' in workspace failed (${_cmd_str}): ${_err}")
endif()

# include catkin from workspace or via find_package()
if(_res EQUAL 0)
  set(catkin_EXTRAS_DIR "${CMAKE_SOURCE_DIR}/${_out}/cmake")
  # include all.cmake without add_subdirectory to let it operate in same scope
  include(${catkin_EXTRAS_DIR}/all.cmake NO_POLICY_SCOPE)
  add_subdirectory("${_out}")

else()
  # use either CMAKE_PREFIX_PATH explicitly passed to CMake as a command line argument
  # or CMAKE_PREFIX_PATH from the environment
  if(NOT DEFINED CMAKE_PREFIX_PATH)
    if(NOT "$ENV{CMAKE_PREFIX_PATH}" STREQUAL "")
      string(REPLACE ":" ";" CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
    endif()
  endif()

  # list of catkin workspaces
  set(catkin_search_path "")
  foreach(path ${CMAKE_PREFIX_PATH})
    if(EXISTS "${path}/.catkin")
      list(FIND catkin_search_path ${path} _index)
      if(_index EQUAL -1)
        list(APPEND catkin_search_path ${path})
      endif()
    endif()
  endforeach()

  # search for catkin in all workspaces
  set(CATKIN_TOPLEVEL_FIND_PACKAGE TRUE)
  find_package(catkin QUIET
    NO_POLICY_SCOPE
    PATHS ${catkin_search_path}
    NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
  unset(CATKIN_TOPLEVEL_FIND_PACKAGE)

  if(NOT catkin_FOUND)
    message(FATAL_ERROR "find_package(catkin) failed. catkin was neither found in the workspace nor in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was sourced before.")
  endif()
endif()

catkin_workspace()

这里,先看kamtoa_gazebo文件夹下:

CMakeLists.txt中包含需要的功能包,如下截取部分代码片段:

cmake_minimum_required(VERSION 2.8.3)
project(kamtoa_gazebo)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used,also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  gazebo_msgs
  gazebo_plugins
  gazebo_ros
  gazebo_ros_control
  kamtoa_description
)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)

需要的功能包如果不全,可以使用sudo apt-get install ros-kinetic-gazebo-msgs,以类似方式安装(catkin)。当然编译需要对应的功能包,运行也需要,这里缺一不可,请看package.xml:

<?xml version="1.0"?>
<package>
  <name>kamtoa_gazebo</name>
  <version>0.0.0</version>
  <description>The kamtoa_gazebo package</description>

  <!-- One maintainer tag required,multiple allowed,one person per tag --> 
  <!-- Example:  -->
  <!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
  <maintainer email="c3mx@todo.todo">c3mx</maintainer>


  <!-- One license tag required,one license per tag -->
  <!-- Commonly used license strings: -->
  <!--   BSD,MIT,Boost Software License,GPLv2,GPLv3,LGPLv2.1,LGPLv3 -->
  <license>TODO</license>


  <!-- Url tags are optional,but mutiple are allowed,one per tag -->
  <!-- Optional attribute type can be: website,bugtracker,or repository -->
  <!-- Example: -->
  <!-- <url type="website">http://wiki.ros.org/kamtoa_gazebo</url> -->


  <!-- Author tags are optional,mutiple are allowed,one per tag -->
  <!-- Authors do not have to be maintianers,but could be -->
  <!-- Example: -->
  <!-- <author email="jane.doe@example.com">Jane Doe</author> -->


  <!-- The *_depend tags are used to specify dependencies -->
  <!-- Dependencies can be catkin packages or system dependencies -->
  <!-- Examples: -->
  <!-- Use build_depend for packages you need at compile time: -->
  <!--   <build_depend>message_generation</build_depend> -->
  <!-- Use buildtool_depend for build tool packages: -->
  <!--   <buildtool_depend>catkin</buildtool_depend> -->
  <!-- Use run_depend for packages you need at runtime: -->
  <!--   <run_depend>message_runtime</run_depend> -->
  <!-- Use test_depend for packages you need only for testing: -->
  <!--   <test_depend>gtest</test_depend> -->
  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>gazebo_msgs</build_depend>
  <build_depend>gazebo_plugins</build_depend>
  <build_depend>gazebo_ros</build_depend>
  <build_depend>gazebo_ros_control</build_depend>
  <build_depend>kamtoa_description</build_depend>
  <run_depend>gazebo_msgs</run_depend>
  <run_depend>gazebo_plugins</run_depend>
  <run_depend>gazebo_ros</run_depend>
  <run_depend>gazebo_ros_control</run_depend>
  <run_depend>kamtoa_description</run_depend>


  <!-- The export tag contains other,unspecified,tags -->
  <export>
    <!-- Other tools can request additional information be placed here -->

  </export>
</package>

注意这里的<build_depend>和<run_depend>,分别对应编译和运行,
有时编译没有问题,运行却报错,请务必注意。

world文件夹下存放gazebo模型,打开可以看到:

building1.world和whiz_ex.world,具体解析可以参考博客中GazeboSim中内容,具体的模型文件为sdf 1.6对应Gazebo7,以whiz_ex_window为例,分为model.config和model.sdf如下:

model.sdf:

<?xml version='1.0'?>
<sdf version='1.6'>
  <model name='whiz_ex_window'>
    <pose frame=''>0.232213 1.38881 0 0 -0 0</pose>
    <link name='Door_6'>
      <collision name='Door_6_Collision'>
        <geometry>
          <box>
            <size>0.9 0.17 2</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1 0 -0 0</pose>
      </collision>
      <visual name='Door_6_Visual'>
        <pose frame=''>0 0 1 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.9 0.17 2</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
        </material>
      </visual>
      <pose frame=''>0.29567 1.0429 0 0 0 -3.12055</pose>
    </link>
    <link name='Door_7'>
      <collision name='Door_7_Collision'>
        <geometry>
          <box>
            <size>0.949838 0.2 2</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1 0 -0 0</pose>
      </collision>
      <visual name='Door_7_Visual'>
        <pose frame=''>0 0 1 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.949838 0.2 2</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
        </material>
      </visual>
      <pose frame=''>-0.776238 1.0429 0 0 -0 3.14159</pose>
    </link>
    <link name='Door_8'>
      <collision name='Door_8_Collision'>
        <geometry>
          <box>
            <size>0.9 0.17 2</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1 0 -0 0</pose>
      </collision>
      <visual name='Door_8_Visual'>
        <pose frame=''>0 0 1 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.9 0.17 2</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
        </material>
      </visual>
      <pose frame=''>-4.14363 1.09228 0 0 -0 0</pose>
    </link>
    <link name='Door_9'>
      <collision name='Door_9_Collision'>
        <geometry>
          <box>
            <size>0.9 0.17 2</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1 0 -0 0</pose>
      </collision>
      <visual name='Door_9_Visual'>
        <pose frame=''>0 0 1 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.9 0.17 2</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
        </material>
      </visual>
      <pose frame=''>-1.75347 -0.819856 0 0 0 -3.12358</pose>
    </link>
    <link name='Wall_0'>
      <pose frame=''>-1.6817 -3.67821 0 0 -0 0</pose>
      <visual name='Wall_0_Visual_0'>
        <pose frame=''>-1.17971 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>5.89059 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_0_Collision_0'>
        <geometry>
          <box>
            <size>5.89059 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>-1.17971 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_0_Visual_1'>
        <pose frame=''>3.9453 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.35941 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_0_Collision_1'>
        <geometry>
          <box>
            <size>0.35941 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>3.9453 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_0_Visual_2'>
        <pose frame=''>2.76559 0 0 0 -0 0</pose>
        <geometry>
          <box>
            <size>2 0.15 0</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_0_Collision_2'>
        <geometry>
          <box>
            <size>2 0.15 0</size>
          </box>
        </geometry>
        <pose frame=''>2.76559 0 0 0 -0 0</pose>
      </collision>
      <visual name='Wall_0_Visual_3'>
        <pose frame=''>2.76559 0 2.45 0 -0 0</pose>
        <geometry>
          <box>
            <size>2 0.15 0.1</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_0_Collision_3'>
        <geometry>
          <box>
            <size>2 0.15 0.1</size>
          </box>
        </geometry>
        <pose frame=''>2.76559 0 2.45 0 -0 0</pose>
      </collision>
    </link>
    <link name='Wall_1'>
      <collision name='Wall_1_Collision'>
        <geometry>
          <box>
            <size>3.75 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_1_Visual'>
        <pose frame=''>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/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>2.3683 -1.87821 0 0 -0 1.5708</pose>
    </link>
    <link name='Wall_13'>
      <collision name='Wall_13_Collision'>
        <geometry>
          <box>
            <size>9.25 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_13_Visual'>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>9.25 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>-1.19255 3.74668 0 0 -0 3.14159</pose>
    </link>
    <link name='Wall_15'>
      <pose frame=''>-4.65794 2.07148 0 0 0 -1.5708</pose>
      <visual name='Wall_15_Visual_0'>
        <pose frame=''>-1.67569 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.148611 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_15_Collision_0'>
        <geometry>
          <box>
            <size>0.148611 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>-1.67569 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_15_Visual_1'>
        <pose frame=''>1.07431 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>1.35139 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_15_Collision_1'>
        <geometry>
          <box>
            <size>1.35139 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>1.07431 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_15_Visual_2'>
        <pose frame=''>-0.601389 0 2.4 0 -0 0</pose>
        <geometry>
          <box>
            <size>2 0.15 0.2</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_15_Collision_2'>
        <geometry>
          <box>
            <size>2 0.15 0.2</size>
          </box>
        </geometry>
        <pose frame=''>-0.601389 0 2.4 0 -0 0</pose>
      </collision>
    </link>
    <link name='Wall_16'>
      <collision name='Wall_16_Collision'>
        <geometry>
          <box>
            <size>1.25 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_16_Visual'>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>1.25 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>-5.20794 0.396477 0 0 -0 3.14159</pose>
    </link>
    <link name='Wall_17'>
      <pose frame=''>-5.75794 -1.65352 0 0 0 -1.5708</pose>
      <visual name='Wall_17_Visual_0'>
        <pose frame=''>-1.07794 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>2.09412 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_17_Collision_0'>
        <geometry>
          <box>
            <size>2.09412 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>-1.07794 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_17_Visual_1'>
        <pose frame=''>1.04706 0 0.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>2.15588 0.15 0.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_17_Collision_1'>
        <geometry>
          <box>
            <size>2.15588 0.15 0.5</size>
          </box>
        </geometry>
        <pose frame=''>1.04706 0 0.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_17_Visual_2'>
        <pose frame=''>2.01762 0 1.5 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.214766 0.15 2</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_17_Collision_2'>
        <geometry>
          <box>
            <size>0.214766 0.15 2</size>
          </box>
        </geometry>
        <pose frame=''>2.01762 0 1.5 0 -0 0</pose>
      </collision>
      <visual name='Wall_17_Visual_3'>
        <pose frame=''>0.939679 0 1.9 0 -0 0</pose>
        <geometry>
          <box>
            <size>1.94111 0.15 1.2</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_17_Collision_3'>
        <geometry>
          <box>
            <size>1.94111 0.15 1.2</size>
          </box>
        </geometry>
        <pose frame=''>0.939679 0 1.9 0 -0 0</pose>
      </collision>
    </link>
    <link name='Wall_19'>
      <collision name='Wall_19_Collision'>
        <geometry>
          <box>
            <size>2.5 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_19_Visual'>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>2.5 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>-2.53404 1.06604 0 0 -0 0</pose>
    </link>
    <link name='Wall_20'>
      <collision name='Wall_20_Collision'>
        <geometry>
          <box>
            <size>2 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_20_Visual'>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>2 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>-1.35904 0.141035 0 0 0 -1.5708</pose>
    </link>
    <link name='Wall_21'>
      <collision name='Wall_21_Collision'>
        <geometry>
          <box>
            <size>0.25 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_21_Visual'>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.25 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>-1.40904 -0.783965 0 0 -0 3.14159</pose>
    </link>
    <link name='Wall_23'>
      <collision name='Wall_23_Collision'>
        <geometry>
          <box>
            <size>3.5 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_23_Visual'>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>3.5 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>-3.91607 -0.818528 0 0 -0 3.14159</pose>
    </link>
    <link name='Wall_24'>
      <collision name='Wall_24_Collision'>
        <geometry>
          <box>
            <size>0.25 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_24_Visual'>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.25 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>-5.64107 -0.818528 0 0 -0 3.14159</pose>
    </link>
    <link name='Wall_26'>
      <collision name='Wall_26_Collision'>
        <geometry>
          <box>
            <size>2 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_26_Visual'>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>2 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>-3.31229 0.121197 0 0 0 -1.5708</pose>
    </link>
    <link name='Wall_28'>
      <collision name='Wall_28_Collision'>
        <geometry>
          <box>
            <size>1.75 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_28_Visual'>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>1.75 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>-1.86043 2.95447 0 0 0 -1.5708</pose>
    </link>
    <link name='Wall_30'>
      <collision name='Wall_30_Collision'>
        <geometry>
          <box>
            <size>0.75 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_30_Visual'>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.75 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>-1.56043 2.15447 0 0 -0 0</pose>
    </link>
    <link name='Wall_32'>
      <collision name='Wall_32_Collision'>
        <geometry>
          <box>
            <size>2.75 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_32_Visual'>
        <pose frame=''>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/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>-0.228595 2.39065 0 0 0 -1.5708</pose>
    </link>
    <link name='Wall_35'>
      <collision name='Wall_35_Collision'>
        <geometry>
          <box>
            <size>2.75 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_35_Visual'>
        <pose frame=''>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/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>1.29304 2.34692 0 0 0 -1.5708</pose>
    </link>
    <link name='Wall_37'>
      <collision name='Wall_37_Collision'>
        <geometry>
          <box>
            <size>1.5 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_37_Visual'>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>1.5 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>1.36463 1.03216 0 0 -0 0</pose>
    </link>
    <link name='Wall_4'>
      <pose frame=''>4.05869 -2.66379 0 0 -0 0</pose>
      <visual name='Wall_4_Visual_0'>
        <pose frame=''>-1.38368 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.732645 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_4_Collision_0'>
        <geometry>
          <box>
            <size>0.732645 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>-1.38368 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_4_Visual_1'>
        <pose frame=''>1.61632 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.267355 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_4_Collision_1'>
        <geometry>
          <box>
            <size>0.267355 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>1.61632 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_4_Visual_2'>
        <pose frame=''>0.232645 0 2.45 0 -0 0</pose>
        <geometry>
          <box>
            <size>2.5 0.15 0.1</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_4_Collision_2'>
        <geometry>
          <box>
            <size>2.5 0.15 0.1</size>
          </box>
        </geometry>
        <pose frame=''>0.232645 0 2.45 0 -0 0</pose>
      </collision>
    </link>
    <link name='Wall_41'>
      <collision name='Wall_41_Collision'>
        <geometry>
          <box>
            <size>0.25 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_41_Visual'>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.25 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>-0.228595 1.04065 0 0 0 -1.5708</pose>
    </link>
    <link name='Wall_44'>
      <collision name='Wall_44_Collision'>
        <geometry>
          <box>
            <size>3.75 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_44_Visual'>
        <pose frame=''>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/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>-0.233629 -1.95772 0 0 0 -1.5708</pose>
    </link>
    <link name='Wall_50'>
      <pose frame=''>5.74567 0.386841 0 0 0 -1.57472</pose>
      <visual name='Wall_50_Visual_0'>
        <pose frame=''>-2.83254 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.586231 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_50_Collision_0'>
        <geometry>
          <box>
            <size>0.586231 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>-2.83254 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_50_Visual_1'>
        <pose frame=''>1.30211 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>3.64708 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_50_Collision_1'>
        <geometry>
          <box>
            <size>3.64708 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>1.30211 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_50_Visual_2'>
        <pose frame=''>-1.53042 0 2.4 0 -0 0</pose>
        <geometry>
          <box>
            <size>2.018 0.15 0.2</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_50_Collision_2'>
        <geometry>
          <box>
            <size>2.018 0.15 0.2</size>
          </box>
        </geometry>
        <pose frame=''>-1.53042 0 2.4 0 -0 0</pose>
      </collision>
    </link>
    <link name='Wall_52'>
      <pose frame=''>4.58265 3.43747 0 0 -0 3.14159</pose>
      <visual name='Wall_52_Visual_0'>
        <pose frame=''>-0.530284 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>1.43943 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_52_Collision_0'>
        <geometry>
          <box>
            <size>1.43943 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>-0.530284 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_52_Visual_1'>
        <pose frame=''>1.16972 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.160568 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_52_Collision_1'>
        <geometry>
          <box>
            <size>0.160568 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>1.16972 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_52_Visual_2'>
        <pose frame=''>0.639432 0 2.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.9 0.15 0.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_52_Collision_2'>
        <geometry>
          <box>
            <size>0.9 0.15 0.5</size>
          </box>
        </geometry>
        <pose frame=''>0.639432 0 2.25 0 -0 0</pose>
      </collision>
    </link>
    <link name='Wall_53'>
      <collision name='Wall_53_Collision'>
        <geometry>
          <box>
            <size>0.463251 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_53_Visual'>
        <pose frame=''>0 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.463251 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <pose frame=''>3.38255 3.59207 0 0 -0 1.73174</pose>
    </link>
    <link name='Wall_55'>
      <pose frame=''>1.06733 -0.11797 0 0 -0 0.030549</pose>
      <visual name='Wall_55_Visual_0'>
        <pose frame=''>-1.28558 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.181978 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_55_Collision_0'>
        <geometry>
          <box>
            <size>0.181978 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>-1.28558 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_55_Visual_1'>
        <pose frame=''>0.540989 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>1.67116 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_55_Collision_1'>
        <geometry>
          <box>
            <size>1.67116 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0.540989 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_55_Visual_2'>
        <pose frame=''>-0.744593 0 2.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.9 0.15 0.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_55_Collision_2'>
        <geometry>
          <box>
            <size>0.9 0.15 0.5</size>
          </box>
        </geometry>
        <pose frame=''>-0.744593 0 2.25 0 -0 0</pose>
      </collision>
    </link>
    <link name='Wall_57'>
      <pose frame=''>-0.766361 -0.161298 0 0 -0 0.006708</pose>
      <visual name='Wall_57_Visual_0'>
        <pose frame=''>-0.534301 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.146885 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_57_Collision_0'>
        <geometry>
          <box>
            <size>0.146885 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>-0.534301 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_57_Visual_1'>
        <pose frame=''>0.511599 0 1.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.19229 0.15 2.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_57_Collision_1'>
        <geometry>
          <box>
            <size>0.19229 0.15 2.5</size>
          </box>
        </geometry>
        <pose frame=''>0.511599 0 1.25 0 -0 0</pose>
      </collision>
      <visual name='Wall_57_Visual_2'>
        <pose frame=''>-0.022702 0 2.25 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.876312 0.15 0.5</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <ambient>1 1 1 1</ambient>
        </material>
      </visual>
      <collision name='Wall_57_Collision_2'>
        <geometry>
          <box>
            <size>0.876312 0.15 0.5</size>
          </box>
        </geometry>
        <pose frame=''>-0.022702 0 2.25 0 -0 0</pose>
      </collision>
    </link>
    <static>1</static>
  </model>
</sdf>

主要是Gazebo仿真场景中各类物体的具体属性参数。

model.config:

dawei

【声明】:唐山站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。