Skip to content

Add UAVCAN IMU support #118

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

Open
wants to merge 155 commits into
base: mttr-rebase-4.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
873e091
build: switched to MttrCubeBlack for travis testing
jschall Jun 20, 2016
5dba242
AC_PrecLand: add send_landing_target
jschall Jun 24, 2016
b9af39a
AC_PrecLand: add acceleration bias learning
jschall Jul 27, 2017
fa921a0
AC_PrecLand: account for vertical offset of camera when computing depth
jschall Nov 1, 2017
a564413
AC_PrecLand: add get_height_above_target_cm
jschall Feb 2, 2018
9a95350
AC_PrecLand: add initialization period
jschall Jun 7, 2018
10154c8
AC_PrecLand: fix bug in target acquired logic
jschall Sep 27, 2018
e69863c
AC_PrecLand: remove check that prevents rejection of more than 3 outl…
jschall Sep 27, 2018
86ad55d
AC_PrecLand: add smoothing to output predictor
jschall Sep 27, 2018
93ba3ce
AC_PrecLand: increase pixycam measurement variance to 20 mrad
jschall Oct 30, 2018
652223f
AC_PrecLand: log raw los measurement
jschall Nov 14, 2018
6437575
AC_PrecLand: rebase fixes
tridge Mar 8, 2019
e74ab22
AC_PrecLand: added distance to target in SITL backend
tridge Apr 4, 2019
dc46bfd
AC_PrecLand: added debug for PL in SITL
tridge Apr 4, 2019
d227e44
AC_PrecLand: use internal quaternion for SITL precland
tridge Apr 4, 2019
881dab1
AC_PrecLand: rebase fixes
tridge Feb 17, 2020
1657406
AP_Motors: simplify current limiting feature
jschall Mar 1, 2017
ae27d69
AP_Motors: add frame type MATTERNET_M2
jschall Apr 14, 2017
5152145
AP_Motors: add power limiting option
jschall Jun 1, 2017
04c5ee3
AP_RangeFinder: add retries to MaxsonarI2CXL init
jschall Jul 19, 2017
67f8119
AP_RangeFinder: check if a configured rangefinder is not giving data
tridge Feb 17, 2020
7264976
AP_GPS: Fixed issue: gps2 not logging data when unplugged
Aksellence Feb 15, 2019
ec0ba01
AP_GPS: Changed the switch logic: switch only if the other GPS has 4
Aksellence Feb 21, 2019
f3b61be
AP_GPS: add tracking of position change since arming
tridge May 4, 2019
3eb981e
AP_GPS: Added hardware_version method
Aksellence Jul 18, 2019
d70a3d7
AP_GPS: Prefer u-blox F9P
Aksellence Jul 19, 2019
8c8afb2
AP_GPS: prefer UAVCAN status 3 over M8 status 4
tridge Oct 24, 2019
cd07418
AP_GPS: added zero yaw value for new mavlink GPS msgs
tridge Feb 17, 2020
73d7544
AP_UAVCAN: removed ArduPilot TrafficReport DSDL
tridge Feb 15, 2020
21f8244
AP_UAVCAN: added Matternet TrafficReport message
tridge Oct 2, 2019
6dd6f16
AP_UAVCAN: added DSDL for GNSS Inject message
tridge Oct 21, 2019
ec2a52d
AP_UAVCAN: change to MatterNet TrafficReport namespace
tridge Feb 17, 2020
29802ce
GCS_MAVLink: add MSG_LANDING_TARGET to enum
jschall Jun 24, 2016
f886fc6
AP_Logger: re-write system IDs and params when disarming
tridge Oct 2, 2019
3525a22
AC_PosControl: change hard-coded tuning values
jschall Jul 20, 2016
598464e
AP_SerialManager: add Matternet_FTS protocol
jschall Nov 11, 2016
8745921
AP_Parachute: add TRIGGER_TYPE_MATTERNET_FTS
jschall Nov 14, 2016
4c4d662
AC_PosControl: add get_vel_error_z
jschall Feb 2, 2017
ab848b0
AC_WPNav: fix sudden jump in throttle when switching from modes with …
jschall Apr 18, 2017
bcee86d
GCS_MAVLink: provide matternet FTS version alongside autopilot versio…
jschall May 4, 2017
3f29e2b
GCS_MAVLink: FTS message rebase fixes
tridge Mar 8, 2019
9bc683d
AP_Arming: added arming check type FTS
tridge Mar 8, 2019
342ed71
GCS_MAVLink: break out MTTR_FTS_VER string send
tridge Jul 3, 2019
8bd834f
SITL: added SIM_PLAND_OFS vector
tridge Apr 3, 2019
f1f7282
SITL: support FlightAxis for PrecLand
tridge Apr 4, 2019
9c4a24f
SITL: added SIM_GPS_DRIFT_S parameter
tridge Apr 18, 2019
7e57925
HAL_SITL: use SIM_GPS_DRIFT_S
tridge Apr 18, 2019
d0b04ae
Tools: add a useful SITL test script
tridge Apr 19, 2019
0a854d4
AP_Arming: allow for disabling RC arming checks on some modes
tridge May 7, 2019
adb98a2
Tools: updated runcoptertest.py
tridge Jun 7, 2019
415894f
Tools: added bootloader for MttrCubeBlack
tridge Jul 2, 2019
f9b13bb
Tools: update MttrCubeBlack bootloader to not listen on any port but …
tridge Aug 7, 2019
fb8a34d
AP_Mission: added MIS_FLIGHT_ID
tridge Dec 6, 2019
015aab4
mavlink: added MAV_SYS_STATUS_PREARM_CHECK
tridge Feb 15, 2020
a859f83
GCS_MAVLink: fixes for updated mavlink xml
tridge Feb 18, 2020
4d737d7
AP_AHRS: fixed getCorrectedDeltaVelocityNED() for SITL AHRS
tridge Apr 4, 2019
e6c1e50
AC_AttitudeControl: make get_tilt_limit_rad public
jschall Feb 2, 2017
5e1a188
AC_AttitudeControl: constrain tilt limit to not exceed ANGLE_MAX
jschall May 26, 2017
a1e438a
AC_AttitudeControl: fix to backported patches
jschall Nov 14, 2018
8534603
AP_Notify: change compass calibration tone
jschall Jun 1, 2017
a63c06a
AP_Notify: don't play any tones while armed
jschall Mar 22, 2018
ad12d26
AP_Notify: updated buzzer tones to match previous master-0.4
tridge May 7, 2019
3b2ebd5
AP_BattMonitor: prevent voltage failsafe from triggering on extremely…
jschall Aug 2, 2016
15e879e
AP_BattMonitor: added LandIfManual battery failsafe option
tridge Jul 21, 2019
14ae361
AP_BattMonitor: added battery monitor backend based on SoC table
tridge Sep 26, 2019
69c4b54
AP_NavEKF2: change priority of statustext messages
jschall Jul 28, 2016
99a3f6d
AP_NavEKF2: increase baro floor limit to 8
jschall Feb 9, 2017
1c47d83
AP_NavEKF2: use max of all lanes for EKF_STATUS_REPORT
tridge Jul 29, 2019
124c50a
AP_NavEKF3: use max of all lanes for EKF_STATUS_REPORT
tridge Jul 29, 2019
7e3097e
AP_NavEKF2: added EK2_MAG_LRN_LIM
tridge Aug 14, 2019
f3191a2
HAL_ChibiOS: added MttrCubeBlack build
tridge Jun 20, 2019
85c3fcb
HAL_ChibiOS: disable transmitter ESC cal in MttrCubeBlack
tridge Aug 19, 2019
b7d0207
HAL_ChibiOS: enable new table based battery SoC system
tridge Sep 26, 2019
212b5bf
HAL_ChibiOS: default LOG_FILE_DSRMROT=1 for MatterNet
tridge Oct 2, 2019
e985649
HAL_ChibiOS: enable logging of ADSB vehicles
tridge Oct 3, 2019
59d5eed
HAL_ChibiOS: adjust defaults for CAN2
tridge Oct 3, 2019
7895387
HAL_ChibiOS: fixed default for COMPASS_TYPEMASK
tridge Oct 3, 2019
703ee03
HAL_ChibiOS: raise ARMING_DELAY_SEC on MttrCubeBlack
tridge Feb 18, 2020
abd6010
HAL_ChibiOS: log for 60s after disarm for MttrCubeBlack
tridge Feb 18, 2020
b02c4f1
Copter: disable surface tracking
jschall Aug 1, 2016
99a36f6
Copter: send LANDING_TARGET message
jschall Jun 24, 2016
730945f
Copter: call parachute.init
jschall Nov 17, 2016
8cb3439
Copter: eliminate minimum altitude for manual parachute release
jschall Nov 17, 2016
52d8059
Copter: add info messages to AUTO mode
jschall Dec 7, 2016
eb4ae5f
Copter: increase ARMING_DELAY_SEC to 3 to avoid failure to arm ESCs
jschall Jan 31, 2017
7469734
Copter: don't set auto_armed on throttle up in auto mode
jschall Jan 31, 2017
3058794
Copter: slow auto descent sets throttle mix to minimum
jschall Mar 14, 2017
ea578f2
Copter: reduce deceleration to LAND_SPEED
jschall Mar 24, 2017
048fcfb
Copter: set RANGEFINDER_WPNAV_FILT_HZ to 3
jschall Apr 7, 2017
970660a
Copter: move update_precland into fast_loop
jschall Apr 20, 2017
2b04cb7
Copter: don't set auto_armed on throttle up in GUIDED mode
jschall May 10, 2017
71fc215
Copter: re-work parachute deployment criteria
jschall Feb 2, 2017
f7b422f
Copter: add parachute deployment option to EKF failsafe
jschall Feb 9, 2017
1d3e7a7
Copter: disallow pilot yaw in AUTO mode
jschall May 31, 2017
04f8565
Copter: disallow switch to guided mode when armed
jschall Jun 2, 2017
633e083
Copter: replace hard-coded vertical velocity limit for chute deploy
jschall Jun 12, 2017
4a0e495
Copter: add arming check for matternet FTS
jschall Jul 7, 2017
2d17036
Copter: reset position control during liftoff
jschall Jul 7, 2017
0960158
Copter: call auto_takeoff_set_start_alt while waiting to take off
jschall Jan 23, 2018
5dbd06a
Copter: add FS_THR_ENABLED_CONTINUE_MISSION_ALWAYS_LAND
jschall Mar 23, 2018
fddf318
Copter: prevent switches out of manual modes via GCS
jschall Mar 23, 2018
3a287d5
Copter: remove pre-arm check on FS_THR_VALUE parameter
jschall May 2, 2018
946c952
Copter: prevent descent while centering for precision landing
jschall May 24, 2018
43f286c
Copter: reduce land detector trigger time to 0.5 seconds
jschall Oct 4, 2018
de509d1
Copter: run compass_checks in arming checks
jschall Nov 14, 2018
68e9d87
Copter: use ARMING_CHECK_FTS
tridge Mar 8, 2019
7dab0e0
Copter: display an error msg on manual mode refusal
tridge Mar 8, 2019
ee5bea0
Copter: added max navigation alt WP_NAVALT_MAX
tridge May 4, 2019
57a1d59
Copter: added Matternet specific GPS pre-takeoff and pre-arm checks
tridge May 4, 2019
fb69095
Copter: zero rate integrators below WP_NAVALT_MIN on takeoff
tridge Apr 25, 2019
389f40e
Copter: added a liftoff detector in auto takeoff
tridge May 4, 2019
2c5f25e
Copter: fixed takeoff checks
tridge Feb 18, 2020
adf015d
Copter: added ARMED_PIN
tridge May 6, 2019
2b3a626
Copter: disable RC arming check in GUIDED mode
tridge May 7, 2019
73a75f4
Copter: prevent double arm with RC failsafe off
tridge May 7, 2019
79291f1
Copter: don't show failed system status with RC off in GUIDED or AUTO
tridge Jun 7, 2019
24fccd8
Copter: notify logging of arming failure
tridge Jun 10, 2019
565ffde
Copter: implement LandIfManual battery failsafe option
tridge Jul 21, 2019
435eb6b
Copter: Prevent from going to Radio failsafe if in BRAKE mode
Aksellence Aug 28, 2019
f6a3814
Copter: add clearer message on takeoff attempt while disarmed
tridge Nov 27, 2019
e9480fd
Copter: set MAV_SYS_STATUS_PREARM_CHECK
tridge Dec 17, 2019
454ff99
Copter: fixed new mode number style
tridge Feb 18, 2020
c0cb460
Copter: fixed parachute checks
tridge Feb 18, 2020
f374e56
Copter: fixed max nav alt check
tridge Feb 18, 2020
5c8f464
Copter: fixed land if manual failsafe
tridge Feb 18, 2020
8376674
Copter: added rangefinder height interpolated using inertial alt
tridge Feb 18, 2020
3ec28e6
Copter: smoothly slow for precision landing
jschall Feb 18, 2020
7cde50c
HAL_ChibiOS: updated MttrCubeBlack defaults for 4.0
tridge Feb 26, 2020
2567693
HAL_ChibiOS: added MttrCubeOrange build
tridge Feb 26, 2020
6313cd8
Tools: update MttrCubeOrange bootloader
tridge Apr 3, 2020
79b41fe
HAL_ChibiOS: added MttrCubeBlack+ build
tridge Apr 6, 2020
74468c0
Tools: added MttrCubeBlack+ bootloader
tridge Apr 6, 2020
f5b106e
HAL_ChibiOS: updated MttrCube parms to better match mate parms
tridge Apr 13, 2020
bb2b73e
HAL_ChibiOS: disable internal compasses on MttrCubeOrange
tridge Apr 26, 2020
b865785
HAL_ChibiOS: fixed INS_FAST_SAMPLE for MttrCubeOrange
tridge Apr 26, 2020
16da78e
HAL_ChibiOS: enable harmonic notch for MttCubeOrange
tridge Apr 26, 2020
7a2aa66
HAL_SITL: disable stack checks on SITL
tridge Apr 26, 2020
29c7660
HAL_ChibiOS: removed unused params in MttrCubeOrange
tridge Apr 26, 2020
abdb25e
HAL_ChibiOS: adjust filter params for MttrCubeOrange based on flight …
tridge Apr 29, 2020
19de31a
HAL_ChibiOS: tweak MttrCubeOrange harmonic notch based on flight log
tridge Apr 29, 2020
93b7dd7
AP_GPS: added GPS_DRV_OPTIONS for using SERIALn_BAUD instead of auto-…
tridge Apr 30, 2020
9b83634
HAL_ChibiOS: adjust PID tuning for MttrCubeOrange
tridge Apr 30, 2020
77e24d6
AP_RangeFinder: fixed mixing UAVCAN and non-UAVCAN rangefinders
tridge Apr 30, 2020
604f37b
AP_BLHeli: allow for negative temperatures from BLHeli32 ESCs
tridge May 20, 2020
be1b6d5
HAL_ChibiOS: fixed defaults for RNGFND2
tridge May 20, 2020
9709230
AP_Mission: added continue after land mission option
tridge May 27, 2020
0764698
Copter: implement disarm on land based on MIS_OPTIONS
tridge May 27, 2020
a39080f
HAL_ChibiOS: minor tuning adjustments for MttrCubeOrange
tridge May 27, 2020
93eccfd
AP_Terrain: fixed bug in disk offset calculation
tridge May 2, 2020
9a084e1
AP_Terrain: added script for creating terrain *.dat files
tridge May 1, 2020
3b5560a
AP_UAVCAN: added FastIMU reporting
tridge Jun 21, 2020
41a6c19
AP_UAVCAN: support UAVCAN IMUs
tridge Jun 21, 2020
d0f0f0f
AP_UAVCAN: added FastIMU dsdl
tridge Jun 21, 2020
0aac757
AP_InertialSensor: support UAVCAN IMUs
tridge Jul 17, 2020
147fbf2
AP_UAVCAN: fixed dsdl ID conflict
tridge Jul 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
AP_GPS: Prefer u-blox F9P
  • Loading branch information
