Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nest camera definition within link #327

Closed
23pointsNorth opened this issue Sep 26, 2023 · 2 comments · Fixed by #329
Closed

Nest camera definition within link #327

23pointsNorth opened this issue Sep 26, 2023 · 2 comments · Fixed by #329

Comments

@23pointsNorth
Copy link
Contributor

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.

hwiedPro added a commit that referenced this issue Sep 26, 2023
@23pointsNorth
Copy link
Contributor Author

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

@23pointsNorth
Copy link
Contributor Author

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!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant