ROS_mooc仿真环境的相关说明

ROS_mooc仿真环境的相关说明

1、文件夹包含内容详细说明

├── CMakeLists.txt
├── launch
│   ├── include
│   │   └── xbot-u.launch.xml   #机器人模型(设置机器人初始位置)
│   └── robot_spawn.launch      #启动launch文件显示仿真环境
├── models                      #仿真空间
│   ├── ISCAS_groundplane       #地板
│   │   ├── materials
│   │   │   ├── scripts
│   │   │   │   └── ISCAS_groundplane.material
│   │   │   └── textures
│   │   │       ├── ISCAS_groundplane.png
│   │   │       └── lALPGpNybAwSyFTNAljNAlg_600_600.png
│   │   ├── model.config
│   │   └── model.sdf
│   ├── ISCAS_Museum          #墙面
│   │   ├── meshes
│   │   │   ├── ISCAS_museum.dae
│   │   │   ├── zd_011.jpg
│   │   │   ├── zd_021.jpg
│   │   │   ├── zd_031.jpg
│   │   │   └── zd_041.jpg
│   │   ├── model.config
│   │   └── model.sdf
│   ├── ISCAS_post
│   │   ├── meshes
│   │   │   └── post.dae
│   │   ├── model.config
│   │   └── model.sdf
│   └── meshes                       #各个模型渲染的部分包括基底以及pitch、yaw平台以及相机和激光雷                                       达
│       ├── base_link.dae
│       ├── pitch_platform.dae
│       ├── realsense.dae
│       ├── rplidar.dae
│       ├── sick_tim571.stl
│       ├── uvtietu.jpg
│       ├── wheel.dae
│       ├── wheel.jpg
│       ├── xtion_pro_camera.dae
│       ├── xtion_pro_camera.jpg
│       └── yaw_platform.dae
├── package.xml
├── param
│   ├── mux.yaml                  #订阅话题以及发布话题的相关参数设置
│   └── xbot-u_control.yaml       #机器人控制参数的设置(PID)   
├── README.md
├── scripts
│   └── robot_keyboard_teleop.py
├── simulation_pic.png
├── urdf                           #构建机器人模型
│   ├── materials.xacro            #颜色设置
│   ├── robot.urdf                 #urdf文件是通过xacro文件转换自动生成的(xacro文件比较精简,                                       urdf文件比较复杂)
│   ├── robot.xacro                #机器人整体模型文件(可以选择激光雷达的类型)包含该文件下的所有文                                     件
│   ├── sick_tim.gv                #使用命令生成的
│   ├── sick_tim.pdf               #显示整个机器人模型的连接关系
│   ├── sick_tim.urdf.xacro        #激光雷达模型(多种激光雷达,包括rplidarA2、sick_tim310、                                         551、571等)
│   ├── xbot-u.gazebo
│   └── xbot-u.urdf.xacro          #机器人模型所需要的各个部分可以通过可以通过rqt_tf_tree查看各个                                     link和joint之间的连接关系
└── worlds
    └── ROS-Academy.world

ROS_mooc仿真环境的相关说明_第1张图片

2、urdf文件中具体参数解释

    #质量
 
          #放置urdf中引用的模型渲染文件
          #球
          #圆柱
 
     #continuous旋转关节,可以围绕单轴无限旋转
   #运动的一些极限值,包括关节运动的上下位置、速度限制以及力矩限制
 # damping表示阻尼,friction表示摩擦

3、gazebo文件中具体参数解释说明


<robot >
#差速驱动插件,很多机器人本体都采用差速驱动的方式,指定运动控制需要订阅的话题,让机器人在gazebo中动起来
  <gazebo>
    <plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
      <odometryTopic>odomodometryTopic>
      <odometryFrame>odomodometryFrame>
      <commandTopic>cmd_velcommandTopic>
      <legacyMode>falselegacyMode>
      <alwaysOn>truealwaysOn>
      <updateRate>50updateRate>
      <leftJoint>left_wheel_hingeleftJoint>
      <rightJoint>right_wheel_hingerightJoint>
      <wheelSeparation>0.46wheelSeparation>  #轮距
      <wheelDiameter>0.19wheelDiameter>      #车轮直径
      <torque>10.4torque>                    #扭矩
      <wheelAcceleration>1wheelAcceleration>
      <robotBaseFrame>base_footprintrobotBaseFrame>
      <publishTf>truepublishTf>
      <publishWheelTF>truepublishWheelTF>
      <publishWheelJointState>truepublishWheelJointState>
    plugin>
  gazebo>
#imu插件相关参数
  <gazebo reference="imu_link">
    <gravity>truegravity>
    <sensor name="imu_sensor" type="imu">
      <always_on>truealways_on>
      <update_rate>100update_rate> 更新速率为100Hz
      <visualize>truevisualize>
      <topic>__default_topic__topic>
      <plugin filename="libgazebo_ros_imu_sensor.so" name="imu_plugin">
        <topicName>imutopicName>
        <bodyName>imu_linkbodyName>
        <updateRateHZ>10.0updateRateHZ>
        <gaussianNoise>0.0gaussianNoise>   #高斯噪声
        <xyzOffset>0 0 0xyzOffset>         #补偿
        <rpyOffset>0 0 0rpyOffset>
        <frameName>imu_linkframeName>
      plugin>
      <pose>0 0 0 0 0 0pose>
    sensor>
  gazebo>