Aksellence authored and tridge committed Apr 3, 2020
commit d70a3d707c12bb8f048ce1a8a87c19af20c44724
49 changes: 29 additions & 20 deletions libraries/AP_GPS/AP_GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -794,26 +794,35 @@ void AP_GPS::update(void)
if (i == primary_instance) {
continue;
}
if (state[i].status > state[primary_instance].status) {
// we have a higher status lock, or primary is set to the blended GPS, change GPS

if (state[primary_instance].status < GPS_OK_FIX_3D) {
primary_instance = i;
_last_instance_swap_ms = now;
gcs().send_text(MAV_SEVERITY_CRITICAL, "GPS Switch: Switched to %u", primary_instance+1);
// add alert when a switch happens
continue;
}
// switch only if the currently used GPS has a 2D FIX or lower

if (state[i].status > GPS_OK_FIX_3D) {
primary_instance = i;
_last_instance_swap_ms = now;
gcs().send_text(MAV_SEVERITY_CRITICAL, "GPS Switch: Switched to %u", primary_instance+1);
// add alert when a switch happens
continue;
}
// er if the other GPS has a DGPS FIX (the best possible fix)

GPS_Status status_i = state[i].status;
GPS_Status status_primary = state[primary_instance].status;


// Treat U-blox F9 as SBAS if it has more than or equal to 16 satellites, as it is dual band GPS and is more accurate than M8 with SBAS
if (status_i == GPS_OK_FIX_3D && state[i].num_sats >= 16 && strcmp(drivers[i]->name(), "u-blox") == 0 && drivers[i]->hardware_generation() == AP_GPS_UBLOX::UBLOX_F9) {
status_i = GPS_OK_FIX_3D_DGPS;
}

// Treat U-blox F9 as SBAS if it has more than or equal to 16 satellites, as it is dual band GPS and is more accurate than M8 with SBAS
if (status_primary == GPS_OK_FIX_3D && state[primary_instance].num_sats >= 16 && strcmp(drivers[primary_instance]->name(), "u-blox") == 0 && drivers[primary_instance]->hardware_generation() == AP_GPS_UBLOX::UBLOX_F9) {
status_primary = GPS_OK_FIX_3D_DGPS;
}

bool should_switch = false;

if (status_i > status_primary) {
should_switch = true;
}

else if (status_i == status_primary && !hal.util->get_soft_armed() && state[i].num_sats >= state[primary_instance].num_sats+3) {
should_switch = true;
}

if (should_switch) {
primary_instance = i;
_last_instance_swap_ms = now;
gcs().send_text(MAV_SEVERITY_CRITICAL, "GPS Switch: Switched to %u", primary_instance+1);
}
}
}
Expand Down
23 changes: 12 additions & 11 deletions libraries/AP_GPS/AP_GPS_UBLOX.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ class AP_GPS_UBLOX : public AP_GPS_Backend

