rock-perception / perception-orogen-viso2

Orogen module for the libviso2
0 stars 0 forks source link

Error when running component #2

Closed Nurgak closed 7 years ago

Nurgak commented 7 years ago

I would like to use visual odometry to get the pose of my robot, but I keep getting the following error when I run the component:

[VISO2 CONFIGURATION] Q re-projection matrix:
        1        0        0 -523.915
       0        1        0  -377.36
       0        0        0  774.932
       0        0 -8.30356        0
[VISO2 CONFIGURATION] Left Frame Error matrix:
 0.06887       0
      0 0.08192
[VISO2 CONFIGURATION] Right Frame Error matrix:
 0.07723       0
      0 0.08236
Press Enter to exit
[VISO2 LEFT_FRAME] Frame arrived at: 20170112-11:30:27:454246
1.787 [ ERROR  ][OrbRunner] in updateHook(): switching to exception state because of unhandled exception
1.787 [ ERROR  ][OrbRunner]   [VISO2] [FATAL ERROR]: transformation for transformer not found.

The problem seems to be stemming from the following lines in StereoOdometer.cpp:

/** Get the transformation (transformation) Tbody_left_camera which is body = Tbody_left_camera left_camera **/
if (_body_frame.value().compare(_left_camera_frame.value()) == 0)
{
    tf.setIdentity();
}
else if (!_left_camera2body.get(ts, tf, false))
{
    throw std::runtime_error("[VISO2] [FATAL ERROR]: transformation for transformer not found.");
    return;
}

I have no idea on how to proceed as the error message is not very explicit, what is the actual issue here?

saarnold commented 7 years ago

This task is using the transformer to lookup static and dynamic transformations and align them with it's input streams. This page gives an introduction how to setup the transformer in a ruby script: http://rock-robotics.org/master/documentation/data_processing/transformer_runtime.html Note that you have to require "transformer/runtime" in your script.

jhidalgocarrio commented 7 years ago

You also need to configure the coordinate frames for the transformer. You have an example at: https://github.com/exoter-rover/bundles-exoter/blob/master/config/orogen/viso2::StereoOdometer.yml

In case you want to have the visual odometry output in the camera frame just set body_frame=left_camera

Nurgak commented 7 years ago

Thanks @jhidalgocarrio and @saarnold, now that body_frame=left_camera it already gives me an idea of the error I might expect during runtime, I'll look into how/where/why to declare the transformers.