Logging VEHICLE_GLOBAL_POSITON

I’m trying to log VEHICLE_GLOBAL_POSITION message from the exf2 module but seem to be having issues.

  1. The message is only published when after this check. _ekf.global_position_is_valid() What is the purpose of this check.

I then started the position_estimator_inav and started to get the message and came across this issue.

  1. The message output of long was only displaying 0.01 os precision which is about 1000m.

All I’m trying to do is log the vehicle position in global space (gps coordinants and altitude) to see how accurate it is. I preferred a fused solution rather than the raw gps from VEHICLE_GPS_POSITION

What is the best way to log this type of data?

If you’re using sdlog2, then it’s logged as GPOS. If you’re using the new logger it directly logs uorb messages (vehicle_global_position).

Why would you want ekf2 to publish a position it doesn’t think is valid?

I don’t want to publish an invalid position. I was just wondering when/how does it become valid. I prefer to shutdown position_estimator_inav and just use ekf2 for the VEHICLE_GLOBAL_POSITION message because I read in another post that it may not be as accurate. However I don’t know how to get ekf2 to publish it b/c of the _ekf.global_position_is_valid() flag.

Also ideas on why the gps data in message VEHICLE_GLOBAL_POSITION only has 0.01 of precision?

Hello, I’m trying to get the vehicles current position, to pass as a parameter to a C++ program I’m trying to write. I was redirected to this thread, but I do not understand the usage of the Vheicle_Global_Position any pointers as to where I can learn how to use it?

The default estimator is ekf2 so as long as you don’t change that everything should be automatic. Once the ekf2 solution is valid the urob messaging will reflect this. Just subscribe to the vehicle_global_position message and you’ll get the data you need.