dfki-ric / phobos

An add-on for Blender allowing to create URDF, SDF and SMURF robot models in a WYSIWYG environment.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nest camera definition within link

23pointsNorth opened this issue · comments

Describe the bug
When I export the SDF or URDF, the camera sensors list are grouped and added in the beginning. However, importing things to gazebo requires for them to be part of the link definition.

Expected

<sdf version="1.9">
<model name="machine" canonical_link="base_link">
<link name="base_link"> # inside link
    ...
    <sensor name="cabin_camera" type="camera">
      <pose relative_to="base_link">1.38000 0.50000 3.20000 1.57080 0.00000 -0.17453</pose>
      <always_on>1</always_on>
      <update_rate>30</update_rate>
      <visualize>true</visualize>
      <enable_metrics>true</enable_metrics>
      <camera name="cabin_camera">
        <horizontal_fov>1.52</horizontal_fov> # in rads
        <image>
          <width>640</width>
          <height>480</height>
        </image>
      </camera>
    </sensor>
  </link>

Actual:

<sdf version="1.9">
<model name="machine" canonical_link="base_link">
  <sensor name="cabin_camera" type="camera">
    <pose relative_to="base_link">1.38000 0.50000 3.20000 1.57080 0.00000 -0.17453</pose>
    <always_on>1</always_on>
    <update_rate>30</update_rate>
    <visualize>true</visualize>
    <enable_metrics>true</enable_metrics>
    <camera name="cabin_camera">
      <horizontal_fov>90</horizontal_fov>
      <image>
        <width>640</width>
        <height>480</height>
      </image>
    </camera>
  </sensor>

  <link name="base_link"> 
  ...
  </link>

To Reproduce
Steps to reproduce the behavior:

  1. Add camera sensor to link
  2. Export SDF

Expected behavior
An exported SDF to be importable to Gazebo.

Just to add on to this. Here is the SDF specification stating the need of a sensor to be within a link/joint - http://sdformat.org/spec?elem=sensor

The nesting is still not there after the last merged PRs (and the above mentioned commit) Current tested commit: ed52516
(The fov is in rads! thanks!)