mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
global: use static method to construct RangeFinder
This commit is contained in:
parent
2e80b2e1d0
commit
9027a55696
@ -155,7 +155,7 @@ private:
|
|||||||
AP_Baro barometer = AP_Baro::create();
|
AP_Baro barometer = AP_Baro::create();
|
||||||
Compass compass = Compass::create();
|
Compass compass = Compass::create();
|
||||||
AP_InertialSensor ins = AP_InertialSensor::create();
|
AP_InertialSensor ins = AP_InertialSensor::create();
|
||||||
RangeFinder rangefinder { serial_manager, ROTATION_NONE };
|
RangeFinder rangefinder = RangeFinder::create(serial_manager, ROTATION_NONE);
|
||||||
AP_Button button;
|
AP_Button button;
|
||||||
|
|
||||||
// flight modes convenience array
|
// flight modes convenience array
|
||||||
|
@ -112,7 +112,7 @@ private:
|
|||||||
|
|
||||||
AP_InertialSensor ins = AP_InertialSensor::create();
|
AP_InertialSensor ins = AP_InertialSensor::create();
|
||||||
|
|
||||||
RangeFinder rng {serial_manager, ROTATION_NONE};
|
RangeFinder rng = RangeFinder::create(serial_manager, ROTATION_NONE);
|
||||||
|
|
||||||
// Inertial Navigation EKF
|
// Inertial Navigation EKF
|
||||||
#if AP_AHRS_NAVEKF_AVAILABLE
|
#if AP_AHRS_NAVEKF_AVAILABLE
|
||||||
|
@ -201,7 +201,7 @@ private:
|
|||||||
Compass compass = Compass::create();
|
Compass compass = Compass::create();
|
||||||
AP_InertialSensor ins = AP_InertialSensor::create();
|
AP_InertialSensor ins = AP_InertialSensor::create();
|
||||||
|
|
||||||
RangeFinder rangefinder {serial_manager, ROTATION_PITCH_270};
|
RangeFinder rangefinder = RangeFinder::create(serial_manager, ROTATION_PITCH_270);
|
||||||
struct {
|
struct {
|
||||||
bool enabled:1;
|
bool enabled:1;
|
||||||
bool alt_healthy:1; // true if we can trust the altitude from the rangefinder
|
bool alt_healthy:1; // true if we can trust the altitude from the rangefinder
|
||||||
|
@ -205,7 +205,7 @@ private:
|
|||||||
|
|
||||||
AP_InertialSensor ins = AP_InertialSensor::create();
|
AP_InertialSensor ins = AP_InertialSensor::create();
|
||||||
|
|
||||||
RangeFinder rangefinder {serial_manager, ROTATION_PITCH_270};
|
RangeFinder rangefinder = RangeFinder::create(serial_manager, ROTATION_PITCH_270);
|
||||||
|
|
||||||
AP_Vehicle::FixedWing::Rangefinder_State rangefinder_state;
|
AP_Vehicle::FixedWing::Rangefinder_State rangefinder_state;
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ private:
|
|||||||
Compass compass = Compass::create();
|
Compass compass = Compass::create();
|
||||||
AP_InertialSensor ins = AP_InertialSensor::create();
|
AP_InertialSensor ins = AP_InertialSensor::create();
|
||||||
|
|
||||||
RangeFinder rangefinder {serial_manager, ROTATION_PITCH_270};
|
RangeFinder rangefinder = RangeFinder::create(serial_manager, ROTATION_PITCH_270);
|
||||||
struct {
|
struct {
|
||||||
bool enabled:1;
|
bool enabled:1;
|
||||||
bool alt_healthy:1; // true if we can trust the altitude from the rangefinder
|
bool alt_healthy:1; // true if we can trust the altitude from the rangefinder
|
||||||
|
@ -63,7 +63,7 @@ public:
|
|||||||
AP_GPS gps = AP_GPS::create();
|
AP_GPS gps = AP_GPS::create();
|
||||||
Compass compass = Compass::create();
|
Compass compass = Compass::create();
|
||||||
AP_SerialManager serial_manager;
|
AP_SerialManager serial_manager;
|
||||||
RangeFinder rng {serial_manager, ROTATION_PITCH_270};
|
RangeFinder rng = RangeFinder::create(serial_manager, ROTATION_PITCH_270);
|
||||||
NavEKF2 EKF2{&ahrs, barometer, rng};
|
NavEKF2 EKF2{&ahrs, barometer, rng};
|
||||||
NavEKF3 EKF3{&ahrs, barometer, rng};
|
NavEKF3 EKF3{&ahrs, barometer, rng};
|
||||||
AP_AHRS_NavEKF ahrs {ins, barometer, gps, rng, EKF2, EKF3};
|
AP_AHRS_NavEKF ahrs {ins, barometer, gps, rng, EKF2, EKF3};
|
||||||
|
@ -23,7 +23,7 @@ AP_SerialManager serial_manager;
|
|||||||
|
|
||||||
class DummyVehicle {
|
class DummyVehicle {
|
||||||
public:
|
public:
|
||||||
RangeFinder sonar {serial_manager, ROTATION_PITCH_270};
|
RangeFinder sonar = RangeFinder::create(serial_manager, ROTATION_PITCH_270);
|
||||||
AP_AHRS_NavEKF ahrs{ins, barometer, gps, sonar, EKF2, EKF3,
|
AP_AHRS_NavEKF ahrs{ins, barometer, gps, sonar, EKF2, EKF3,
|
||||||
AP_AHRS_NavEKF::FLAG_ALWAYS_USE_EKF};
|
AP_AHRS_NavEKF::FLAG_ALWAYS_USE_EKF};
|
||||||
NavEKF2 EKF2{&ahrs, barometer, sonar};
|
NavEKF2 EKF2{&ahrs, barometer, sonar};
|
||||||
|
@ -26,7 +26,7 @@ public:
|
|||||||
Compass compass = Compass::create();
|
Compass compass = Compass::create();
|
||||||
AP_InertialSensor ins = AP_InertialSensor::create();
|
AP_InertialSensor ins = AP_InertialSensor::create();
|
||||||
AP_SerialManager serial_manager;
|
AP_SerialManager serial_manager;
|
||||||
RangeFinder sonar {serial_manager, ROTATION_PITCH_270};
|
RangeFinder sonar = RangeFinder::create(serial_manager, ROTATION_PITCH_270);
|
||||||
AP_AHRS_NavEKF ahrs{ins, barometer, gps, sonar, EKF2, EKF3,
|
AP_AHRS_NavEKF ahrs{ins, barometer, gps, sonar, EKF2, EKF3,
|
||||||
AP_AHRS_NavEKF::FLAG_ALWAYS_USE_EKF};
|
AP_AHRS_NavEKF::FLAG_ALWAYS_USE_EKF};
|
||||||
NavEKF2 EKF2{&ahrs, barometer, sonar};
|
NavEKF2 EKF2{&ahrs, barometer, sonar};
|
||||||
|
@ -11,7 +11,7 @@ void loop();
|
|||||||
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
|
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
|
||||||
|
|
||||||
static AP_SerialManager serial_manager;
|
static AP_SerialManager serial_manager;
|
||||||
static RangeFinder sonar {serial_manager, ROTATION_PITCH_270};
|
static RangeFinder sonar = RangeFinder::create(serial_manager, ROTATION_PITCH_270);
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user