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

syncronize camera_info with images #38

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from

Conversation

LeroyR
Copy link
Contributor

@LeroyR LeroyR commented Nov 15, 2024

Description

camera_info needs to have the same timestamp as the images. (e.g. for usage with message_filters.TimeSynchronizer)

  • give each image from cameras its own CameraInfo
  • add configuration for camera topics

This changes cameras to publish a syncronized camera_info for each image. e.g for rgb image:
/mujoco_server/cameras/camera_name/rgb/camera_info
/mujoco_server/cameras/camera_name/rgb/image_raw

Additional configuration options to change topics:
camera_name/topic: defaults to "/mujoco_server/cameras/camera_name"
camera_name/name_rgb: default to "rbg"
camera_name/name_depth: default to "depth"
camera_name/name_segment: default to "segmented"

Checklist

  • Required by CI: Code is auto formatted using clang-format.
  • Add a brief explanation of your changes to the changelog.

mujoco_ros/src/offscreen_camera.cpp Outdated Show resolved Hide resolved
mujoco_ros/src/offscreen_camera.cpp Outdated Show resolved Hide resolved
mujoco_ros/src/offscreen_camera.cpp Show resolved Hide resolved
@DavidPL1
Copy link
Contributor

I think this PR should be extended to allow different resolutions per stream type (probably RGB and SEGMENT should use the same) , justifying the need of individual camera infos. To better replicate real setups.
Following rep-0104 we then can keep the model of only publishing camera info when an image was rendered, but change the rendering condition to a subscription of either the Image or the info topic.
I suppose the information on how to align RGB and Depth needs to be specified, too, in case resolutions differ.

@rhaschke
Copy link
Member

camera_info needs to have the same timestamp as the images

Are you sure. Usually, camera_info topics are latched and simply provide a fixed message. Therefore, the timestamp shouldn't be relevant.

@LeroyR
Copy link
Contributor Author

LeroyR commented Nov 18, 2024

camera_info needs to have the same timestamp as the images

Are you sure. Usually, camera_info topics are latched and simply provide a fixed message. Therefore, the timestamp shouldn't be relevant.

Atleast our cameras do that. By rep-0104 camera_info is send with every image:

Publish CameraInfo Only When Parameters Change
One FAQ is, "Why send CameraInfo with every Image message? Why not only once?" The main answer is that operational parameters (binning, ROI) may change, perhaps rapidly, from image to image.

- give each image from cameras its own topic
- add configuration for camera topics

This changes cameras to publish a syncronized camera_info for
each image. e.g for rgb image:
/mujoco_server/cameras/camera_name/rgb/camera_info
/mujoco_server/cameras/camera_name/rgb/image_raw

Additional configuration options to change topics:
  camera_name/topic: defaults to "/mujoco_server/cameras/camera_name"
  camera_name/name_rgb: default to "rbg"
  camera_name/name_depth: default to "depth"
  camera_name/name_segment: default to "segmented"
@LeroyR
Copy link
Contributor Author

LeroyR commented Nov 18, 2024

I changed the offscreen_camera to have a CameraInfo publisher for each of the images.

The topics are now configurable such that:

/mujoco_server/cameras/camera_name/rgb/image_raw
/mujoco_server/cameras/camera_name/rgb/camera_info

is used as default - which should match real camera setups.

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 this pull request may close these issues.

3 participants