mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 10:26:52 +08:00
add iris_dual_gps config and the possibility of testing GPS blending through simulation
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# @name 3DR Iris Quadrotor SITL (Dual GPS)
|
||||||
|
#
|
||||||
|
# @type Quadrotor Wide
|
||||||
|
#
|
||||||
|
|
||||||
|
sh /etc/init.d-posix/10016_iris
|
||||||
|
|
||||||
|
if [ $AUTOCNF = yes ]
|
||||||
|
then
|
||||||
|
# EKF2: Multi GPS blending
|
||||||
|
param set EKF2_GPS_MASK 7 # Uses speed, hpos and vpos accuracy
|
||||||
|
fi
|
||||||
+1
-1
Submodule Tools/sitl_gazebo updated: e2bf962b5e...97106007eb
@@ -76,7 +76,7 @@ ExternalProject_Add(flightgear_bridge
|
|||||||
set(viewers none jmavsim gazebo)
|
set(viewers none jmavsim gazebo)
|
||||||
set(debuggers none ide gdb lldb ddd valgrind callgrind)
|
set(debuggers none ide gdb lldb ddd valgrind callgrind)
|
||||||
set(models none shell
|
set(models none shell
|
||||||
if750a iris iris_opt_flow iris_opt_flow_mockup iris_vision iris_rplidar iris_irlock iris_obs_avoid iris_rtps px4vision solo typhoon_h480
|
if750a iris iris_dual_gps iris_opt_flow iris_opt_flow_mockup iris_vision iris_rplidar iris_irlock iris_obs_avoid iris_rtps px4vision solo typhoon_h480
|
||||||
plane plane_cam plane_catapult plane_lidar
|
plane plane_cam plane_catapult plane_lidar
|
||||||
standard_vtol tailsitter tiltrotor
|
standard_vtol tailsitter tiltrotor
|
||||||
rover r1_rover boat
|
rover r1_rover boat
|
||||||
|
|||||||
@@ -248,7 +248,8 @@ private:
|
|||||||
uORB::Publication<input_rc_s> _input_rc_pub{ORB_ID(input_rc)};
|
uORB::Publication<input_rc_s> _input_rc_pub{ORB_ID(input_rc)};
|
||||||
|
|
||||||
// HIL GPS
|
// HIL GPS
|
||||||
uORB::Publication<vehicle_gps_position_s> _vehicle_gps_position_pub{ORB_ID(vehicle_gps_position)};
|
uORB::PublicationMulti<vehicle_gps_position_s> *_vehicle_gps_position_pubs[ORB_MULTI_MAX_INSTANCES] {};
|
||||||
|
uint8_t _gps_ids[ORB_MULTI_MAX_INSTANCES] {};
|
||||||
std::default_random_engine _gen{};
|
std::default_random_engine _gen{};
|
||||||
|
|
||||||
// uORB subscription handlers
|
// uORB subscription handlers
|
||||||
|
|||||||
@@ -309,7 +309,21 @@ void Simulator::handle_message_hil_gps(const mavlink_message_t *msg)
|
|||||||
gps.satellites_used = hil_gps.satellites_visible;
|
gps.satellites_used = hil_gps.satellites_visible;
|
||||||
gps.s_variance_m_s = 0.25f;
|
gps.s_variance_m_s = 0.25f;
|
||||||
|
|
||||||
_vehicle_gps_position_pub.publish(gps);
|
// New publishers will be created based on the HIL_GPS ID's being different or not
|
||||||
|
for (size_t i = 0; i < sizeof(_gps_ids) / sizeof(_gps_ids[0]); i++) {
|
||||||
|
if (_vehicle_gps_position_pubs[i] && _gps_ids[i] == hil_gps.id) {
|
||||||
|
_vehicle_gps_position_pubs[i]->publish(gps);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_vehicle_gps_position_pubs[i] == nullptr) {
|
||||||
|
_vehicle_gps_position_pubs[i] = new uORB::PublicationMulti<vehicle_gps_position_s> {ORB_ID(vehicle_gps_position)};
|
||||||
|
_gps_ids[i] = hil_gps.id;
|
||||||
|
_vehicle_gps_position_pubs[i]->publish(gps);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user