The localization is a combination of odometry pose ("/odom -> /base_link") and odometry correction ("/map -> /odom"). The odometry correction is saved in
Rtabmap::_mapCorrection member. "_mapCorrection" is updated when a loop closure happens. See Section 3.4 in this
paper.
_mapCorrection is updated
here in the code. "_optimizedPoses.at(signature->id())" should contain the current pose of the robot in map frame (/map -> /base_link) and "signature->getPose()" should contain the current pose of the robot in odometry frame (/odom -> /base_link). We multiply the first transform to inverse of the second to get /map -> /odom.
In ROS, to know the pose of the robot in the map, subscribe to TF and get /map -> /base_link.
cheers,
Mathieu