ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Use C++ camera_info_manager yamls with camera_info_manager_py, and vice versa?

asked 2016-02-23 11:41:53 -0600

lucasw gravatar image

updated 2020-11-21 11:24:23 -0600

I'd like to run camera_info_manager_py saveCalibrationFile in a python file and then load the same yaml in in C++, but it appears the yaml dump is saving like this:

!!python/unicode 'camera_matrix':
  !!python/unicode 'data': [1059.8847344712244, 0.0, 636.6932553292625, 0.0, 1058.8956875577258,
    470.30001700247, 0.0, 0.0, 1.0]
!!python/unicode 'camera_name': camera
!!python/unicode 'distortion_coefficients':

as opposed to the cleaner C++ output:

image_width: 640
image_height: 480
camera_name: image_publisher
  rows: 3
  cols: 3
  data: [500.0, 0, 320, 0, 500.0, 240, 0, 0, 1]
distortion_model: plumb_bob

Loading the C++ yaml in python doesn't generate an error, but the camera info is blank, while loading the python yaml in C++ generates

yaml-cpp: error at line 0, column 0: bad conversion]

Is this a bug or am I doing something wrong on the python side?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2016-02-24 16:44:19 -0600

joq gravatar image

It might be a bug. I doubt anyone has actually tried that test, certainly not me. Thanks for the report.

If you don't mind, please open a github issue, explaining exactly how your Python program uses camera_info_manager_py to save the data, and which Python version you are using.

edit flag offensive delete link more


lucasw gravatar image lucasw  ( 2016-02-24 17:39:01 -0600 )edit

Follow-up: it is a bug, and thanks to @lucasw for providing a fix.

joq gravatar image joq  ( 2016-02-27 16:27:38 -0600 )edit

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2016-02-23 11:41:53 -0600

Seen: 270 times

Last updated: Feb 24 '16