ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

How to fix camera_calibration giving error on save in Noetic

asked 2020-12-10 21:40:15 -0500

Morris gravatar image

updated 2020-12-11 21:24:03 -0500

I am running camera_calibration in Noetic:

rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.026 image:=/camera/image_raw camera:=/raspicam_node

It works fine finding the calibration parameters, but when I try to save the parameters, I get an error from Python 2.x code. Is anyone else getting this problem? Seems bad that we have Python 2.x code in there. Here is the error:

Traceback (most recent call last):81604   Duration: 69.231470 / 84.882752               0
  File "/opt/ros/noetic/lib/python3/dist-packages/camera_calibration/camera_calibrator.py", line 273, in on_mouse
self.c.do_save()
  File "/opt/ros/noetic/lib/python3/dist-packages/camera_calibration/calibrator.py", line 577, in do_save
self.do_tarfile_save(tf) # Must be overridden in subclasses
  File "/opt/ros/noetic/lib/python3/dist-packages/camera_calibration/calibrator.py", line 889, in do_tarfile_save
taradd(name, cv2.imencode(".png", im)[1].tostring())
  File "/opt/ros/noetic/lib/python3/dist-packages/camera_calibration/calibrator.py", line 877, in taradd
if isinstance(buf, basestring): 
NameError: name 'basestring' is not defined

The command basestring is Python 2 command that is now str in Python 3. So I think that's the problem. I can't directly edit this file though, so don't know how to fix the problem.

edit retag flag offensive close merge delete

Comments

2

This has actually been fixed in https://github.com/ros-perception/ima... in June, but the latest release is from May. So you should probably install that from sources...

mgruhler gravatar image mgruhler  ( 2020-12-11 05:07:49 -0500 )edit

That's great. A couple questions 1. Do you mean I need to install all of ROS Noetic from source, or just the ros-perception?
2. If the latter, would I: sudo apt-get remove ros-noetic-perception and build it from source in my catkin_ws?
3. Finally, any idea when the next release that incorporates this will be? Thank you!

Morris gravatar image Morris  ( 2020-12-11 05:24:27 -0500 )edit
  1. No, only the package in question. Maybe the full repo (image_pipeline). Obviously, if there are any dependencies that you need that haven't been installed, those as well. But from the change this looks good.
  2. No, just put it in your workspace and it takes precedence. See Workspace Chaining for some background
  3. Sorry no. The repo seems not very active. You could check if there is an issue open for a noetic release and voice your support for that to happen, or, if not, open a new one.
mgruhler gravatar image mgruhler  ( 2020-12-11 07:41:49 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-12-11 08:31:58 -0500

Morris gravatar image

updated 2020-12-11 08:32:34 -0500

As @mgruhler pointed out, this is a bug that has been fixed https://github.com/ros-perception/ima..., but is not yet part of the standard Noetic release. I raised an issue to sync image_pipeline with Noetic. But in the mean time, the solution that @mgruhler suggests works great:

Simply clone the latest https://github.com/ros-perception/ima... into your catkin_ws/src folder, build it, and it will take precedence.

edit flag offensive delete link more

Comments

The release has been triggered. Once this PR is merged, one still has to wait for the next package sync, but this shouldn't take toooo long then. Depending on whether it makes it in the next sync or the one after that, maybe end of January?

mgruhler gravatar image mgruhler  ( 2020-12-12 06:47:07 -0500 )edit

Excellent!

Morris gravatar image Morris  ( 2020-12-12 08:57:34 -0500 )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

Stats

Asked: 2020-12-10 21:40:15 -0500

Seen: 346 times

Last updated: Dec 11 '20