how to get the state of visual dometry in program?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to get the state of visual dometry in program?

polarbear
Hi,
i want to code a program that could make robot walk backwards for a while when detect the visual dometry is lost.
Is there any ros service or other way could get the state of visual dometry?
Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: how to get the state of visual dometry in program?

matlabbe
Administrator
Hi,

visual odometry node would continue to publish the odometry message (if "publish_null_when_lost" is true, the default) with all 0 matrix when lost. You can detect it is not lost anymore if this matrix has non-zero values. Another way is to subscribe to odom_info topic, which will tell you if the odometry is lost or not, see lost member.

cheers,
Mathieu