Closed ecmnet closed 1 year ago
This is probably sufficient for initial testing, but ultimately I think we should also handle getting valid GPS after it's been set manually.
It appears that the only change required to achieve the stated objective of this PR are the two lines in ekf_helper.cpp. Can you please remove other fixes not required for the publishing of global position and submit them separately
Any progress on making the changes to get this merged? Would very much appreciate this feature for indoor positioning
ECL has been absorbed into PX4-Autopilot, can you recreate this PR over there?
https://github.com/PX4/PX4-Autopilot/tree/master/src/lib/ecl
I just did a short test with V1.12.0 - it still works fine. Will create a new PR.
We need to be careful that there are not consumers of the global position message that interpret availability of the global position message as indicating validity.
The https://github.com/PX4/PX4-Autopilot/blob/master/msg/vehicle_global_position.msg message has no validity flag for LLH so consumers will assume valid for controller use if present.
TODO: check how dead_reckoning flag is being used.
Sending a set_gps_global_origin message to EKF2 via MAVLINK sets the NED origin as reported by EKF2 but does not switch to publish global position. This would be helpful in use cases where no GPS is available but LPOS is provided by other means. Reason for this is, that the flag _NED_origin_initialised is not set to true inEkf::setEkfGlobalOrigin.
Doing so in elf_helper.cpp would work as long as the parameter EKF2_DECL_TYPE is set to 0. Otherwise an invalid look up of the magnetic declination results an invalid EKF2_MAG_DECL value.