Gazebo | Ignition | Community
Ask Your Question
0

adding multiple sensors to SDF model

asked 2020-08-05 04:28:10 -0600

kris_1313 gravatar image

Hey, I'm modifying Iris drone from px4 stack and I not sure how to add multiple sensors. Now my SDF file is like this:

<sdf version='1.6'>
  <model name='iris_with_4sensors'>
    <include>
      <uri>model://iris</uri>
    </include>
        <include>
      <uri>model://sonar</uri>
      <pose>0.08 0 -0.03 0 0 3.141592</pose>
    </include>
        <include>
      <uri>model://sonar</uri>
      <pose>0 0.08 -0.03 0 0 -1.570796</pose>
    </include>
        <include>
      <uri>model://sonar</uri>
      <pose>0 -0.08 -0.03 0 0 1.570796</pose>
    </include>
        <include>
      <uri>model://sonar</uri>
      <pose>-0.08 0 -0.03 0 0 0</pose>
    </include>
        <include>
      <uri>model://sonar</uri>
      <pose>0 0 -0.03 0 1.570796 3.141592</pose>
    </include>
        <include>
      <uri>model://sonar</uri>
      <pose>0 0 0.03 0 -1.570796 3.141592</pose>
    </include>
        <joint name="sonar_front_joint" type="fixed">
      <child>sonar::link</child>
      <parent>iris::base_link</parent>
    </joint>
        <joint name="sonar_rear_joint" type="fixed">
      <child>sonar::link</child>
      <parent>iris::base_link</parent>
    </joint>
        <joint name="sonar_left_joint" type="fixed">
      <child>sonar::link</child>
      <parent>iris::base_link</parent>
    </joint>
        <joint name="sonar_right_joint" type="fixed">
      <child>sonar::link</child>
      <parent>iris::base_link</parent>
    </joint>
        <joint name="sonar_up_joint" type="fixed">
      <child>sonar::link</child>
      <parent>iris::base_link</parent>
    </joint>
        <joint name="sonar_down_joint" type="fixed">
      <child>sonar::link</child>
      <parent>iris::base_link</parent>
    </joint>
  </model>
</sdf>

and I'm not sure if overriding sonars names would broke things up...

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-08-05 08:42:52 -0600

nlamprian gravatar image

You need to set unique names for each model you include.

<include>
  <name>sonar_0</name>
  <uri>model://sonar</uri>
  <pose>0 0 0.03 0 -1.570796 3.141592</pose>
</include>
<joint name="sonar_front_joint" type="fixed">
  <parent>iris::base_link</parent>
  <child>sonar_0::link</child>
</joint>
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-08-05 04:28:10 -0600

Seen: 46 times

Last updated: Aug 05