mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-18 04:10:35 +08:00
dronecan: gps add noise, jamming, and spoofing data
This commit is contained in:
@@ -127,6 +127,11 @@ public:
|
||||
ecefpositionvelocity.velocity_xyz[1] = NAN;
|
||||
ecefpositionvelocity.velocity_xyz[2] = NAN;
|
||||
|
||||
// Use ecef_position_velocity for now... There are no fields for these
|
||||
ecefpositionvelocity.position_xyz_mm[0] = gps.noise_per_ms;
|
||||
ecefpositionvelocity.position_xyz_mm[1] = gps.jamming_indicator;
|
||||
ecefpositionvelocity.position_xyz_mm[2] = (gps.jamming_state << 8) | gps.spoofing_state;
|
||||
|
||||
// Use ecef_position_velocity for now... There is no heading field
|
||||
if (!std::isnan(gps.heading)) {
|
||||
ecefpositionvelocity.velocity_xyz[0] = gps.heading;
|
||||
@@ -138,10 +143,10 @@ public:
|
||||
if (!std::isnan(gps.heading_accuracy)) {
|
||||
ecefpositionvelocity.velocity_xyz[2] = gps.heading_accuracy;
|
||||
}
|
||||
|
||||
fix2.ecef_position_velocity.push_back(ecefpositionvelocity);
|
||||
}
|
||||
|
||||
fix2.ecef_position_velocity.push_back(ecefpositionvelocity);
|
||||
|
||||
uavcan::Publisher<uavcan::equipment::gnss::Fix2>::broadcast(fix2);
|
||||
|
||||
// ensure callback is registered
|
||||
|
||||
Reference in New Issue
Block a user