Robotics StackExchange | Archived questions

Rtabmap gps/fix msg help

i've finally gotten my rtabmap to work but i want to add in my gps to get better results. i got a seperate gps modual and already setup the latitude longitude and altitude for the msg but i don't know what to do for the status, service, positioncovariance, and positioncovariance_type. im assuming the service is just how many satalites it's connected to but i can't find any information that tells me what each one is.

http://docs.ros.org/en/melodic/api/sensor_msgs/html/msg/NavSatFix.html

Asked by MisticFury on 2020-11-03 12:43:34 UTC

Comments

Answers

rtabmap uses only the following minimal parameters from the message:

  • stamp
  • longitude
  • latitude
  • altitude

If the position_covariance is not set, it will use a 10 meters error by default.

Reference https://github.com/introlab/rtabmap_ros/blob/f748a671841be68698e3b702619e594bf62d74b0/src/CoreWrapper.cpp#L2290-L2305:

double error = 10.0;
if(gpsFixMsg->position_covariance_type != sensor_msgs::NavSatFix::COVARIANCE_TYPE_UNKNOWN)
{
    double variance = uMax3(gpsFixMsg->position_covariance.at(0), gpsFixMsg->position_covariance.at(4), gpsFixMsg->position_covariance.at(8));
    if(variance>0.0)
    {
        error = sqrt(variance);
    }
}
gps_ = rtabmap::GPS(
        gpsFixMsg->header.stamp.toSec(),
        gpsFixMsg->longitude,
        gpsFixMsg->latitude,
        gpsFixMsg->altitude,
        error,
        0);

Asked by matlabbe on 2020-11-13 18:52:11 UTC

Comments