-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gazebo simulation: Used Gazebo GPS plugin #21187
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahcorde Thanks for already looking into these!
Are the mag issues present when just adding the GPS sensor? If this is the case, wondering if it is related to the WMM magnetic model or something related to the geolocation and mag consistency
PX4-Autopilot/src/modules/ekf2/ekf2_params.c
Lines 1468 to 1480 in a1efafc
/** | |
* Magnetic field strength test selection | |
* | |
* When set, the EKF checks the strength of the magnetic field | |
* to decide whether the magnetometer data is valid. | |
* If GPS data is received, the magnetic field is compared to a World | |
* Magnetic Model (WMM), otherwise an average value is used. | |
* This check is useful to reject occasional hard iron disturbance. | |
* | |
* @group EKF2 | |
* @boolean | |
*/ | |
PARAM_DEFINE_INT32(EKF2_MAG_CHECK, 1); |
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
I was trying to include both at the same time (gps and magnetometer) but it's not clear for me how to match the values: The magnetometer from Gazebo has magnetic field strength (in Tesla) along body-frame axis. I checked the |
Does this mean that in gazebo, when there is a spherical coordinate defined as geo coordinates, the magnetic field is not consistent with the geolocation of the world? If this is the case, would it be something desired to add this feature? This was how it was being done for gazebo classic: https://github.com/PX4/PX4-SITL_gazebo-classic/blob/ec8641d48753b20d431842f88e95557f22ec318a/src/gazebo_magnetometer_plugin.cpp#L184-L197 |
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Yep, this feature was not implemented in Gazebo, but here it is gazebosim/gz-sim#1907. I still have some issue with the NED -> ENU conversion. The velocity published in the navsat msg is in ENU, but the internal px4 message is in NED coordinates. may this affect the magnetometer too ? |
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
I would doubt that this makes a difference unless it happens during motion. Could you try disabling |
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
I tried in sim to fake a large mag field and I can arm without issues in alt mode if EKF2_MAG_CHECK is set to 0 or if COM_ARM_MAG_STR is set to 0. |
Added Gps sensor that allows to setup the GPS in Gazebo
I'm getting these errors. Any thoughts?
FYI @Jaeyoung-Lim @bperseghetti @dagar