0
$\begingroup$

Rosanswers logo

PLEASE SKIP TO THE UPDATE AT THE END OF THIS QUESTION

I would like to post an image of my problem, but my karma is not above 20 :( So here goes...

Background info and details (hopefully detailed enough)

ROS Electric, Ubuntu 11.04

I am attempting to run the camera_pose_calibration on two cameras:

camera1 is a Kinect (using /camera/rgb namespace); camera2 is a flir thermal camera (note: the drive is custom for this camera) that is 336x256 pixels (image has been thresholded so appears binary - only 0's and 255's). The images generated by the flir driver are initially compressed png's, but I republish them in my launch file with the following line so they can be used by image_proc:

node name="republish" type="republish" pkg="image_transport" output="screen" args="compressed in:=/flir_camera/image_enhanced raw out:=/flir_camera/image_raw"

The flir camera topic (image_rect) is generated from the command line with image_proc:
$ ROS_NAMESPACE=flir_camera rosrun image_proc image_proc

The camera topics, /camera_info and /image_rect, for both the Kinect and the flir have the correct data being published, and seem to be publishing at acceptable rates:


Kinect publishing rates:

$ rostopic hz /camera/rgb/features

subscribed to [/camera/rgb/features]

average rate: 15.018 min: 0.039s max: 0.115s std dev: 0.01742s window: 14

average rate: 14.942 min: 0.037s max: 0.115s std dev: 0.01621s window: 29

average rate: 15.005 min: 0.036s max: 0.115s std dev: 0.01560s window: 44

$ rostopic hz /camera/rgb/image_rect

subscribed to [/camera/rgb/image_rect]

average rate: 30.097 min: 0.030s max: 0.038s std dev: 0.00193s window: 29

average rate: 30.040 min: 0.025s max: 0.039s std dev: 0.00239s window: 59

average rate: 30.027 min: 0.025s max: 0.039s std dev: 0.00239s window: 89

$ rostopic hz /camera/rgb/camera_info

subscribed to [/camera/rgb/camera_info]

average rate: 30.082 min: 0.029s max: 0.039s std dev: 0.00210s window: 30

average rate: 30.036 min: 0.029s max: 0.039s std dev: 0.00200s window: 60

average rate: 30.021 min: 0.029s max: 0.039s std dev: 0.00198s window: 90


Flir camera publishing rates:

$ rostopic hz /flir_camera/features

subscribed to [/flir_camera/features]

average rate: 17.292 min: 0.049s max: 0.069s std dev: 0.00800s window: 16

average rate: 16.457 min: 0.043s max: 0.085s std dev: 0.01044s window: 32

average rate: 16.381 min: 0.043s max: 0.085s std dev: 0.01033s window: 48

average rate: 16.312 min: 0.043s max: 0.085s std dev: 0.01034s window: 53

$ rostopic hz /flir_camera/image_rect

subscribed to [/flir_camera/image_rect]

average rate: 46.717 min: 0.013s max: 0.051s std dev: 0.00737s window: 47

average rate: 48.287 min: 0.013s max: 0.051s std dev: 0.00680s window: 96

average rate: 48.920 min: 0.013s max: 0.051s std dev: 0.00671s window: 147

$ rostopic hz /fliramera/camera_info

subscribed to [/flir_camera/camera_info]

average rate: 50.631 min: 0.013s max: 0.034s std dev: 0.00635s window: 50

average rate: 53.308 min: 0.013s max: 0.034s std dev: 0.00546s window: 106

average rate: 54.895 min: 0.013s max: 0.034s std dev: 0.00482s window: 164


camera_pose_calibration terminal details when run:

$ roslaunch camera_pose_calibration calibrate_2_camera.launch camera1_ns:=/camera/rgb/ camera2_ns:=/flir_camera/ checker_rows:=4 checker_cols:=5 checker_size:=0.03175 ... logging to /home/*****/.ros/log/cbcdeb40-8544-11e2-83ce-f0def1b664aa/roslaunch-W520-Ubuntu-10-10-20010.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://*****:53230/

SUMMARY

PARAMETERS

  • /rosversion
  • /filter_intervals/min_duration
  • /rosdistro
  • /capture_exec/cam_info_topic

NODES /camera/rgb/ image_throttle (topic_tools/throttle) stereo_cb_detector (image_cb_detector/image_cb_detector_action_old) start_cb_detector_action_old (camera_pose_calibration/start_cb_detector_action_old.py) monocam_settler (monocam_settler/monocam_settler_action) start_monocam_settler_action (camera_pose_calibration/start_monocam_settler_action.py) /flir_camera/ image_throttle (topic_tools/throttle) stereo_cb_detector (image_cb_detector/image_cb_detector_action_old) start_cb_detector_action_old (camera_pose_calibration/start_cb_detector_action_old.py) monocam_settler (monocam_settler/monocam_settler_action) start_monocam_settler_action (camera_pose_calibration/start_monocam_settler_action.py) / interval_intersection (interval_intersection/interval_intersection_action) start_interval_intersection (camera_pose_calibration/start_interval_intersection.py) filter_intervals (camera_pose_calibration/filter_intervals.py) capture_exec (camera_pose_calibration/multicam_capture_exec.py) cal_optimizer (camera_pose_calibration/run_optimization_online.py) capture_monitor (camera_pose_calibration/capture_monitor.py) aggregated_image_viewer (image_view/image_view)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found process[camera/rgb/image_throttle-1]: started with pid [20029] process[camera/rgb/stereo_cb_detector-2]: started with pid [20038] process[camera/rgb/start_cb_detector_action_old-3]: started with pid [20046] process[camera/rgb/monocam_settler-4]: started with pid [20048] process[camera/rgb/start_monocam_settler_action-5]: started with pid [20059] process[flir_camera/image_throttle-6]: started with pid [20086] process[flir_camera/stereo_cb_detector-7]: started with pid [20088] process[flir_camera/start_cb_detector_action_old-8]: started with pid [20105] process[flir_camera/monocam_settler-9]: started with pid [20131] process[flir_camera/start_monocam_settler_action-10]: started with pid [20143] process[interval_intersection-11]: started with pid [20161] process[start_interval_intersection-12]: started with pid [20187] process[filter_intervals-13]: started with pid [20189] process[capture_exec-14]: started with pid [20206] process[cal_optimizer-15]: started with pid [20213] process[capture_monitor-16]: started with pid [20222] process[aggregated_image_viewer-17]: started with pid [20234] Configuring checkerboard size 4x5, checker size 0.03175 Waiting for Server Configuring checkerboard size 4x5, checker size 0.03175 Waiting for Server Waiting for Server Creating aggregator for ['/camera/rgb/', '/flir_camera/'] /opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py:399: UserWarning: '/camera/rgb//camera_info' is not a legal ROS graph resource name. This may cause problems with other ROS tools super(Subscriber, self).init(name, data_class, Registration.SUB) /opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py:399: UserWarning: '/camera/rgb//image_throttle' is not a legal ROS graph resource name. This may cause problems with other ROS tools super(Subscriber, self).init(name, data_class, Registration.SUB) /opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py:399: UserWarning: '/camera/rgb//settled_interval' is not a legal ROS graph resource name. This may cause problems with other ROS tools super(Subscriber, self).init(name, data_class, Registration.SUB) /opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py:399: UserWarning: '/camera/rgb//features' is not a legal ROS graph resource name. This may cause problems with other ROS tools super(Subscriber, self).init(name, data_class, Registration.SUB) /opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py:399: UserWarning: '/flir_camera//camera_info' is not a legal ROS graph resource name. This may cause problems with other ROS tools super(Subscriber, self).init(name, data_class, Registration.SUB) /opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py:399: UserWarning: '/flir_camera//image_throttle' is not a legal ROS graph resource name. This may cause problems with other ROS tools super(Subscriber, self).init(name, data_class, Registration.SUB) /opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py:399: UserWarning: '/camera/rgb//features' is not a legal ROS graph resource name. This may cause problems with other ROS tools super(Subscriber, self).init(name, data_class, Registration.SUB) /opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py:399: UserWarning: '/flir_camera//settled_interval' is not a legal ROS graph resource name. This may cause problems with other ROS tools super(Subscriber, self).init(name, data_class, Registration.SUB) /opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py:399: UserWarning: '/camera/rgb//camera_info' is not a legal ROS graph resource name. This may cause problems with other ROS tools super(Subscriber, self).init(name, data_class, Registration.SUB) /opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py:399: UserWarning: '/flir_camera//features' is not a legal ROS graph resource name. This may cause problems with other ROS tools super(Subscriber, self).init(name, data_class, Registration.SUB) /opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py:399: UserWarning: '/flir_camera//features' is not a legal ROS graph resource name. This may cause problems with other ROS tools super(Subscriber, self).init(name, data_class, Registration.SUB) /opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py:399: UserWarning: '/flir_camera//camera_info' is not a legal ROS graph resource name. This may cause problems with other ROS tools super(Subscriber, self).init(name, data_class, Registration.SUB) [INFO] [WallTime: 1362454151.383569] Reset calibration state 0 previous measurements in the cache are deleted.

Found Server

Found Server

Found Server

^C[aggregated_image_viewer-17] killing on exit [capture_monitor-16] killing on exit [cal_optimizer-15] killing on exit [filter_intervals-13] killing on exit [capture_exec-14] killing on exit [start_interval_intersection-12] killing on exit [flir_camera/start_monocam_settler_action-10] killing on exit [flir_camera/monocam_settler-9] killing on exit [interval_intersection-11] killing on exit [flir_camera/start_cb_detector_action_old-8] killing on exit Done sending goal Exception in thread /interval (most likely raised during interpreter shutdown):[flir_camera/stereo_cb_detector-7] killing on exit [flir_camera/image_throttle-6] killing on exit [camera/rgb/start_monocam_settler_action-5] killing on exit [camera/rgb/monocam_settler-4] killing on exit [camera/rgb/stereo_cb_detector-2] killing on exit [camera/rgb/start_cb_detector_action_old-3] killing on exit [camera/rgb/image_throttle-1] killing on exit Done sending goal Done sending goal shutting down processing monitor... ... shutting down processing monitor complete

done

End background and details**********

Now for the problem:

Both images appear in the aggregated_image viewer, with green circles highlighting the intersections of the checkerboard patterns in both images. Checkerboard calibration target and both cameras are absolutely static. The Kinect image progress bar is solid green and the flir camera shows no progress (red outline). Camera_pose_calibration just sits there and never completes. I have successfully run the camera_pose_calibration on another machine (ROS Electric Ubuntu 11.04) between two Kinects, so I know what the outcome should be, and I am not seeing it here. The issue is solely with the flir camera image as the Kinect image appears to be properly processed by camera_pose_calibration.

Any assistance is greatly appreciated. Please feel free to ask for any additional details which will help troubleshoot this issue.

Thank you.


Update:

After some more investigation, I believe that the issue one of a missing /tf from my flir camera messages. Since the /flir_camera driver is custom, I'm trying to work out how to add the appropriate tf message. Here is a snippet of the code where I am setting up to publish the /flir_camera/camera_info topic:

ros::Publisher camera_info = nh.advertise<sensor_msgs::CameraInfo>("/flir_camera/camera_info", 1);
CameraInfoManager cinfo(nh);
string url("/home/***/.ros/camera_info/camera.yaml");
cinfo.loadCameraInfo(url);
sensor_msgs::CameraInfo camera_info_msg(cinfo.getCameraInfo());
camera_info_msg.header.frame_id = "/flir_camera_frame";

This is where I am stuck. Can I just add a static_tf_publisher to my launch file and link it to the kinect /camera_link frame, like this:

node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="1 0 0 0 0 0 camera_link flir_camera_frame 100"

Or, do I need to add some code to the driver that adds an appropriate tf message for the flir camera? If I need to add the tf in the code, an example of how to do that would be greatly appreciated.

Thank you again.


Final update (5 March 2013)

The primary issue was a missing time stamp from the header of the flir_camera image. Once that was set correctly, and synced with the camera_info message, then the image_proc node had no problems generating the correct transport image.


Originally posted by mblanton on ROS Answers with karma: 118 on 2013-03-04

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="1 0 0 0 0 0 camera_link flir_camera_frame 100"

I think this should read something like this

node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="x y z r p y world flir_camera_frame 10"

What you need (apparently) is the transform from the world to the camera frame that depicts the camera position and orientation.

Most probably it will not be the same as the kinect (they are not coaxial, are they?) so you'll need a specific publisher just like above.

In this and future cases, when you think you have a tf problem, run the following command

$ rosrun tf view_frames ; evince frames.pdf

this will listen to all the published transforms for 5 seconds, and produce a pdf with all the links depicted graphically.

On a side note: I noticed that in my case sometimes it takes a number of executions before all the transformations are piked up correctly. Meaning that after just one run it may appear you have unconnected links, while in reality the tfs are there.

Anyway what you should have is a tree: one origin (the world) and everything else connected to it.

Also to check tfs in realtime you can run

$ rosrun tf tf_monitor

Originally posted by Claudio with karma: 859 on 2013-03-05

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by mblanton on 2013-03-05:
Thank you for the reply, I will update the tf static publisher to correctly reflect the position of the camera. I was able to get the camera_pose_calibration to process the flir_camera image. It was an issue with the time stamps.

$\endgroup$
0
$\begingroup$

Rosanswers logo

The primary issue was a missing time stamp from the header of the flir_camera image (it was always 0). Once that was set correctly, and synced with the camera_info message, then the camera_pose_calibration had no problems.


Originally posted by mblanton with karma: 118 on 2013-03-05

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.