Ask Your Question
1

How to add prefix to "/set_camera_info" service ?

asked 2012-06-01 05:18:18 -0500

Guido gravatar image

updated 2012-06-01 05:19:28 -0500

Hi all,

I'm trying to advertise a camera image+info in order to calibrate it. I create my info manager like follows :

camera_info_manager::CameraInfoManager info_mgr(nh, "webcam");

webcam is my camera name. Though, when I start the programme and ask for a "rosservice list" I only get :

/set_camera_info

with no prefix. What am I missing ?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-06-01 06:22:46 -0500

joq gravatar image

updated 2012-06-01 08:29:34 -0500

The API documentation specifies nh to be a ros::NodeHandle for the camera's streaming name space. You seem to have passed a node handle for the driver node, instead.

The second (cname) parameter has a different purpose. It attempts to identify which physical device the associated calibration describes. For that, a UUID or make, model and serial number are recommended.

Try something like this:

camera_info_manager::CameraInfoManager cinfo(ros::NodeHandle("webcam"));

That will advertise /webcam/set_camera_info.

edit flag offensive delete link more

Comments

It works perfectly ! Thank you for all the advices.

Guido gravatar image Guido  ( 2012-06-02 02:06:32 -0500 )edit
0

answered 2012-06-01 06:16:05 -0500

DimitriProsser gravatar image

If you add a prefix to your node handler (nh in your example), that prefix should be used on the service.

ros::NodeHandle nh("webcam");

If that doesn't work, you can always launch the node in a non-global namespace. Have a look at this question.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-06-01 05:18:18 -0500

Seen: 804 times

Last updated: Jun 01 '12