#相机插件
  
    <gazebo reference="camera_link">  #插件都是用来描述link、joint的,是一种虚无的属性描述,需要关联相应的实体,所以首先我们需要通过reference参数来定义关联的link或者joint。这里我们关联的是camera_link。
      <sensor type="depth" name="camera">声明插件的类型,并命名插件
        <plugin name="kinect_camera_controller" filename="libgazebo_ros_openni_kinect.so">
          <cameraName>cameracameraName>
          <alwaysOn>truealwaysOn>
          <updateRate>10updateRate>  #摄像头数据更新的最大频率
          <imageTopicName>rgb/image_rawimageTopicName>
          <depthImageTopicName>depth/image_rawdepthImageTopicName>
          <pointCloudTopicName>depth/pointspointCloudTopicName>
          <cameraInfoTopicName>rgb/camera_infocameraInfoTopicName>
          <depthImageCameraInfoTopicName>depth/camera_infodepthImageCameraInfoTopicName>
          <frameName>camera_link_opticalframeName>
          <baseline>0.1baseline>#基线,相机的参数
          <distortion_k1>0.0distortion_k1>#相机的内参
          <distortion_k2>0.0distortion_k2>
          <distortion_k3>0.0distortion_k3>
          <distortion_t1>0.0distortion_t1>
          <distortion_t2>0.0distortion_t2>
          <pointCloudCutoff>0.4pointCloudCutoff>
        plugin>
      sensor>
    gazebo>

  <gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
      <robotNamespace>/xbotrobotNamespace>
      <robotSimType>gazebo_ros_control/DefaultRobotHWSimrobotSimType>
    plugin>
  gazebo>

  <gazebo reference="base_link">
    <mu>0mu>
    <mu2>0mu2>
    <kp>100000000.0kp>
    <kd>10000.0kd>   
  gazebo>

  <gazebo reference="laser">
  gazebo>

  <gazebo reference="right_wheel">
    <mu>10mu>
    <mu2>10mu2>
    <kp>100000000.0kp>
    <kd>10000.0kd>    
  gazebo>

  <gazebo reference="left_wheel">
    <mu>10mu>
    <mu2>10mu2>
    <kp>100000000.0kp>
    <kd>10000.0kd>   
  gazebo>
#接触系数(link彼此接触的行为方式)
    mu:摩擦系数
    kp:刚度系数
    kd:阻尼系数
  <gazebo reference="yaw_platform">
    <mu>.5mu>
    <mu2>.5mu2>
  gazebo>

  <gazebo reference="pitch_platform">
    <mu>.5mu>
    <mu2>.5mu2>
  gazebo>

  
  <transmission name="tran1">
    <type>transmission_interface/SimpleTransmissiontype>
    <joint name="base_to_yaw_platform">
      <hardwareInterface>EffortJointInterfacehardwareInterface>
    joint>
    <actuator name="yaw_motor">
      <hardwareInterface>EffortJointInterfacehardwareInterface>
      <mechanicalReduction>1mechanicalReduction>
    actuator>
  transmission>

  <transmission name="tran2">
    <type>transmission_interface/SimpleTransmissiontype>
    <joint name="yaw_to_pitch_platform">
      <hardwareInterface>EffortJointInterfacehardwareInterface>
    joint>
    <actuator name="pitch_motor">
      <hardwareInterface>EffortJointInterfacehardwareInterface>
      <mechanicalReduction>1mechanicalReduction>
    actuator>
  transmission>

  

  


robot>

4、仿真空间设置


<sdf version="1.4">
  <world name="default">
  <scene>
    <ambient>0.68 0.68 0.68 1.0ambient>
    <sky>
      <sunrise/>
      <clouds>
        <speed>12speed>
    clouds>
    sky>
  scene>
    <physics type='ode'>
      <max_step_size>0.001max_step_size>
      <real_time_factor>1real_time_factor>
      <real_time_update_rate>1000real_time_update_rate>
      <gravity>0 0 -9.8gravity>
    physics>

    <include>
      <uri>model://ISCAS_groundplaneuri>
    include>
    <include>
      <uri>model://sunuri>
    include>
    <include>
      <uri>model://ISCAS_Museumuri>
      <pose>0 0 0 0 0 -1.57pose>
    include>
    
  world>
sdf>

reference:
中国大学MOOC《机器人操作系统入门》代码示例 ROS tutorial
ROS探索总结(二十四)——使用gazebo中的插件

ROS机器人建模与仿真—向URDF模型添加 物理属性 和 碰撞属性

你可能感兴趣的:(ROS,激光SLAM)