Date post: | 09-Jan-2017 |
Category: |
Software |
Upload: | anne-nicolas |
View: | 1,366 times |
Download: | 1 times |
The DroneCode Project - A Step in OpenSource Drones
Julien BERAUD
October 5, 2015
The DroneCode Project - A Step in Open Source Drones 1 / 21
The DroneCode Project
”An open source, collaborative project thatbrings together existing and future opensource drone projects under a nonprofitstructure governed by The Linux Foundation.The result will be a common, shared opensource platform for Unmanned AerialVehicles (UAVs).”
The DroneCode Project - A Step in Open Source Drones 2 / 21
DroneCode Software
The DroneCode Project - A Step in Open Source Drones 3 / 21
Parrot Drones 1/3
▶ Parrot AR Drone▶ Parrot 6 SoC - ARM926EJS▶ Linux Kernel▶ Busybox
The DroneCode Project - A Step in Open Source Drones 4 / 21
Parrot Drones 2/3
▶ Parrot AR Drone 2.0▶ TI OMAP3630 - ARM Cortex-A8▶ Linux Kernel▶ Busybox
The DroneCode Project - A Step in Open Source Drones 5 / 21
Parrot Drones 3/3
▶ Parrot Bebop▶ Parrot 7 SoC - Dual Cortex-A9▶ Linux Kernel▶ Busybox
The DroneCode Project - A Step in Open Source Drones 6 / 21
Drone Software
▶ Drone Software▶ Drone OnBoard Software▶ Computer/Smartphone/Tablet Software▶ Cloud Software▶ Protocols to bind them together
▶ Parrot Drones OnBoard Software▶ Custom Proprietary Flight Stack▶ Running entirely on Linux▶ No PREEMPT_RT Patch▶ Quite different from other existing drones
The DroneCode Project - A Step in Open Source Drones 7 / 21
Drone Software
▶ Drone Software▶ Drone OnBoard Software▶ Computer/Smartphone/Tablet Software▶ Cloud Software▶ Protocols to bind them together
▶ Parrot Drones OnBoard Software▶ Custom Proprietary Flight Stack▶ Running entirely on Linux▶ No PREEMPT_RT Patch▶ Quite different from other existing drones
The DroneCode Project - A Step in Open Source Drones 7 / 21
DroneCode OnBoard Software▶ OnBoard Software
▶ The Flight Stack▶ Specific to Drones▶ 2 Flight Stacks are part of the DroneCode Project
The DroneCode Project - A Step in Open Source Drones 8 / 21
DroneCode OnBoard Software▶ OnBoard Software
▶ The Flight Stack▶ Specific to Drones▶ 2 Flight Stacks are part of the DroneCode Project
The DroneCode Project - A Step in Open Source Drones 8 / 21
Dronecode Flight Stacks
▶ APM or Ardupilot - http://dev.ardupilot.com/
▶ GPLv3 License▶ First developed to run on an Arduino
▶ PX4 - https://pixhawk.org/dev/start
▶ BSD License▶ First developed to run on an STM32 microcontroller▶ Originally developed to run on top of NuttX RTOS
The DroneCode Project - A Step in Open Source Drones 9 / 21
Dronecode Flight Stacks
▶ APM or Ardupilot - http://dev.ardupilot.com/
▶ GPLv3 License▶ First developed to run on an Arduino
▶ PX4 - https://pixhawk.org/dev/start
▶ BSD License▶ First developed to run on an STM32 microcontroller▶ Originally developed to run on top of NuttX RTOS
The DroneCode Project - A Step in Open Source Drones 9 / 21
OpenSource Linux drones appearing
▶ January 2015 - Andrew Tridgell at LCA▶ Article on LWN - https://lwn.net/Articles/630018/▶ Drone running Linux with the APM flight stack▶ BeagleBone Black with Pixhawk Fire Cape
▶ Several Linux boards supported natively in APM▶ BeagleBone with Pixhawk Fire Cape▶ Erle Brain▶ NavIO
▶ Qualcomm starting to work on PX4 port on Linux
The DroneCode Project - A Step in Open Source Drones 10 / 21
Drone Architecture
▶ QuadCopter▶ Impossible to fly entirely manually - Autopilot▶ Sensors, user commands▶ Motor speeds
▶ Ardupilot▶ Reads from sensors▶ Enhanced Kalmann Filter(EKF)▶ Estimate the state of the Drone
▶ Sensors▶ Inertial Measurement Unit (IMU)▶ Barometer▶ Compass▶ GPS, Optical Flow Sensor, Sonar, ...
▶ External microcontroller for motor control
The DroneCode Project - A Step in Open Source Drones 11 / 21
Drone Architecture
▶ QuadCopter▶ Impossible to fly entirely manually - Autopilot▶ Sensors, user commands▶ Motor speeds
▶ Ardupilot▶ Reads from sensors▶ Enhanced Kalmann Filter(EKF)▶ Estimate the state of the Drone
▶ Sensors▶ Inertial Measurement Unit (IMU)▶ Barometer▶ Compass▶ GPS, Optical Flow Sensor, Sonar, ...
▶ External microcontroller for motor control
The DroneCode Project - A Step in Open Source Drones 11 / 21
Drone Architecture
▶ QuadCopter▶ Impossible to fly entirely manually - Autopilot▶ Sensors, user commands▶ Motor speeds
▶ Ardupilot▶ Reads from sensors▶ Enhanced Kalmann Filter(EKF)▶ Estimate the state of the Drone
▶ Sensors▶ Inertial Measurement Unit (IMU)▶ Barometer▶ Compass▶ GPS, Optical Flow Sensor, Sonar, ...
▶ External microcontroller for motor control
The DroneCode Project - A Step in Open Source Drones 11 / 21
Drone Architecture
▶ QuadCopter▶ Impossible to fly entirely manually - Autopilot▶ Sensors, user commands▶ Motor speeds
▶ Ardupilot▶ Reads from sensors▶ Enhanced Kalmann Filter(EKF)▶ Estimate the state of the Drone
▶ Sensors▶ Inertial Measurement Unit (IMU)▶ Barometer▶ Compass▶ GPS, Optical Flow Sensor, Sonar, ...
▶ External microcontroller for motor control
The DroneCode Project - A Step in Open Source Drones 11 / 21
Parrot Bebop Architecture
The DroneCode Project - A Step in Open Source Drones 12 / 21
APM - https://github.com/diydrones/ardupilot
AP_HAL class
class AP_HAL::HAL {...
AP_HAL::UARTDriver* uartA;AP_HAL::UARTDriver* uartB;AP_HAL::UARTDriver* uartC;AP_HAL::UARTDriver* uartD;AP_HAL::UARTDriver* uartE;AP_HAL::I2CDriver* i2c;AP_HAL::I2CDriver* i2c1;AP_HAL::I2CDriver* i2c2;AP_HAL::SPIDeviceManager* spi;
...};
Userland drivershal.i2c1->write(BEBOP_BLDC_I2C_ADDR, 1, &data);
The DroneCode Project - A Step in Open Source Drones 13 / 21
Drivers modifications▶ Baro - MS5607
▶ Existing driver for MS5611▶ Scaling factor
▶ Compass - AK8963▶ Existing driver for AL8963▶ Only as a slave device for an IMU▶ Implement the use of a direct connection on i2c
▶ IMU▶ MPU6050 in i2c instead of spi▶ No PREEMPT_RT patch▶ Jitter issues▶ Implement the use of the MPU6050 FIFO
▶ Motor Controller▶ New driver to write▶ Added in AP_HAL_Linux▶ Implements the RCOutput class
▶ GPS almost supported▶ Add frames / Fixes
The DroneCode Project - A Step in Open Source Drones 14 / 21
Drivers modifications▶ Baro - MS5607
▶ Existing driver for MS5611▶ Scaling factor
▶ Compass - AK8963▶ Existing driver for AL8963▶ Only as a slave device for an IMU▶ Implement the use of a direct connection on i2c
▶ IMU▶ MPU6050 in i2c instead of spi▶ No PREEMPT_RT patch▶ Jitter issues▶ Implement the use of the MPU6050 FIFO
▶ Motor Controller▶ New driver to write▶ Added in AP_HAL_Linux▶ Implements the RCOutput class
▶ GPS almost supported▶ Add frames / Fixes
The DroneCode Project - A Step in Open Source Drones 14 / 21
Drivers modifications▶ Baro - MS5607
▶ Existing driver for MS5611▶ Scaling factor
▶ Compass - AK8963▶ Existing driver for AL8963▶ Only as a slave device for an IMU▶ Implement the use of a direct connection on i2c
▶ IMU▶ MPU6050 in i2c instead of spi▶ No PREEMPT_RT patch▶ Jitter issues▶ Implement the use of the MPU6050 FIFO
▶ Motor Controller▶ New driver to write▶ Added in AP_HAL_Linux▶ Implements the RCOutput class
▶ GPS almost supported▶ Add frames / Fixes
The DroneCode Project - A Step in Open Source Drones 14 / 21
Drivers modifications▶ Baro - MS5607
▶ Existing driver for MS5611▶ Scaling factor
▶ Compass - AK8963▶ Existing driver for AL8963▶ Only as a slave device for an IMU▶ Implement the use of a direct connection on i2c
▶ IMU▶ MPU6050 in i2c instead of spi▶ No PREEMPT_RT patch▶ Jitter issues▶ Implement the use of the MPU6050 FIFO
▶ Motor Controller▶ New driver to write▶ Added in AP_HAL_Linux▶ Implements the RCOutput class
▶ GPS almost supported▶ Add frames / Fixes
The DroneCode Project - A Step in Open Source Drones 14 / 21
Drivers modifications▶ Baro - MS5607
▶ Existing driver for MS5611▶ Scaling factor
▶ Compass - AK8963▶ Existing driver for AL8963▶ Only as a slave device for an IMU▶ Implement the use of a direct connection on i2c
▶ IMU▶ MPU6050 in i2c instead of spi▶ No PREEMPT_RT patch▶ Jitter issues▶ Implement the use of the MPU6050 FIFO
▶ Motor Controller▶ New driver to write▶ Added in AP_HAL_Linux▶ Implements the RCOutput class
▶ GPS almost supported▶ Add frames / Fixes
The DroneCode Project - A Step in Open Source Drones 14 / 21
Motor Controller
RCOutput_Bebop
class Linux::LinuxRCOutput_Bebop : public AP_HAL::RCOutput {public:
LinuxRCOutput_Bebop();void init(void* dummy);void set_freq(uint32_t chmask, uint16_t freq_hz);uint16_t get_freq(uint8_t ch);void enable_ch(uint8_t ch);void disable_ch(uint8_t ch);void write(uint8_t ch, uint16_t period_us);void write(uint8_t ch, uint16_t* period_us, uint8_t len);uint16_t read(uint8_t ch);void read(uint16_t* period_us, uint8_t len);void set_esc_scaling(uint16_t min_pwm, uint16_t max_pwm);int read_obs_data(BebopBLDC_ObsData &data);
...
The DroneCode Project - A Step in Open Source Drones 15 / 21
Motor Controller 2/2
set_ref_speed
void LinuxRCOutput_Bebop::_set_ref_speed(uint16_t rpm[BEBOP_BLDC_MOTORS_NUM])
{struct bldc_ref_speed_data data;int i;
data.cmd = BEBOP_BLDC_SETREFSPEED;for (i=0; i<BEBOP_BLDC_MOTORS_NUM; i++)
data.rpm[i] = htobe16(rpm[i]);
data.enable_security = 0;data.checksum = _checksum((uint8_t *) &data, sizeof(data) - 1);
if (!_i2c_sem->take(0))return;
hal.i2c1->write(BEBOP_BLDC_I2C_ADDR,sizeof(data),(uint8_t *)&data);
_i2c_sem->give();}
The DroneCode Project - A Step in Open Source Drones 16 / 21
RCInput over Wi-Fi
Protocol#define RCINPUT_UDP_NUM_CHANNELS 8#define RCINPUT_UDP_VERSION 2
struct __attribute__((packed)) rc_udp_packet {uint32_t version;uint64_t timestamp_us;uint16_t sequence;uint16_t pwms[RCINPUT_UDP_NUM_CHANNELS];
};
▶ Basic linux utility written▶ joystick_remote
https://github.com/jberaud/joystick_remote▶ Using linux joystick input driver▶ Already ported on Parrot SkyController
The DroneCode Project - A Step in Open Source Drones 17 / 21
RCInput over Wi-Fi
Protocol#define RCINPUT_UDP_NUM_CHANNELS 8#define RCINPUT_UDP_VERSION 2
struct __attribute__((packed)) rc_udp_packet {uint32_t version;uint64_t timestamp_us;uint16_t sequence;uint16_t pwms[RCINPUT_UDP_NUM_CHANNELS];
};
▶ Basic linux utility written▶ joystick_remote
https://github.com/jberaud/joystick_remote▶ Using linux joystick input driver▶ Already ported on Parrot SkyController
The DroneCode Project - A Step in Open Source Drones 17 / 21
Trying to fly
▶ First flight = crash▶ Logging system used to understand the reason of the crash.▶ Log files sent to one of the maintainers▶ Log Analysis
▶ All sensor datas▶ All interesting values▶ Possibility to find the cause of a problem
▶ Solution found▶ The order of the motors wasn’t right
The DroneCode Project - A Step in Open Source Drones 18 / 21
Trying to fly
▶ First flight = crash▶ Logging system used to understand the reason of the crash.▶ Log files sent to one of the maintainers▶ Log Analysis
▶ All sensor datas▶ All interesting values▶ Possibility to find the cause of a problem
▶ Solution found▶ The order of the motors wasn’t right
The DroneCode Project - A Step in Open Source Drones 18 / 21
Trying to fly
▶ First flight = crash▶ Logging system used to understand the reason of the crash.▶ Log files sent to one of the maintainers▶ Log Analysis
▶ All sensor datas▶ All interesting values▶ Possibility to find the cause of a problem
▶ Solution found▶ The order of the motors wasn’t right
The DroneCode Project - A Step in Open Source Drones 18 / 21
Trying to fly
▶ First flight = crash▶ Logging system used to understand the reason of the crash.▶ Log files sent to one of the maintainers▶ Log Analysis
▶ All sensor datas▶ All interesting values▶ Possibility to find the cause of a problem
▶ Solution found▶ The order of the motors wasn’t right
The DroneCode Project - A Step in Open Source Drones 18 / 21
Log Analysis▶ Motors order
▶ Cause of the crash
The DroneCode Project - A Step in Open Source Drones 19 / 21
Submitting patches to master
▶ Discussions with Tridge▶ A bit of reworking▶ Patches got accepted▶ 1 month of work▶ 17 patches submitted for the basic support▶ Coming up next
▶ Wiki page for users to hack their bebop▶ Currently missing sensor support▶ Integration as an alternative to our flight stack
▶ Benefits▶ Performance comparison▶ Access to the dronecode ecosystem▶ New piloting modes
The DroneCode Project - A Step in Open Source Drones 20 / 21
Submitting patches to master
▶ Discussions with Tridge▶ A bit of reworking▶ Patches got accepted▶ 1 month of work▶ 17 patches submitted for the basic support▶ Coming up next
▶ Wiki page for users to hack their bebop▶ Currently missing sensor support▶ Integration as an alternative to our flight stack
▶ Benefits▶ Performance comparison▶ Access to the dronecode ecosystem▶ New piloting modes
The DroneCode Project - A Step in Open Source Drones 20 / 21
Submitting patches to master
▶ Discussions with Tridge▶ A bit of reworking▶ Patches got accepted▶ 1 month of work▶ 17 patches submitted for the basic support▶ Coming up next
▶ Wiki page for users to hack their bebop▶ Currently missing sensor support▶ Integration as an alternative to our flight stack
▶ Benefits▶ Performance comparison▶ Access to the dronecode ecosystem▶ New piloting modes
The DroneCode Project - A Step in Open Source Drones 20 / 21
Submitting patches to master
▶ Discussions with Tridge▶ A bit of reworking▶ Patches got accepted▶ 1 month of work▶ 17 patches submitted for the basic support▶ Coming up next
▶ Wiki page for users to hack their bebop▶ Currently missing sensor support▶ Integration as an alternative to our flight stack
▶ Benefits▶ Performance comparison▶ Access to the dronecode ecosystem▶ New piloting modes
The DroneCode Project - A Step in Open Source Drones 20 / 21
Conclusion
▶ Useful links▶ http://dev.ardupilot.com/▶ https://github.com/diydrones▶ https://github.com/jberaud▶ https://pixhawk.org
▶ Parrot is recruiting▶ Linux userland and kernel developers▶ Android Java developers▶ iOS developers
▶ Questions ?
The DroneCode Project - A Step in Open Source Drones 21 / 21
Conclusion
▶ Useful links▶ http://dev.ardupilot.com/▶ https://github.com/diydrones▶ https://github.com/jberaud▶ https://pixhawk.org
▶ Parrot is recruiting▶ Linux userland and kernel developers▶ Android Java developers▶ iOS developers
▶ Questions ?
The DroneCode Project - A Step in Open Source Drones 21 / 21
Conclusion
▶ Useful links▶ http://dev.ardupilot.com/▶ https://github.com/diydrones▶ https://github.com/jberaud▶ https://pixhawk.org
▶ Parrot is recruiting▶ Linux userland and kernel developers▶ Android Java developers▶ iOS developers
▶ Questions ?
The DroneCode Project - A Step in Open Source Drones 21 / 21