Camera model not correctly specified.
I'm trying to get rpg_svo - a project implementing semi-direct visual odometry - running. I can run the sample codes on a dataset, but not on a camera live stream.
I am using Indigo with the latest pull from the image_pipeline. I hope the error is not because I am using Indigo and not a more stable version of ROS.
Here is my terminal dump:
SUMMARY
========
CLEAR PARAMETERS
* /svo/
PARAMETERS
* /rosdistro: indigo
* /rosversion: 1.11.7
* /svo/cam_topic: /usb_cam/image_raw
* /svo/camera_matrix/cols: 3
* /svo/camera_matrix/data: [423.946127, 0, 3...
* /svo/camera_matrix/rows: 3
* /svo/camera_name: narrow_stereo
* /svo/distortion_coefficients/cols: 5
* /svo/distortion_coefficients/data: [-0.395356, 0.132...
* /svo/distortion_coefficients/rows: 1
* /svo/distortion_model: plumb_bob
* /svo/grid_size: 30
* /svo/image_height: 480
* /svo/image_width: 640
* /svo/loba_num_iter: 0
* /svo/max_n_kfs: 10
* /svo/projection_matrix/cols: 4
* /svo/projection_matrix/data: [312.081909, 0, 2...
* /svo/projection_matrix/rows: 3
* /svo/rectification_matrix/cols: 3
* /svo/rectification_matrix/data: [1, 0, 0, 0, 1, 0...
* /svo/rectification_matrix/rows: 3
NODES
/
svo (svo_ros/vo)
core service [/rosout] found
process[svo-1]: started with pid [14234]
create vo_node
[ WARN] [1406362716.365539658]: Cannot find value for parameter: svo/publish_img_pyr_level, assigning default: 0
[ WARN] [1406362716.367242172]: Cannot find value for parameter: svo/publish_every_nth_img, assigning default: 1
[ WARN] [1406362716.368814410]: Cannot find value for parameter: svo/publish_every_nth_dense_input, assigning default: 1
[ WARN] [1406362716.372849123]: Cannot find value for parameter: svo/publish_world_in_cam_frame, assigning default: 1
[ WARN] [1406362716.374322519]: Cannot find value for parameter: svo/publish_map_every_frame, assigning default: 0
[ WARN] [1406362716.375674323]: Cannot find value for parameter: svo/publish_point_display_time, assigning default: 0
[ WARN] [1406362716.685035733]: Cannot find value for parameter: svo/publish_markers, assigning default: 1
[ WARN] [1406362716.685835016]: Cannot find value for parameter: svo/publish_dense_input, assigning default: 0
[ WARN] [1406362716.686585599]: Cannot find value for parameter: svo/accept_console_user_input, assigning default: 1
[ERROR] [1406362716.687362055]: Cannot find value for parameter: svo/cam_model
terminate called after throwing an instance of 'std::runtime_error'
what(): Camera model not correctly specified.
[svo-1] process has died [pid 14234, exit code -6, cmd /home/long/Workspaces/catkin/devel/lib/svo_ros/vo __name:=svo __log:=/home/long/.ros/log/5b375c1a-149d-11e4-8bc0-24f5aa6f5f4f/svo-1.log].
log file: /home/long/.ros/log/5b375c1a-149d-11e4-8bc0-24f5aa6f5f4f/svo-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done
This is my launchfile for usb_cam:
<launch>
<node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" >
<param name="index" value="0"/>
<param name="vendor" value="0x046d"/>
<param name="product" value="0x080c"/>
<param name="image_width" value="640" />
<param name="image_height" value="480" />
<param name="pixel_format" value="mjpeg" />
<param name="camera_frame_id" value="webcam" />
</node>
</launch>
And the launch file of svo_ros:
<launch>
<node pkg="svo_ros" type="vo" name="svo" clear_params="true" output="screen">
<!-- Camera topic to subscribe to -->
<param name="cam_topic" value="/usb_cam/image_raw" type="str" />
<!-- Camera calibration file -->
<rosparam file="$(find svo_ros)/param/cam.yaml" />
<!-- Default parameter settings: choose between vo_fast and vo_accurate -->
<rosparam file="$(find svo_ros)/param/vo_fast.yaml" />
</node>
</launch>
Any idea?
Asked by Long Hoang on 2014-07-26 04:16:08 UTC
Answers
It looks like your launch file isn't setting the svo/cam_model
parameter, which the svo node requires in order to run.
From looking at the current version of svo_ros, it looks like the camera calibration yaml files that they supply have changed names; they're now param/camera_atan.yaml
and param/camera_pinhole.yaml
, and the latest version of the launch file references param/camera_atan.yaml
: https://github.com/uzh-rpg/rpg_svo/blob/2eabd6d4b415635c45d6e91278cb9b1f06439da7/svo_ros/launch/live.launch
I'm a little surprised that the rosparam tag doesn't complain that it can't find the yaml file in question.
Asked by ahendrix on 2014-07-26 14:47:16 UTC
Comments
Thanks for your help! It wasn't the solution, but it gave me the right direction.
Indeed, there was something wrong with my .yaml calibration files. The thing is that the SVO library requires the calibration file in another format. To generate the calibration file, I used the cameracalibrator of the image_pipeline. Unfortunately, the library requires a calibration file in ATAN format. A tool to calibrate a monocular camera using this ATAN camera model, can be found below in the comments!
I hope, I can help other people who encounter the same problem!
Asked by Long Hoang on 2014-07-28 10:01:18 UTC
Comments
http://wiki.ros.org/ethzasl_ptam/Tutorials/camera_calibration
Asked by Long Hoang on 2014-07-28 10:01:40 UTC
Since you already have installed ethzasl_ptam... can you compute a atan-calibration file for me? here is a bag-file of a sequence over the chessboard with a logitech webcam... that would be great! https://drive.google.com/file/d/0B7PHxRc6ORg6OXVxc1MxUF9yTWc/view?usp=sharing
Asked by mister_kay on 2014-11-05 10:09:17 UTC
@mister_kay I used the original PTAM code, since ethzasl_ptam somehow have a GUI bug on my machine. You can find the PTAM code here: http://www.robots.ox.ac.uk/~gk/PTAM/
You still have to "convert" the result of the calibration, into a ros config file, that I can do for you if needed.
Asked by Long Hoang on 2014-11-29 22:52:51 UTC
Comments
image_pipeline: https://github.com/ros-perception/image_pipeline rpg_svo: https://github.com/uzh-rpg/rpg_svohttps://github.com/uzh-rpg/rpg_svo
Asked by Long Hoang on 2014-07-26 04:27:14 UTC
cam.yml is not present in https://github.com/uzh-rpg/rpg_svo/tree/master/svo_ros/param, change it to camera_atan.yaml or camera_pinhole.yaml
Asked by bvbdort on 2014-07-26 14:46:29 UTC