I am using rtabmap to estimate odometry from visual slam. When odometry is lost, the rtabmapviz screen becomes red. I am looking for one way to know when I lose odometry in my code e.g. a topic to subscribe or something like that.
Thanks for your help
(edit)
I am using ROS kinetic and the following launch files:
roslaunch freenect_launch freenect.launch depth_registration:=true
roslaunch rtabmap_ros rtabmap.launch localization:=true rtabmapviz:=false rviz:=true
Based on your question, I assume you're using the rtabmap_ros pkg, specifically one of the Visual Camera/Lidar Odometry nodes. They all publish the topic
odom(nav_msgs/Odometry)and the topicodom_info(rtabmap_ros/OdomInfo). In thertabmap_ros/OdomInfomsg, is the elementbool lost, which reports if the current odometry is lost or not. Also, the null transform is published on the topicodominstead of the (lost) odometry (by default, param option).