ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

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

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

lucasw gravatar image

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

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
camera_matrix:
  rows: 3
  cols: 3
  data: [500.0, 0, 320, 0, 500.0, 240, 0, 0, 1]
distortion_model: plumb_bob
distortion_coefficients:
...

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
1

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

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

Comments

lucasw gravatar image lucasw  ( 2016-02-24 17:39:01 -0500 )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 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 307 times

Last updated: Feb 24 '16