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

Support sdf tag for camera_info topic #257

Closed
deepanshubansal01 opened this issue Aug 8, 2022 · 1 comment
Closed

Support sdf tag for camera_info topic #257

deepanshubansal01 opened this issue Aug 8, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@deepanshubansal01
Copy link
Contributor

deepanshubansal01 commented Aug 8, 2022

Desired behavior

The number of /camera_info topic should match the camera image topics. For instance if two camera sensors are being used we would expect two topics for /camera_info eg: /camera1/camera_info and /camera2/camera_info. However in the current design only one /camera_info topic is being created.

Implementation suggestion

Expose an additional optional camera info topic tag alongside image topic tag. If both topic and info tags are provided make sure they are on the same hierarchy level and if not show a warning.

Additional context

The ign-sensors in CameraSensor require image and /camera _info topic to be on the same level of hierarchy for instance: /camera1/image and /camera1/camera_info. If multiple camera sensors with topic names containing single hierarchy (eg: /camera1 and /camera2) is used, this leads to a creation of single /camera_info topic as opposed to two /camera_info topic that should have been created separately for the two cameras. The current behaviour is also inconsistent with gazebo classic.

For changing the topic names refer:

bool CameraSensor::AdvertiseInfo()
{
// TODO(anyone) Make info topic configurable from SDF
// Info topic must be at same level as image topic
auto parts = common::Split(this->Topic(), '/');
parts.pop_back();
for (const auto &part : parts)
{
if (!part.empty())
this->dataPtr->infoTopic += "/" + part;
}
this->dataPtr->infoTopic += "/camera_info";
return this->AdvertiseInfo(this->dataPtr->infoTopic);
}

@deepanshubansal01 deepanshubansal01 added the enhancement New feature or request label Aug 8, 2022
@azeey
Copy link
Contributor

azeey commented Nov 16, 2022

Fixed by #285

@azeey azeey closed this as completed Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

2 participants