How to implement "Multiple CameraInfoManagers in same node"?
I'm trying to modify the cv_camera package to do a synchronized grabbing of the two frames of a stereo camera. The publication of the two images works fine, but the two CameraInfoManager's in the node are causing problems. When starting the node, this error is displayed:
[ERROR] [1496147678.442999357]: Tried to advertise a service that is already advertised in this node [/cv_camera/set_camera_info]
I assume the problem is that the two CameraInfoManager try to create a service of the same name.
In this question it is said:
Now you can have 2 camera info managers in the same driver node for both cameras; but the 2 camera info managers should be remapped to separate topic, identical with the camera namepaces
But unfortunately the author does not specify how to remap these topics.
In my code the constructor of the core functionality class Capture
initializes two camera_info_manager::CameraInfoManager
objects:
Capture::Capture([....]) :
node_(node),
[...],
frame_id_(frame_id),
info_managerLeft_( node_, frame_id),
info_managerRight_(node_, frame_id)
{
}
In the documentation of the CameraInfoManager Class Constructor it is said:
Parameter nh : node handle, normally for the driver's streaming name space ("camera"). The service name is relative to this handle. Nodes supporting multiple cameras may use subordinate names, like "left/camera" and "right/camera".
So how can I pass subordinate names to the info_managers?