const char *name() const override { return "u-blox"; }

enum ubx_hardware_version {
ANTARIS = 0,
UBLOX_5,
UBLOX_6,
UBLOX_7,
UBLOX_M8,
UBLOX_F9 = 0x80, // comes from MON_VER hwVersion string
UBLOX_UNKNOWN_HARDWARE_GENERATION = 0xff // not in the ublox spec used for
// flagging state in the driver
};

private:
// u-blox UBX protocol essentials
struct PACKED ubx_header {
Expand Down Expand Up @@ -564,16 +575,6 @@ class AP_GPS_UBLOX : public AP_GPS_Backend
NAV_STATUS_FIX_VALID = 1,
NAV_STATUS_DGPS_USED = 2
};
enum ubx_hardware_version {
ANTARIS = 0,
UBLOX_5,
UBLOX_6,
UBLOX_7,
UBLOX_M8,
UBLOX_F9 = 0x80, // comes from MON_VER hwVersion string
UBLOX_UNKNOWN_HARDWARE_GENERATION = 0xff // not in the ublox spec used for
// flagging state in the driver
};

enum config_step {
STEP_PVT = 0,
Expand Down Expand Up @@ -673,7 +674,7 @@ class AP_GPS_UBLOX : public AP_GPS_Backend
}

// returns hardware generation of the GPS
uint32_t hardware_generation() {
uint32_t hardware_generation() const override {
return _hardware_generation;
}
};
2 changes: 1 addition & 1 deletion libraries/AP_GPS/GPS_Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class AP_GPS_Backend
virtual bool prepare_for_arming(void) { return true; }

// returns hardware generation variable
virtual uint32_t hardware_generation() { return 0; }
virtual uint32_t hardware_generation() const { return 0; }

protected:
AP_HAL::UARTDriver *port; ///< UART we are attached to
Expand Down