Skip to content

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Feb 27, 2025

🎉 New feature

Closes #2786

Summary

Logical camera now detects nested models instead of top level models only.

Test it

1 - Nest a model inside box in logical_camera_sensor.sdf

Nested model example
<model name="nested_model">
  <pose>1 1 -0.25 0 0 0</pose>
  <link name="nested_model_link">
    <inertial>
      <inertia>
        <ixx>1</ixx>
        <ixy>0</ixy>
        <ixz>0</ixz>
        <iyy>1</iyy>
        <iyz>0</iyz>
        <izz>1</izz>
      </inertia>
      <mass>1.0</mass>
    </inertial>
    <collision name="nested_model_collision">
      <geometry>
        <box>
          <size>0.5 0.5 0.5</size>
        </box>
      </geometry>
    </collision>

    <visual name="nested_model_visual">
      <geometry>
        <box>
          <size>0.5 0.5 0.5</size>
        </box>
      </geometry>
      <material>
        <ambient>1 0 0 1</ambient>
        <diffuse>1 0 0 1</diffuse>
        <specular>1 0 0 1</specular>
      </material>
    </visual>
  </link>
</model>

2 - Build and source if needed
3 - Run gz sim logical_camera_sensor.sdf
4 - Run gz topic -e -t /logical_camera

The output should show information about nested_model and the top level model box

Example output
header {
  stamp {
    sec: 7
    nsec: 400000000
  }
  data {
    key: "frame_id"
    value: "logical_camera::logical_camera_link::logical_camera"
  }
  data {
    key: "seq"
    value: "74"
  }
}
pose {
  position {
    x: 0.05
    y: 0.05
    z: 0.55
  }
  orientation {
    w: 1
  }
}
model {
  name: "box"
  pose {
    position {
      x: 0.95
      y: -0.05
      z: -0.042601271917138139
    }
    orientation {
      x: -1.1646185111097245e-18
      y: 1.154466086086657e-18
      z: 4.9495694579132863e-21
      w: 1
    }
  }
}
model {
  name: "nested_model"
  pose {
    position {
      x: 1.95
      y: 0.95
      z: -0.2926012039375952
    }
    orientation {
      x: 8.2961203174114e-19
      y: 1.3937209219279395e-18
      z: -2.2681468773043784e-20
      w: 1
    }
  }
}

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.


This is an automatic backport of pull request #2788 done by Mergify.

Signed-off-by: Dyst-0 <69257845+Dyst-0@users.noreply.github.com>
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Co-authored-by: Ian Chen <ichen@openrobotics.org>
(cherry picked from commit 036515f)
@mergify mergify bot requested a review from mjcarroll as a code owner February 27, 2025 02:55
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Feb 27, 2025
@ahcorde ahcorde merged commit 2c9466d into gz-sim8 Feb 27, 2025
10 of 11 checks passed
@ahcorde ahcorde deleted the mergify/bp/gz-sim8/pr-2788 branch February 27, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎵 harmonic Gazebo Harmonic

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants