mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-18 06:38:29 -04:00
Tracker: vehicle state made global
This commit is contained in:
parent
2155951e63
commit
0d1fefc23d
@ -222,6 +222,19 @@ static struct Location current_loc;
|
|||||||
// There are multiple states defined such as MANUAL, FBW-A, AUTO
|
// There are multiple states defined such as MANUAL, FBW-A, AUTO
|
||||||
static enum ControlMode control_mode = INITIALISING;
|
static enum ControlMode control_mode = INITIALISING;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Vehicle state
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
static struct {
|
||||||
|
bool location_valid; // true if we have a valid location for the vehicle
|
||||||
|
Location location; // lat, long in degrees * 10^7; alt in meters * 100
|
||||||
|
Location location_estimate; // lat, long in degrees * 10^7; alt in meters * 100
|
||||||
|
uint32_t last_update_us; // last position update in micxroseconds
|
||||||
|
uint32_t last_update_ms; // last position update in milliseconds
|
||||||
|
float heading; // last known direction vehicle is moving
|
||||||
|
float ground_speed; // vehicle's last known ground speed in m/s
|
||||||
|
} vehicle;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
scheduler table - all regular tasks apart from the fast_loop()
|
scheduler table - all regular tasks apart from the fast_loop()
|
||||||
should be listed here, along with how often they should be called
|
should be listed here, along with how often they should be called
|
||||||
|
@ -1,18 +1,5 @@
|
|||||||
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
/**
|
|
||||||
state of the vehicle we are tracking
|
|
||||||
*/
|
|
||||||
static struct {
|
|
||||||
bool location_valid; // true if we have a valid location for the vehicle
|
|
||||||
Location location; // lat, long in degrees * 10^7; alt in meters * 100
|
|
||||||
Location location_estimate; // lat, long in degrees * 10^7; alt in meters * 100
|
|
||||||
uint32_t last_update_us; // last position update in micxroseconds
|
|
||||||
uint32_t last_update_ms; // last position update in milliseconds
|
|
||||||
float heading; // last known direction vehicle is moving
|
|
||||||
float ground_speed; // vehicle's last known ground speed in m/s
|
|
||||||
} vehicle;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
update_vehicle_position_estimate - updates estimate of vehicle positions
|
update_vehicle_position_estimate - updates estimate of vehicle positions
|
||||||
should be called at 50hz
|
should be called at 50hz
|
||||||
|
Loading…
Reference in New Issue
Block a user