How to fix camera_calibration giving error on save in Noetic
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.
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...
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!
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.