Camera_calibration is stuck - nothing happens (black window)
Hello,
I am having problems in trying to run camera calibration for a tello drone. I am using ros2, foxy distro, ubuntu 20.04.
I have installed tello drivers/nodes by using this package: https://github.com/tentone/tello-ros2 I run the launch file and works fine, I am able to control the drone (e.g. send command to takeoff, landing), and from the rviz gui I am able to see the image from the camera from the published \camera topic, and also able to select the different topics that are published.
Now i am trying to run camera calibration, but I am stuck. I run the following command:
ros2 run camera_calibration cameracalibrator --size 7x9 --square 0.16 image:=/image_raw camera:=/camera_info
The output looks more or less ok, except from the warnings:
[WARN] [1666088539.374651575] [rcl]: Found remap rule 'image:=/image_raw'. This syntax is deprecated. Use '--ros-args --remap image:=/image_raw' instead.
[WARN] [1666088539.374677600] [rcl]: Found remap rule 'camera:=/camera_info'. This syntax is deprecated. Use '--ros-args --remap camera:=/camera_info' instead.
Waiting for service camera/set_camera_info ...
OK
Waiting for service left_camera/set_camera_info ...
OK
Waiting for service right_camera/set_camera_info ...
OK
The 'display' window opens, but at this point, nothing happens. The display window remains black (it is supposed to show the image from the camera, I guess) and nothing else is printed on the terminal. I have been waiting for a few minutes, nothing happens. When I interrupt the command with ctrl+c, I see that the execution is stuck at this line:
Traceback (most recent call last):
File "/opt/ros/foxy/lib/camera_calibration/cameracalibrator", line 11, in <module>
load_entry_point('camera-calibration==2.2.0', 'console_scripts', 'cameracalibrator')()
File "/opt/ros/foxy/lib/python3.8/site-packages/camera_calibration/nodes/cameracalibrator.py", line 146, in main
node.spin()
File "/opt/ros/foxy/lib/python3.8/site-packages/camera_calibration/camera_calibrator.py", line 229, in spin
time.sleep(0.1)
KeyboardInterrupt
Any idea if I am doing something wrong? Any help would be appreciated. Thank you!
I just tested it with the RealSense D435 Camera, and it works. I used the following command
ros2 run camera_calibration cameracalibrator --size 7x4 --square 0.035 --ros-args -r image:=/camera/color/image_raw -p camera:=/camera/color/camera_info
.I also noticed that the the
Waiting for service blah blah blah OK
is printed even with no camera. Therefore, can you please confirm that camera is attached, and images are available in the correct topic?Hi, I can see the camera images correctly displayed if I select the /camera topic in the rviz gui. Do you mean, to check in some other way?
Thank you very much. I understand.
camera_info
is also being published? For example, you can run the following command to do so:rostopic echo /camera_info
Can you also, make sure that
image_raw
andcamera_info
topic are correct. For example, both of these topic share same values inframe_id
,height
,width
. Please see below an example:In my test workspace, the
image_raw
andcamera_info
have following common values. In other words, theframe_id
iscamera_color_optical_frame
inimage_raw
andcamera_info
and so on.I am using ros2, so I have tried with the following command:
This is the output:
I thought it was normal to see all these zeros since the camera is not calibrated yet - is that not the case?
Ok, after some digging, I found out the root of the problem - topic /image_raw was not published. In fact, this line of the launch file fails: https://github.com/tentone/tello-ros2...
And in the terminal of the launch file, after the 'streamon' command, I see a lot of these errors:
So it seems a problem with h264decoder? I'm investigating.
So after more digging, I found out the error in the output appears when calling the instruction get_frame_read(), here:
https://github.com/tentone/tello-ros2...
interestingly, I tried to open python and run the code found in this answer on SO:
https://stackoverflow.com/a/72420343
And I am able to correctly see the live video of the tello camera. I think I need to add some 'wait' function in the node.py code as well...
seems like an issue with tello...