Skip to content
New issue

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

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

Already on GitHub? # to your account

Add LogicalCameraImage support (backport #698) #699

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Feb 24, 2025

🎉 New feature

Closes #697

Summary

ros_gz_bridge now supports gz.msgs.LogicalCamera image <-> ros_gz_interfaces.msg.LogicalCameraImage.

Test it

Test gz to ros conversion

1: Run parameter_bridge for /logical_camera between gz and ros

ros2 run ros_gz_bridge parameter_bridge /logical_camera_image@ros_gz_interfaces/msg/LogicalCameraImage@gz.msgs.LogicalCameraImage

2: In a new terminal, run

ros2 topic echo /logical_camera

3: In another terminal, publish the message from gz

gz topic -t /logical_camera -m gz.msgs.LogicalCameraImage -p 'header: { stamp: { sec: 0, nsec: 0 }, data: [ { key: "frame_id", value: ["logical_camera"] } ] }, pose: { position: { x: 1.0, y: 2.0, z: 3.0 }, orientation: { x: 0.0, y: 0.0, z: 0.0, w: 1.0 } }, model: [ { name: "model_1", pose: { position: { x: 4.0, y: 5.0, z: 6.0 }, orientation: { x: 0.0, y: 0.0, z: 0.0, w: 1.0 } } },  { name: "model_2", pose: { position: { x: 7.0, y: 8.0, z: 9.0 }, orientation: { x: 0.0, y: 0.0, z: 0.0, w: 1.0 } } }]'

In the terminal listening to /logical_camera, the output should be

header:
  stamp:
    sec: 0
    nanosec: 0
  frame_id: logical_camera
pose:
  position:
    x: 1.0
    y: 2.0
    z: 3.0
  orientation:
    x: 0.0
    y: 0.0
    z: 0.0
    w: 1.0
model:
- name: model_1
  pose:
    position:
      x: 4.0
      y: 5.0
      z: 6.0
    orientation:
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0
- name: model_2
  pose:
    position:
      x: 7.0
      y: 8.0
      z: 9.0
    orientation:
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0
---

Test ros to gz conversion

1: Run parameter_bridge for /logical_camera between gz and ros

ros2 run ros_gz_bridge parameter_bridge /logical_camera_image@ros_gz_interfaces/msg/LogicalCameraImage@gz.msgs.LogicalCameraImage

2: In another terminal, listen to the gz topic /logical_camera

gz topic -e -t /logical_camera

3: Publish the ros message

ros2 topic pub /logical_camera ros_gz_interfaces/msg/LogicalCameraImage \
"{header: {stamp: {sec: 0, nanosec: 0}, frame_id: 'logical_camera'}, \
pose: {position: {x: 1.0, y: 2.0, z: 3.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}, \
model: [{name: 'model_1', pose: {position: {x: 4.0, y: 5.0, z: 6.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}}, \
{name: 'model_2', pose: {position: {x: 7.0, y: 8.0, z: 9.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}}]}" --once

In the terminal listening to /logical_camera, the output should be

header {
  stamp {
  }
  data {
    key: "frame_id"
    value: "logical_camera"
  }
}
pose {
  position {
    x: 1
    y: 2
    z: 3
  }
  orientation {
    w: 1
  }
}
model {
  name: "model_1"
  pose {
    position {
      x: 4
      y: 5
      z: 6
    }
    orientation {
      w: 1
    }
  }
}
model {
  name: "model_2"
  pose {
    position {
      x: 7
      y: 8
      z: 9
    }
    orientation {
      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 #698 done by [Mergify](https://mergify.com).

Signed-off-by: Dyst-0 <69257845+Dyst-0@users.noreply.github.com>
(cherry picked from commit 16fbab4)
@mergify mergify bot requested a review from ahcorde as a code owner February 24, 2025 14:26
@mergify mergify bot mentioned this pull request Feb 24, 2025
9 tasks
@ahcorde ahcorde merged commit bfea2a0 into jazzy Feb 24, 2025
6 checks passed
@ahcorde ahcorde deleted the mergify/bp/jazzy/pr-698 branch February 24, 2025 15:28
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants