diff --git a/conf/Makefile.arm-embedded-toolchain b/conf/Makefile.arm-embedded-toolchain
index fc8e1dd821..f0dd026a65 100644
--- a/conf/Makefile.arm-embedded-toolchain
+++ b/conf/Makefile.arm-embedded-toolchain
@@ -30,15 +30,16 @@ ifneq ($(TOOLCHAIN_FOUND),1)
endif
endif
-CC = $(PREFIX)-gcc
-CXX = $(PREFIX)-g++
-LD = $(PREFIX)-g++
-AR = $(PREFIX)-ar
-CP = $(PREFIX)-objcopy
-DMP = $(PREFIX)-objdump
-NM = $(PREFIX)-nm
-SIZE = $(PREFIX)-size
-GDB = $(PREFIX)-gdb
+CC = $(PREFIX)-gcc
+CXX = $(PREFIX)-g++
+LD = $(PREFIX)-g++
+AR = $(PREFIX)-ar
+CP = $(PREFIX)-objcopy
+DMP = $(PREFIX)-objdump
+NM = $(PREFIX)-nm
+SIZE = $(PREFIX)-size
+GDB = $(PREFIX)-gdb
+STRIP = $(PREFIX)-strip
# some general commands
RM = rm
diff --git a/conf/Makefile.arm-linux-toolchain b/conf/Makefile.arm-linux-toolchain
index 7e623602be..ef14ce8663 100644
--- a/conf/Makefile.arm-linux-toolchain
+++ b/conf/Makefile.arm-linux-toolchain
@@ -36,15 +36,16 @@ ifeq ($(shell which $(PREFIX)-gcc),)
endif
endif
-CC = $(PREFIX)-gcc
-CXX = $(PREFIX)-g++
-LD = $(PREFIX)-g++
-AR = $(PREFIX)-ar
-CP = $(PREFIX)-objcopy
-DMP = $(PREFIX)-objdump
-NM = $(PREFIX)-nm
-SIZE = $(PREFIX)-size
-GDB = $(PREFIX)-gdb
+CC = $(PREFIX)-gcc
+CXX = $(PREFIX)-g++
+LD = $(PREFIX)-g++
+AR = $(PREFIX)-ar
+CP = $(PREFIX)-objcopy
+DMP = $(PREFIX)-objdump
+NM = $(PREFIX)-nm
+SIZE = $(PREFIX)-size
+GDB = $(PREFIX)-gdb
+STRIP = $(PREFIX)-strip
# some general commands
RM = rm
diff --git a/conf/airframes/OPENUAS/openuas_parrot_disco.xml b/conf/airframes/OPENUAS/openuas_parrot_disco.xml
index 54f50b3dc4..a2b29c6a9b 100644
--- a/conf/airframes/OPENUAS/openuas_parrot_disco.xml
+++ b/conf/airframes/OPENUAS/openuas_parrot_disco.xml
@@ -10,67 +10,86 @@
+ AIRSPEED: Default MS4515DO
+ TELEMETRY: Default WiFi
+ CURRENT: Default Build in V/A sensing
- + RC RX: Added a Spektrum DSMX Orange R620X Receiver with SBUS out, can be any receiver ofcourse
+ + RC RX: OpenR-XSR Sbus out
NOTES:
+ Hey, calibrate your magneto! Yes, you too ;), unit UKF auto works...
+ + Yeah.. and your Accelometer also... EKF2 will like you :)
+ All kinds of info https://fccid.io/2AG6I-DISCO
+ Uses PAPARAZZI "standard" radio channel settings, see TU Delft Devo 10 output
+ One could make a flightplan mimicing exact default behaviour of Parrot assisted flight
- + Tested with Firmware v1.7.1, should work on v1.4.1 and v1.7.0
- + Uses Enhanced Total Energy Control System (ETECS) for control
- + Flash the firmware via WiFi or USB
- + Enlarged battery bay ,and option fit a 5200 mAh 3S battery. The all-up weight (AUW)) of the airframe will be ~150g more
+ + Tested with Firmware v1.7.1, considder updating to this Disco firmware version if not done already
+ + Can use Enhanced Total Energy Control System (ETECS) for control
+ + Flash the PPRZ firmware via WiFi or USB
+ + Enlarged battery bay to fit a high capacity 5200 mAh 3S battery. The all-up weight (AUW)) of the airframe will be ~150g more
Center of gravity still the same, flighttime doubles...
- + Regular Telemetry is possible via USB to FTDI serial to Modem, added kernel drivers in another OpenUAS project
+ + Regular Telemetry is possible via USB to FTDI serial to Modem, added kernel drivers see:
+ https://wiki.paparazziuav.org/wiki/Howto.crosscompile_for_parrot_drones
+ https://wiki.paparazziuav.org/wiki/Use_the_USB_port_on_Parrot_Drones
+ Bottom camera can used just for some mapping, not high resolution but still fun...
+ The Parrot C.H.U.C.K. can be removed and placed in a regular plane also
+ If you change your control from ETECS to Classic or New make sure to disable the settings/estimation/ac_char
+ Added 12c 5200mAh battery, expect flighttimes of 52minutes at 15m/s
+ PPRZLink v2 advised for tcas fun
+ + OpenRX XSR but e.g a Spektrum DSMX Orange R620X Receiver with SBUS out possible
WIP:
+ It flies well, still not all gains are tuned to optimum, feel free to enhance and a PR...
- + The front cam is not yet supported with internal code, however successful video recording, streaming already possible with current module
- + Sonar needs some TLC and then put to good use e.g. last part of flare in landing
+ + The front cam is not yet fully supported with internal code, however successful video recording, streaming already possible with current module
+ + Sonar needs to be put to good use e.g. last part of flare in landing
+ Investigate effectiveness scheduling for (high)speed adjustments on non transitional fixedwing
+ Launching
+ + 1)Set TX to AUTO2 (or even switch off your TX is you dare)
+ 2) Move nose to ground
+ 3) wait until props spins after a second or so,
+ 4) move aircraft slight pitch up
+ 5) throw...
+
RC:
- The RC receiver Orange R620X make sure to set modeswitch to Auto2 on your TX when binding!
- else if one would lose RC or switch of transmitter during Auto2 flight, it will hop to manual.. very bad...
+ If the RC receiver is Orange R620X make sure to set modeswitch to Auto2 on your TX when binding!
+ else if one would lose RC or switch of transmitter during Auto2 flight, it will hop to manual... very bad...
A PPM receiver could theoretically be used, only for Linux ARCH no software to handle it is written (hint!)
SUMD also. For the PPRZ Spektum could also, but not if you also want to fly it with RC but without PPRZ as AP only original
- since Spektrum serial is not handled by the Parrot main AP
+ since Spektrum serial OUTPUT is not handled by the Parrot main AP
+ So a Spektrum DSMX with SBUS out, as there a plenty work well.
- The setup ot Transmitter is in such a way that one could fly without PPRC just Parrot with a 3rd party transmitter
- Thus modeswitch on 5 for well.. mode
+ The setup of Transmitter is in such a way that one could fly without PPRZ just Parrot original AP with a 3rd party RC transmitter
+ Thus modeswitch on 5 for well... mode
TX Channel Nr Function Control type Comments
1 Roll Stick
2 Pitch Stick
3 Throttle Stick
4 Yaw Stick Used to set the Disco in loiter
- 5 Gear 3-position switch Used to configure the piloting mode:
+ setself Gear 3-position switch Used to configure the piloting mode:
Auto-pilot with Parrot SkyController2 (Risky so better limit this one exept if you teaching people to fly with Skycontroller student AND RCTX for teacher )
Auto-pilot with RC controller
Full manual with RC controller
- 6 Automatic Take-off/Landing 2-position trainer switch Used in “Auto-pilot with RC controller” mode
- Start: SWx Landing: SWy
- Motor off in manual mode SW?
+ setself Automatic Take-off/Landing 2-position switch Used in “Auto-pilot with RC controller” mode
+ setself Start: SWx Landing: SWy
+ setself Motor off in manual mode SW?
+
+ TIP:
+ As soon as a RC receiver is connected to Disco, one has extra options in Freeflight Pro to set up the RC receiver
+ These values are then stored in the map.cfg file on the Disco
+ One finds some setting on the Disco board in /etc/radio/map.cfg incase of need of extreme customization ;)
+ Telnet there, Mount the partition to RW and adjust at will...
-
+
+
+
@@ -103,42 +122,47 @@
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
@@ -146,62 +170,79 @@
-
-
-
+
-
-
-
-
+
+
+
+
-
-
-
+
-
-
-
-
+
+
+
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
-
+
+
+
+
+
+
+ -->
@@ -230,6 +271,7 @@
+
@@ -237,48 +279,45 @@
-
+
-
+
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
-
-
-
@@ -294,7 +333,7 @@
-
+
@@ -304,16 +343,21 @@
+
+
+
+
+
-
-
+
+
-
+
@@ -352,13 +396,11 @@
-->
-
@@ -370,42 +412,41 @@
-
+
-
-
+
+
+
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
+
@@ -428,7 +469,7 @@
-
+
@@ -439,7 +480,7 @@
-
+
@@ -485,8 +526,25 @@
-
+
+
+
+
+
+
+
+
+
+
@@ -495,6 +553,7 @@
+
+
+
+
+
+
+
+
+
+
@@ -541,10 +611,10 @@ The most crucial part for the magnetometer calibration:
-
-
-
-
+
+
+
+
@@ -572,15 +642,23 @@ The most crucial part for the magnetometer calibration:
+
+
+
@@ -737,7 +815,6 @@ The most crucial part for the magnetometer calibration:
-
@@ -826,7 +903,6 @@ The most crucial part for the magnetometer calibration:
-
@@ -836,8 +912,7 @@ The most crucial part for the magnetometer calibration:
-
-
+
@@ -849,12 +924,35 @@ The most crucial part for the magnetometer calibration:
-
\ No newline at end of file
+
diff --git a/conf/flight_plans/OPENUAS/openuas_versatile_unified.xml b/conf/flight_plans/OPENUAS/openuas_versatile_unified.xml
index abcc2e19d5..de6897d282 100644
--- a/conf/flight_plans/OPENUAS/openuas_versatile_unified.xml
+++ b/conf/flight_plans/OPENUAS/openuas_versatile_unified.xml
@@ -189,7 +189,8 @@ Should be unified for Hybrid, FW and rotorcraft
-
+
+
@@ -329,6 +330,7 @@ Should be unified for Hybrid, FW and rotorcraft
+
@@ -336,7 +338,7 @@ Should be unified for Hybrid, FW and rotorcraft
+ This to avoid that the control surfaces used for breaking rip -off the wing if AC has no landing gear ... -->
@@ -398,5 +400,10 @@ Should be unified for Hybrid, FW and rotorcraft
+
+
+
+
diff --git a/conf/modules/dc_ctrl_parrot_mykonos.xml b/conf/modules/dc_ctrl_parrot_mykonos.xml
index 70caaec830..f60cf948b4 100644
--- a/conf/modules/dc_ctrl_parrot_mykonos.xml
+++ b/conf/modules/dc_ctrl_parrot_mykonos.xml
@@ -53,7 +53,7 @@
-
+
diff --git a/conf/radios/OPENUAS/openuas_openrxsr_sbus_16_out.xml b/conf/radios/OPENUAS/openuas_openrxsr_sbus_16_out.xml
new file mode 100644
index 0000000000..bc1b054031
--- /dev/null
+++ b/conf/radios/OPENUAS/openuas_openrxsr_sbus_16_out.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/conf/radios/OPENUAS/openuas_sbus_out.xml b/conf/radios/OPENUAS/openuas_sbus_out.xml
index 709c162afa..f8bf138398 100644
--- a/conf/radios/OPENUAS/openuas_sbus_out.xml
+++ b/conf/radios/OPENUAS/openuas_sbus_out.xml
@@ -1,7 +1,7 @@
-
@@ -23,24 +23,27 @@
-- function: logical command
-- averaged: channel filtered through several frames (for discrete commands)
-- min: minimum pulse length (micro-seconds)
--- max: maximum pulse length (micro-seconds)
-- neutral: neutral pulse length (micro-seconds)
--- Note: a command may be reversed by exchanging min and max values
+-- max: maximum pulse length (micro-seconds)
+-- Note: a command may be reversed by swapping the min and max value
-->
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/conf/telemetry/OPENUAS/openuas_fixedwing_imu.xml b/conf/telemetry/OPENUAS/openuas_fixedwing_imu.xml
index a76812c25b..a05428647a 100644
--- a/conf/telemetry/OPENUAS/openuas_fixedwing_imu.xml
+++ b/conf/telemetry/OPENUAS/openuas_fixedwing_imu.xml
@@ -34,7 +34,7 @@
-
+
diff --git a/conf/userconf/OPENUAS/openuas_conf.xml b/conf/userconf/OPENUAS/openuas_conf.xml
index 9988d62fe5..133e086cf6 100644
--- a/conf/userconf/OPENUAS/openuas_conf.xml
+++ b/conf/userconf/OPENUAS/openuas_conf.xml
@@ -1,14 +1,36 @@
+
+
-
#include
+#include "generated/airframe.h"
+#ifdef BOARD_DISCO
+#include "boards/disco.h"
+#else
+#include "boards/bebop.h"
+#endif
+
#define PRINT(string,...) fprintf(stderr, "[MT9F002->%s()] " string,__FUNCTION__ , ##__VA_ARGS__)
#if MT9F002_VERBOSE
diff --git a/sw/airborne/boards/bebop/mt9v117.c b/sw/airborne/boards/bebop/mt9v117.c
index f77c912024..4603b97d89 100644
--- a/sw/airborne/boards/bebop/mt9v117.c
+++ b/sw/airborne/boards/bebop/mt9v117.c
@@ -37,6 +37,14 @@
#include
#include
+#include "generated/airframe.h"
+#ifdef BOARD_DISCO
+#include "boards/disco.h"
+#else
+#include "boards/bebop.h"
+#endif
+
+
/* Camera structure */
struct video_config_t bottom_camera = {
.output_size = {
diff --git a/sw/airborne/boards/disco.h b/sw/airborne/boards/disco.h
index 31754aec3b..d72a44d9d3 100644
--- a/sw/airborne/boards/disco.h
+++ b/sw/airborne/boards/disco.h
@@ -60,6 +60,7 @@
/* Cameras */
#include "peripherals/video_device.h"
+
// re-use the Parrot Bebop video drivers
#include "boards/bebop/mt9v117.h"
#include "boards/bebop/mt9f002.h"
@@ -67,6 +68,9 @@
extern struct video_config_t bottom_camera;
extern struct video_config_t front_camera;
+/* ISP */
+//struct mt9f002_t mt9f002;
+
/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
#define USE_BARO_BOARD 1
@@ -97,7 +101,7 @@ extern struct video_config_t front_camera;
#ifndef USE_AIRSPEED_LOWPASS_FILTER
#define USE_AIRSPEED_LOWPASS_FILTER 1
#endif
-//#if USE_AIRSPEED_LOWPASS_FILTER
+//#if USE_AIRSPEED_LOWPASS_FILTER /* Always used now */
#ifndef MS45XX_LOWPASS_TAU
#define MS45XX_LOWPASS_TAU 0.15
#endif
@@ -109,4 +113,10 @@ extern struct video_config_t front_camera;
#define USE_AIRSPEED 1
#endif
+/* These are the default Disco values for sonar */
+#define SONAR_BEBOP_TRANSITION_HIGH_TO_LOW 0.75 //m
+#define SONAR_BEBOP_TRANSITION_LOW_TO_HIGH 1.5 //m
+#define SONAR_BEBOP_TRANSITION_COUNT 50
+#define SONAR_BEBOP_PEAK_THRESHOLD 50
+
#endif /* CONFIG_DISCO */
diff --git a/sw/airborne/modules/sonar/sonar_bebop.c b/sw/airborne/modules/sonar/sonar_bebop.c
index 9991a2f6fe..9d0ec6cc00 100644
--- a/sw/airborne/modules/sonar/sonar_bebop.c
+++ b/sw/airborne/modules/sonar/sonar_bebop.c
@@ -69,24 +69,34 @@ uint32_t sonar_bebop_spike_timer;
static uint8_t mode;
/** SONAR_BEBOP_TRANSITION_HIGH_TO_LOW below this altitude we should use mode 0 */
+#ifndef SONAR_BEBOP_TRANSITION_HIGH_TO_LOW
#define SONAR_BEBOP_TRANSITION_HIGH_TO_LOW 0.8
+#endif
/** SONAR_BEBOP_TRANSITION_LOW_TO_HIGH above this altitude we should use mode 1 */
+#ifndef SONAR_BEBOP_TRANSITION_LOW_TO_HIGH
#define SONAR_BEBOP_TRANSITION_LOW_TO_HIGH 1.2
+#endif
/** SONAR_BEBOP_TRANSITION_COUNT number of samples before switching mode */
+#ifndef SONAR_BEBOP_TRANSITION_COUNT
#define SONAR_BEBOP_TRANSITION_COUNT 7
+#endif
static uint8_t pulse_transition_counter;
/** SONAR_BEBOP_PEAK_THRESHOLD minimum samples from broadcast stop */
-#define SONAR_BEBOP_PEAK_THRESHOLD 100
+#ifndef SONAR_BEBOP_PEAK_THRESHOLD
+#define SONAR_BEBOP_PEAK_THRESHOLD 50
+#endif
/** SONAR_BEBOP_MIN_PEAK_VAL minimum adc value of reflected peak that will be cosidered */
-#define SONAR_BEBOP_MIN_PEAK_VAL 1024 // max value is 4096
+#ifndef SONAR_BEBOP_MIN_PEAK_VAL
+#define SONAR_BEBOP_MIN_PEAK_VAL 512 // max value is 4096
+#endif
/** SONAR_BEBOP_MAX_TRANS_TIME maximum time for a reflection to travel and return in the adc measurement window */
-#define SONAR_BEBOP_MAX_TRANS_TIME 270
+#define SONAR_BEBOP_MAX_TRANS_TIME 370
/** sonar_bebop_spi_d the waveforms emitted by the sonar
* waveform 0 is long pulse used at high altitude
@@ -140,15 +150,17 @@ uint16_t adc_buffer[SONAR_BEBOP_ADC_BUFFER_SIZE];
void *sonar_bebop_read(void *data __attribute__((unused)))
{
while (true) {
-#ifndef SITL
+ #ifndef SITL
uint16_t i;
/* Start ADC and send sonar output */
adc_enable(&adc0, 1);
sonar_bebop_spi_t.status = SPITransDone;
+ usleep(100); //Sonar crashes without the delay once in a while :(
sonar_bebop_spi_t.output_buf = sonar_bebop_spi_d[mode];
spi_submit(&spi0, &sonar_bebop_spi_t);
while (sonar_bebop_spi_t.status != SPITransSuccess);
+ usleep(100); //Sonar crashes without the delay once in a while :(
adc_read(&adc0, adc_buffer, SONAR_BEBOP_ADC_BUFFER_SIZE);
adc_enable(&adc0, 0);
@@ -181,13 +193,9 @@ void *sonar_bebop_read(void *data __attribute__((unused)))
uint16_t diff = stop_send - start_send;
if (diff && diff < SONAR_BEBOP_MAX_TRANS_TIME
&& peak_value > SONAR_BEBOP_MIN_PEAK_VAL) {
- sonar_bebop.meas = first_peak - (stop_send - diff / 2);
+ sonar_bebop.meas = (uint16_t)(first_peak - (stop_send - diff / 2));
sonar_bebop.distance = update_median_filter_f(&sonar_filt, (float)sonar_bebop.meas * SONAR_BEBOP_INX_DIFF_TO_DIST);
-#if SONAR_BEBOP_FILTER_NARROW_OBSTACLES
- sonar_bebop.distance = sonar_filter_narrow_obstacles(sonar_bebop.distance);
-#endif
-
// set sonar pulse mode for next pulse based on altitude
if (mode == 0 && sonar_bebop.distance > SONAR_BEBOP_TRANSITION_LOW_TO_HIGH) {
if (++pulse_transition_counter > SONAR_BEBOP_TRANSITION_COUNT) {
@@ -203,28 +211,37 @@ void *sonar_bebop_read(void *data __attribute__((unused)))
pulse_transition_counter = 0;
}
-#else // SITL
+ #else // SITL
sonar_bebop.distance = stateGetPositionEnu_f()->z;
Bound(sonar_bebop.distance, 0.1f, 7.0f);
- sonar_bebop.meas = sonar_bebop.distance / SONAR_BEBOP_INX_DIFF_TO_DIST;
-#endif // SITL
+ sonar_bebop.meas = (uint16_t)(sonar_bebop.distance / SONAR_BEBOP_INX_DIFF_TO_DIST);
+ #endif // SITL
+
+ #if SONAR_COMPENSATE_ROTATION
+ float phi = stateGetNedToBodyEulers_f()->phi;
+ float theta = stateGetNedToBodyEulers_f()->theta;
+ float gain = (float)fabs( (double) (cosf(phi) * cosf(theta)));
+ sonar_bebop.distance = sonar_bebop.distance * gain;
+ #endif
+
+ #if SONAR_BEBOP_FILTER_NARROW_OBSTACLES
+ sonar_bebop.distance = sonar_filter_narrow_obstacles(sonar_bebop.distance);
+ #endif
// Send ABI message
uint32_t now_ts = get_sys_time_usec();
AbiSendMsgAGL(AGL_SONAR_ADC_ID, now_ts, sonar_bebop.distance);
-#ifdef SENSOR_SYNC_SEND_SONAR
+
+ #ifdef SENSOR_SYNC_SEND_SONAR
// Send Telemetry report
DOWNLINK_SEND_SONAR(DefaultChannel, DefaultDevice, &sonar_bebop.meas, &sonar_bebop.distance);
-#endif
-#ifndef SITL
+ #endif
}
-#endif
- usleep(10000); //100Hz
+ usleep(10000); //100Hz FIXME: use SYS_TIME_FREQUENCY and divisor
}
return NULL;
}
-
#if SONAR_BEBOP_FILTER_NARROW_OBSTACLES
#ifndef SONAR_BEBOP_FILTER_NARROW_OBSTACLES_JUMP
diff --git a/sw/airborne/peripherals/ak8963.c b/sw/airborne/peripherals/ak8963.c
index db9f1af394..87bd06b4c2 100644
--- a/sw/airborne/peripherals/ak8963.c
+++ b/sw/airborne/peripherals/ak8963.c
@@ -37,10 +37,10 @@ void ak8963_init(struct Ak8963 *ak, struct i2c_periph *i2c_p, uint8_t addr)
ak->i2c_p = i2c_p;
/* set i2c address */
ak->i2c_trans.slave_addr = addr;
- ak->i2c_trans.status = I2CTransDone;
+ ak->data_available = false;
ak->initialized = false;
ak->init_status = AK_CONF_UNINIT;
- ak->data_available = false;
+ ak->i2c_trans.status = I2CTransDone;
}
void ak8963_configure(struct Ak8963 *ak)
@@ -51,7 +51,7 @@ void ak8963_configure(struct Ak8963 *ak)
return;
}
- // Only when succesfull continue with next
+ // Only when succesfully continue with next
if (ak->i2c_trans.status == I2CTransSuccess) {
ak->init_status++;
}
@@ -114,10 +114,9 @@ void ak8963_event(struct Ak8963 *ak)
ak->data.vect.x = Int16FromBuf(ak->i2c_trans.buf, 0);
ak->data.vect.y = Int16FromBuf(ak->i2c_trans.buf, 2);
ak->data.vect.z = Int16FromBuf(ak->i2c_trans.buf, 4);
- ak->data_available = true;
// Read second status register to be ready for reading again
- ak->i2c_trans.buf[0] = AK8963_REG_ST2;
+ ak->i2c_trans.buf[0] = AK8963_REG_ST2; // Data overflow bit 3 and data read error status bit 2
i2c_transceive(ak->i2c_p, &(ak->i2c_trans), ak->i2c_trans.slave_addr, 1, 1);
ak->status++;
break;
@@ -131,11 +130,13 @@ void ak8963_event(struct Ak8963 *ak)
ak->i2c_trans.status = I2CTransDone;
ak->status = AK_STATUS_IDLE;
// check overrun
+ if ((bit_is_set(ak->i2c_trans.buf[0], 3)) || (bit_is_set(ak->i2c_trans.buf[0], 2))) {
//if (bit_is_set(ak->i2c_trans.buf[0], 3)) {
- // ak->data_available = false;
- //} else {
- // ak->data_available = true;
- //}
+ ak->data_available = false;
+ } else {
+ ak->data_available = true;
+ ak->i2c_trans.status = I2CTransDone;
+ }
}
break;
}
diff --git a/sw/airborne/subsystems/ahrs/ahrs_float_dcm.c b/sw/airborne/subsystems/ahrs/ahrs_float_dcm.c
index 1cfc11d109..818a13c0ad 100644
--- a/sw/airborne/subsystems/ahrs/ahrs_float_dcm.c
+++ b/sw/airborne/subsystems/ahrs/ahrs_float_dcm.c
@@ -175,7 +175,7 @@ void ahrs_dcm_update_gps(struct GpsState *gps_s)
ahrs_dcm.gps_age = 0;
ahrs_dcm.gps_speed = gps_s->speed_3d / 100.;
- if (gps_s->gspeed >= 500) { //got a 3d fix and ground speed is more than 5.0 m/s
+ if (gps_s->gspeed >= 500) { //got a 3d fix and ground speed is more than 5.0 m/s //FIXME: Should be settable
ahrs_dcm.gps_course = ((float)gps_s->course) / 1.e7;
ahrs_dcm.gps_course_valid = true;
} else {
diff --git a/sw/airborne/subsystems/imu/imu_disco.c b/sw/airborne/subsystems/imu/imu_disco.c
index 25f75a1398..100250fafe 100644
--- a/sw/airborne/subsystems/imu/imu_disco.c
+++ b/sw/airborne/subsystems/imu/imu_disco.c
@@ -35,6 +35,9 @@ PRINT_CONFIG_VAR(DISCO_MAG_I2C_DEV)
#define DISCO_MPU_I2C_DEV i2c2
PRINT_CONFIG_VAR(DISCO_MPU_I2C_DEV)
+#if !defined AK8963_HZ
+#define AK8963_HZ 50
+#endif
#if !defined DISCO_LOWPASS_FILTER && !defined DISCO_SMPLRT_DIV
#if (PERIODIC_FREQUENCY == 60) || (PERIODIC_FREQUENCY == 120)
@@ -85,11 +88,17 @@ void imu_disco_init(void)
*/
void imu_disco_periodic(void)
{
+ static uint32_t cntr = 0;
+
// Start reading the latest gyroscope data
mpu60x0_i2c_periodic(&imu_disco.mpu);
- // AKM8963
- ak8963_periodic(&imu_disco.ak);
+ // AKM8963 if read faster thant datasheet 100Hz over I2C crashes it once in a while
+ if (cntr%((uint32_t)(PERIODIC_FREQUENCY/AK8963_HZ))==0) {
+ ak8963_periodic(&imu_disco.ak);
+ cntr=0;
+ }
+ cntr++;
}
/**
diff --git a/sw/airborne/subsystems/ins/ins_ekf2.cpp b/sw/airborne/subsystems/ins/ins_ekf2.cpp
index ec68eb478e..cc17059abd 100644
--- a/sw/airborne/subsystems/ins/ins_ekf2.cpp
+++ b/sw/airborne/subsystems/ins/ins_ekf2.cpp
@@ -345,7 +345,8 @@ static void ins_ekf2_publish_attitude(uint32_t stamp)
uint8_t quat_reset_counter;
ekf.get_quat_reset(delta_q_reset, &quat_reset_counter);
- // If reset update the setpoint heading
+#ifndef NO_RESET_UPDATE_SETPOINT_HEADING
+
if (ekf2.quat_reset_counter < quat_reset_counter) {
float psi = matrix::Eulerf(matrix::Quatf(delta_q_reset)).psi();
#if defined STABILIZATION_ATTITUDE_TYPE_INT
@@ -360,6 +361,7 @@ static void ins_ekf2_publish_attitude(uint32_t stamp)
stabilization_attitude_enter();
ekf2.quat_reset_counter = quat_reset_counter;
}
+#endif
/* Get in-run gyro bias */
struct FloatRates body_rates;
diff --git a/sw/tools/parrot/disco.py b/sw/tools/parrot/disco.py
index 3b30ec9905..51424355c5 100755
--- a/sw/tools/parrot/disco.py
+++ b/sw/tools/parrot/disco.py
@@ -52,4 +52,3 @@ if __name__ == "__main__":
disco = Disco()
disco.parse_args()
exit(0)
-
diff --git a/sw/tools/parrot/disco/ch341.ko b/sw/tools/parrot/disco/ch341.ko
new file mode 100644
index 0000000000..6b032c67ba
Binary files /dev/null and b/sw/tools/parrot/disco/ch341.ko differ
diff --git a/sw/tools/parrot/disco/cp210x.ko b/sw/tools/parrot/disco/cp210x.ko
new file mode 100644
index 0000000000..7ecf73a0d2
Binary files /dev/null and b/sw/tools/parrot/disco/cp210x.ko differ
diff --git a/sw/tools/parrot/disco/ftdi_sio.ko b/sw/tools/parrot/disco/ftdi_sio.ko
new file mode 100644
index 0000000000..2cf7a60fb7
Binary files /dev/null and b/sw/tools/parrot/disco/ftdi_sio.ko differ
diff --git a/sw/tools/parrot/disco/option.ko b/sw/tools/parrot/disco/option.ko
new file mode 100644
index 0000000000..e28e9581ab
Binary files /dev/null and b/sw/tools/parrot/disco/option.ko differ
diff --git a/sw/tools/parrot/disco/pl2303.ko b/sw/tools/parrot/disco/pl2303.ko
new file mode 100644
index 0000000000..7ab49ee5d4
Binary files /dev/null and b/sw/tools/parrot/disco/pl2303.ko differ
diff --git a/sw/tools/parrot/disco/usb_wwan.ko b/sw/tools/parrot/disco/usb_wwan.ko
new file mode 100644
index 0000000000..5cb55f92be
Binary files /dev/null and b/sw/tools/parrot/disco/usb_wwan.ko differ
diff --git a/sw/tools/parrot/disco/usbserial.ko b/sw/tools/parrot/disco/usbserial.ko
new file mode 100644
index 0000000000..d176d34005
Binary files /dev/null and b/sw/tools/parrot/disco/usbserial.ko differ