-
Notifications
You must be signed in to change notification settings - Fork 228
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
Handling namespace for multiple CameraInfoManagers in ROS2 jazzy #341
Comments
The feature you're looking for was added in #324, and it was not backported because it breaks ABI. It does mention
If you're using normal nodes, you could create a sub-node and pass it to this constructor image_common/camera_info_manager/src/camera_info_manager.cpp Lines 80 to 86 in 34ad5db
|
Thank you, I think sub-nodes is what I was looking for, I wasn't aware that they exist! However, I've had no luck so far. Here's my code: auto nh = rclcpp::Node::make_shared( "split_image" );
auto nhLeftFullscale = nh->create_sub_node("left_fullscale");
auto nhRightFullscale = nh->create_sub_node( "right_fullscale");
RCLCPP_INFO_STREAM( rclcpp::get_logger("rclcpp"),
"Sub-node initialized in: " << nhLeftFullscale->get_effective_namespace() );
RCLCPP_INFO_STREAM( rclcpp::get_logger("rclcpp"),
"Sub-node initialized in: " << nhRightFullscale->get_effective_namespace() );
image_transport::ImageTransport itLeftFullscale( nhLeftFullscale );
image_transport::ImageTransport itRightFullscale( nhRightFullscale );
m_pubLeftFullscale = itLeftFullscale.advertiseCamera("left_fullscale/image_raw", 10);
m_pubRightFullscale = itRightFullscale.advertiseCamera("right_fullscale/image_raw", 10);
m_camInfoManagerLeftFullscale = std::make_shared<camera_info_manager::CameraInfoManager>(
nhLeftFullscale.get(), "left" );
m_camInfoManagerRightFullscale = std::make_shared<camera_info_manager::CameraInfoManager>(
nhRightFullscale.get(), "right" ); This correctly outputs:
... and the image transport topics are correctly published under However, it only creates this service (and calling it hangs indefinitely)
Is this related to the fact that I'm running all of this in a component? Does the component container somehow "swallow" the services? |
I would expect the same given that the service uses the name
I would not expect the component container to affect this. Components share the context object, but IIRC remapping names happens on Nodes, and components don't share Nodes. I'm very surprised by the name I think next step to resolving this is to come up with a minimal reproducible example, maybe using just the |
Sure, here's a minimal example using two sub-nodes and two CameraInfoManagers. I used jazzy to run this, but it'd be interesting to see if other distros are affected as well. While the node is running, I see one
I've also been searching for other repositories who use CameraInfoManager with stereo cameras, but I've not had any luck of finding a good, simple, working example. I thought this was the standard way of doing things? Edit:
This resolves to: |
Hi,
I'm trying to set up the driver for a stereo camera, so I need two CameraInfoManager instances.
The hope was that I could set up the classes in such a way that they advertise:
However, they always seem to end up advertising the exact same service name...?
Is there a workaround?
I saw that on the rolling branch, there is a "namespace" (ns) parameter that one can pass to the CameraInfoManager constructor, however it's missing on the jazzy branch. Is there a workaround? Or could this be backported?
The text was updated successfully, but these errors were encountered: