ensenso / ros_driver

Official ROS driver for Ensenso stereo cameras.
http://wiki.ros.org/ensenso_driver
BSD 3-Clause "New" or "Revised" License
28 stars 25 forks source link

Bug/tf timeout blocking #113

Open erblinium opened 1 year ago

erblinium commented 1 year ago

Quick "fix" to avoid tf timeout during handeye calibration.

When doing a capture_pattern command on the CalibrateHandEye service , the tf lookup transform function times out and results in service call failing.

The callstack is: StereoCamera::onCalibrateHandEye --> StereoCamera::estimatePatternPose --> Camera::updateGlobalLink
I get the following error messages:

[ensenso_handeye_xmlrpc_node-5] [INFO] [1686732076.871894797] [camera.ensenso_handeye_xmlrpc_node]: Resetting pattern buffer...
[ensenso_handeye_xmlrpc_node-5] [INFO] [1686732076.874443850] [camera.ensenso_handeye_xmlrpc_node]: Call to '0' successful
[ensenso_handeye_xmlrpc_node-5] [INFO] [1686732076.880268075] [camera.ensenso_handeye_xmlrpc_node]: Capturing pattern...
[ensenso_handeye_xmlrpc_node-5] [INFO] [1686732078.046433423] [camera.ensenso_handeye_xmlrpc_node]: Call to '1' successful
[ensenso_handeye_xmlrpc_node-5] [INFO] [1686732078.046672440] [camera.ensenso_handeye_xmlrpc_node]: Found pattern!
[ensenso_handeye_xmlrpc_node-5] [INFO] [1686732079.516476071] [camera.ensenso_handeye_xmlrpc_node]: Capturing pattern...
[ensenso_handeye_xmlrpc_node-5] [INFO] [1686732080.596147522] [camera.ensenso_handeye_xmlrpc_node]: Call to '1' successful
[ensenso_handeye_xmlrpc_node-5] [INFO] [1686732080.596724671] [camera.ensenso_handeye_xmlrpc_node]: Found pattern!
[ensenso_handeye_xmlrpc_node-5] [INFO] [1686732081.885760407] [camera.ensenso_handeye_xmlrpc_node]: Capturing pattern...
[ensenso_handeye_xmlrpc_node-5] [INFO] [1686732082.869542213] [camera.ensenso_handeye_xmlrpc_node]: Call to '1' successful
[ensenso_handeye_xmlrpc_node-5] [INFO] [1686732082.869762468] [camera.ensenso_handeye_xmlrpc_node]: Found pattern!
[ensenso_handeye_xmlrpc_node-5] [INFO] [1686732084.254807880] [camera.ensenso_handeye_xmlrpc_node]: Capturing pattern...
[ensenso_camera_node-4] [ERROR] [1686732095.246312746] [camera.ensenso_camera_node]: tf Exception: Lookup would require extrapolation into the past.  Requested time 1686732085.102207 but the earliest data is at time 1686732085.218332, when looking up transform from frame [camera] to frame [ur_actual_flange] on action: CalibrateHandEye
[ensenso_handeye_xmlrpc_node-5] [ERROR] [1686732095.247395643] [camera.ensenso_handeye_xmlrpc_node]: Call to '1' failed with code: 101 and message: Lookup would require extrapolation into the past.  Requested time 1686732085.102207 but the earliest data is at time 1686732085.218332, when looking up transform from frame [camera] to frame [ur_actual_flange]
[ensenso_handeye_xmlrpc_node-5] [ERROR] [1686732095.247670405] [camera.ensenso_handeye_xmlrpc_node]: Could not find pattern!
[ensenso_handeye_xmlrpc_node-5] [INFO] [1686732096.386568663] [camera.ensenso_handeye_xmlrpc_node]: Capturing pattern...
benthie commented 10 months ago

Hi @erblinium,

looking at the tf exception "Lookup would require extrapolation into the past", I guess that something might be wrong with your published frames/transformations. According to this link, the error occurs when tf has no data yet.

One of the two frames "camera" or "ur_actual_flange" are not known by tf yet.

Since you are performing a hand-eye-calibration I guess your camera has a link (maybe to "ur_actual_flange"). Did you make sure that you published all the contributing transformations before the calibration was started?

For more information on the Ensenso camera frames you can have a look at our ROS Wiki. There you can also find a tutorial on how to perform a hand-eye-calibration.

Kind regards Benny

benthie commented 10 months ago

If this might indeed be a bug in our code, please feel free to adapt our hand-eye-calibration test such that it reproduces the bug.