PX4-Autopilot SITL默认无人机模型iris.sdf:插件解读

iris.sdf源文件地址

PX4-Autopilot SITL 用于生成iris.sdf的模板文件,内容与iris.sdf相同

PX4-Autopilot v1.13的sitl_gazebo工具箱提供了3DR iris无人机的.sdf格式模型。本文将主要围绕该模型涉及到的插件(plugin)对其进行分析。

iris.sdf

rosbag

    <plugin name='rosbag' filename='libgazebo_multirotor_base_plugin.so'>
      <robotNamespace/>
      <linkName>base_link</linkName>
      <rotorVelocitySlowdownSim>10</rotorVelocitySlowdownSim>
    </plugin>

front_right_motor_model

电机仿真插件,共有四组,此处贴出右前侧电机插件代码。

    <plugin name='front_right_motor_model' filename='libgazebo_motor_model.so'>
      <robotNamespace/>
      <jointName>rotor_0_joint</jointName>
      <linkName>rotor_0</linkName>
      <turningDirection>ccw</turningDirection>
      <timeConstantUp>0.0125</timeConstantUp>
      <timeConstantDown>0.025</timeConstantDown>
      <maxRotVelocity>1100</maxRotVelocity>
      <motorConstant>5.84e-06</motorConstant>
      <momentConstant>0.06</momentConstant>
      <commandSubTopic>/gazebo/command/motor_speed</commandSubTopic>
      <motorNumber>0</motorNumber>
      <rotorDragCoefficient>0.000175</rotorDragCoefficient>
      <rollingMomentCoefficient>1e-06</rollingMomentCoefficient>
      <motorSpeedPubTopic>/motor_speed/0</motorSpeedPubTopic>
      <rotorVelocitySlowdownSim>10</rotorVelocitySlowdownSim>
    </plugin>

groundtruth_plugin

    <plugin name='groundtruth_plugin' filename='libgazebo_groundtruth_plugin.so'>
      <robotNamespace/>
    </plugin>

magnetometer_plugin

罗盘仿真插件。提供罗盘发布率、噪声等参数。这些参数被PX4-Autopilot/Tools/sitl_gazebo/src/gazebo_magnetometer_plugin.cpp读取。

    <plugin name='magnetometer_plugin' filename='libgazebo_magnetometer_plugin.so'>
      <robotNamespace/>
      <pubRate>100</pubRate>
      <noiseDensity>0.0004</noiseDensity>
      <randomWalk>6.4e-06</randomWalk>
      <biasCorrelationTime>600</biasCorrelationTime>
      <magTopic>/mag</magTopic>
    </plugin>

barometer_plugin

气压计插件,提供发布率、漂移等参数。

    <plugin name='barometer_plugin' filename='libgazebo_barometer_plugin.so'>
      <robotNamespace/>
      <pubRate>50</pubRate>
      <baroTopic>/baro</baroTopic>
      <baroDriftPaPerSec>0</baroDriftPaPerSec>
    </plugin>

rotors_gazebo_imu_plugin

惯性测量单元的仿真插件,为陀螺仪和加速度计提供仿真误差参数。这些参数被PX4-Autopilot/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp读取。

    <plugin name='rotors_gazebo_imu_plugin' filename='libgazebo_imu_plugin.so'>
      <robotNamespace/>
      <linkName>/imu_link</linkName>
      <imuTopic>/imu</imuTopic>
      <gyroscopeNoiseDensity>0.00018665</gyroscopeNoiseDensity>
      <gyroscopeRandomWalk>3.8785e-05</gyroscopeRandomWalk>
      <gyroscopeBiasCorrelationTime>1000.0</gyroscopeBiasCorrelationTime>
      <gyroscopeTurnOnBiasSigma>0.0087</gyroscopeTurnOnBiasSigma>
      <accelerometerNoiseDensity>0.00186</accelerometerNoiseDensity>
      <accelerometerRandomWalk>0.006</accelerometerRandomWalk>
      <accelerometerBiasCorrelationTime>300.0</accelerometerBiasCorrelationTime>
      <accelerometerTurnOnBiasSigma>0.196</accelerometerTurnOnBiasSigma>
    </plugin>

子模型:gps.sdf

GPS单元模块由gps.sdf提供。在iris模型中该单元被重命名为gps0,并与iris::baselink相连。

    <include>
      <uri>model://gps</uri>
      <pose>0.1 0 0 0 0 0</pose>
      <name>gps0</name>
    </include>
    <joint name='gps0_joint' type='fixed'>
      <child>gps0::link</child>
      <parent>base_link</parent>
    </joint>

gps_plugin

gps仿真插件,提供各种噪声参数。将<gpsNoise>true</gpsNoise>标签删除或注释掉可以关闭gps噪声。

        <plugin name="gps_plugin" filename="libgazebo_gps_plugin.so">
          <robotNamespace></robotNamespace>
          <gpsNoise>true</gpsNoise>
          <gpsXYRandomWalk>2.0</gpsXYRandomWalk>
          <gpsZRandomWalk>4.0</gpsZRandomWalk>
          <gpsXYNoiseDensity>2.0e-4</gpsXYNoiseDensity>
          <gpsZNoiseDensity>4.0e-4</gpsZNoiseDensity>
          <gpsVXYNoiseDensity>0.2</gpsVXYNoiseDensity>
          <gpsVZNoiseDensity>0.4</gpsVZNoiseDensity>
        </plugin>

  • 6
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值