Drones Still Going Open Source Julien BERAUD October 12th 2016 - - - PowerPoint PPT Presentation

drones still going open source
SMART_READER_LITE
LIVE PREVIEW

Drones Still Going Open Source Julien BERAUD October 12th 2016 - - - PowerPoint PPT Presentation

Drones Still Going Open Source Julien BERAUD October 12th 2016 - Embedded Linux Conference Europe Berlin Drones Still Going Open Source 1 / 31 Introduction ArduPilot on Parrot Bebop 2 Parrot Disco and C.H.U.C.K Software Architecture for


slide-1
SLIDE 1

Drones Still Going Open Source

Julien BERAUD October 12th 2016 - Embedded Linux Conference Europe Berlin

Drones Still Going Open Source 1 / 31

slide-2
SLIDE 2

Introduction ArduPilot on Parrot Bebop 2 Parrot Disco and C.H.U.C.K Software Architecture for Video Video implementation with ArduPilot Building code for Parrot Disco What’s left to do ? Parrot SLAM.dunk Conclusion

Drones Still Going Open Source 2 / 31

slide-3
SLIDE 3

Introduction

Introduction

Drones Still Going Open Source 3 / 31

slide-4
SLIDE 4

Parrot Bebop 2

▶ 500g ▶ Parrot P7 SoC (dual Cortex A9) ▶ IMU, Barometer, Compass, Vertical Camera, Sonar, GPS ▶ Linux kernel 3.4 (no mainline support) ▶ Front camera with fjsh-eye lens

Drones Still Going Open Source 4 / 31

slide-5
SLIDE 5

Parrot Bebop 2

▶ 500g ▶ Parrot P7 SoC (dual Cortex A9) ▶ IMU, Barometer, Compass, Vertical Camera, Sonar, GPS ▶ Linux kernel 3.4 (no mainline support) ▶ Front camera with fjsh-eye lens

Drones Still Going Open Source 4 / 31

slide-6
SLIDE 6

Parrot Bebop 2

▶ 500g ▶ Parrot P7 SoC (dual Cortex A9) ▶ IMU, Barometer, Compass, Vertical Camera, Sonar, GPS ▶ Linux kernel 3.4 (no mainline support) ▶ Front camera with fjsh-eye lens

Drones Still Going Open Source 4 / 31

slide-7
SLIDE 7

Parrot Bebop 2

▶ 500g ▶ Parrot P7 SoC (dual Cortex A9) ▶ IMU, Barometer, Compass, Vertical Camera, Sonar, GPS ▶ Linux kernel 3.4 (no mainline support) ▶ Front camera with fjsh-eye lens

Drones Still Going Open Source 4 / 31

slide-8
SLIDE 8

Parrot Bebop 2

▶ 500g ▶ Parrot P7 SoC (dual Cortex A9) ▶ IMU, Barometer, Compass, Vertical Camera, Sonar, GPS ▶ Linux kernel 3.4 (no mainline support) ▶ Front camera with fjsh-eye lens

Drones Still Going Open Source 4 / 31

slide-9
SLIDE 9

ArduPilot on Parrot Bebop 2

ArduPilot on Parrot Bebop 2

Drones Still Going Open Source 5 / 31

slide-10
SLIDE 10

Hardware architecture

Drones Still Going Open Source 6 / 31

slide-11
SLIDE 11

Ardupilot

Ardupilot

Drones Still Going Open Source 7 / 31

slide-12
SLIDE 12

Ardupilot (APM)

▶ Open Source - GPLv3 ▶ Originally developed to run on an Arduino ▶ C++ ▶ Some linux boards already supported before Bebop

Drones Still Going Open Source 8 / 31

slide-13
SLIDE 13

Ardupilot (APM)

▶ Open Source - GPLv3 ▶ Originally developed to run on an Arduino ▶ C++ ▶ Some linux boards already supported before Bebop

Drones Still Going Open Source 8 / 31

slide-14
SLIDE 14

Ardupilot (APM)

▶ Open Source - GPLv3 ▶ Originally developed to run on an Arduino ▶ C++ ▶ Some linux boards already supported before Bebop

Drones Still Going Open Source 8 / 31

slide-15
SLIDE 15

Ardupilot (APM)

▶ Open Source - GPLv3 ▶ Originally developed to run on an Arduino ▶ C++ ▶ Some linux boards already supported before Bebop

Drones Still Going Open Source 8 / 31

slide-16
SLIDE 16

Software architecture

▶ Vehicle specifjc fmight code (ArduCopter, ArduPlane,

ArduRover)

▶ Shared libraries that include sensor drivers ▶ Hardware Abstraction Layer providing access to

platform-specifjc methods

▶ AP_HAL_Linux giving access to spidev, i2c-dev, uart drivers,

etc...

Drones Still Going Open Source 9 / 31

slide-17
SLIDE 17

Software architecture

▶ Vehicle specifjc fmight code (ArduCopter, ArduPlane,

ArduRover)

▶ Shared libraries that include sensor drivers ▶ Hardware Abstraction Layer providing access to

platform-specifjc methods

▶ AP_HAL_Linux giving access to spidev, i2c-dev, uart drivers,

etc...

Drones Still Going Open Source 9 / 31

slide-18
SLIDE 18

Software architecture

▶ Vehicle specifjc fmight code (ArduCopter, ArduPlane,

ArduRover)

▶ Shared libraries that include sensor drivers ▶ Hardware Abstraction Layer providing access to

platform-specifjc methods

▶ AP_HAL_Linux giving access to spidev, i2c-dev, uart drivers,

etc...

Drones Still Going Open Source 9 / 31

slide-19
SLIDE 19

Software architecture

▶ Vehicle specifjc fmight code (ArduCopter, ArduPlane,

ArduRover)

▶ Shared libraries that include sensor drivers ▶ Hardware Abstraction Layer providing access to

platform-specifjc methods

▶ AP_HAL_Linux giving access to spidev, i2c-dev, uart drivers,

etc...

Drones Still Going Open Source 9 / 31

slide-20
SLIDE 20

Flying

https://www.youtube.com/watch?v=HJN_gT1eNDk https://www.youtube.com/watch?v=ZnEFcJx1qko Thanks to Randy Mackay (Copter Maintainer)

Drones Still Going Open Source 10 / 31

slide-21
SLIDE 21

Parrot Disco and C.H.U.C.K

Parrot Disco and C.H.U.C.K

Drones Still Going Open Source 11 / 31

slide-22
SLIDE 22

Parrot Disco

▶ Fixed Wing ▶ Architecture close to the Bebop’s ▶ Built so its main board (C.H.U.C.K) can be used on another

vehicle

Drones Still Going Open Source 12 / 31

slide-23
SLIDE 23

Parrot Disco

▶ Fixed Wing ▶ Architecture close to the Bebop’s ▶ Built so its main board (C.H.U.C.K) can be used on another

vehicle

Drones Still Going Open Source 12 / 31

slide-24
SLIDE 24

Parrot Disco

▶ Fixed Wing ▶ Architecture close to the Bebop’s ▶ Built so its main board (C.H.U.C.K) can be used on another

vehicle

Drones Still Going Open Source 12 / 31

slide-25
SLIDE 25

C.H.U.C.K

▶ Targetting hobbyists, Research and Education ▶ ArduPlane seemed like a perfect candidate ▶ Porting made easier by previous Bebop porting ▶ Expert in that area in the person of Tridge

Drones Still Going Open Source 13 / 31

slide-26
SLIDE 26

C.H.U.C.K

▶ Targetting hobbyists, Research and Education ▶ ArduPlane seemed like a perfect candidate ▶ Porting made easier by previous Bebop porting ▶ Expert in that area in the person of Tridge

Drones Still Going Open Source 13 / 31

slide-27
SLIDE 27

C.H.U.C.K

▶ Targetting hobbyists, Research and Education ▶ ArduPlane seemed like a perfect candidate ▶ Porting made easier by previous Bebop porting ▶ Expert in that area in the person of Tridge

Drones Still Going Open Source 13 / 31

slide-28
SLIDE 28

C.H.U.C.K

▶ Targetting hobbyists, Research and Education ▶ ArduPlane seemed like a perfect candidate ▶ Porting made easier by previous Bebop porting ▶ Expert in that area in the person of Tridge

Drones Still Going Open Source 13 / 31

slide-29
SLIDE 29

Difgerences with Bebop 2

▶ MS415DO Airspeed sensor ▶ RC input over UART ▶ ESC difgerences ▶ Compass calibration issues ▶ Wiki for users

http: //ardupilot.org/plane/docs/airframe-disco.html

Drones Still Going Open Source 14 / 31

slide-30
SLIDE 30

Difgerences with Bebop 2

▶ MS415DO Airspeed sensor ▶ RC input over UART ▶ ESC difgerences ▶ Compass calibration issues ▶ Wiki for users

http: //ardupilot.org/plane/docs/airframe-disco.html

Drones Still Going Open Source 14 / 31

slide-31
SLIDE 31

Difgerences with Bebop 2

▶ MS415DO Airspeed sensor ▶ RC input over UART ▶ ESC difgerences ▶ Compass calibration issues ▶ Wiki for users

http: //ardupilot.org/plane/docs/airframe-disco.html

Drones Still Going Open Source 14 / 31

slide-32
SLIDE 32

Difgerences with Bebop 2

▶ MS415DO Airspeed sensor ▶ RC input over UART ▶ ESC difgerences ▶ Compass calibration issues ▶ Wiki for users

http: //ardupilot.org/plane/docs/airframe-disco.html

Drones Still Going Open Source 14 / 31

slide-33
SLIDE 33

Difgerences with Bebop 2

▶ MS415DO Airspeed sensor ▶ RC input over UART ▶ ESC difgerences ▶ Compass calibration issues ▶ Wiki for users

http: //ardupilot.org/plane/docs/airframe-disco.html

Drones Still Going Open Source 14 / 31

slide-34
SLIDE 34

Missing features

What’s missing ? Video

Drones Still Going Open Source 15 / 31

slide-35
SLIDE 35

Missing features

What’s missing ? Video

Drones Still Going Open Source 15 / 31

slide-36
SLIDE 36

Software Architecture for Video

Software Architecture for Video

Drones Still Going Open Source 16 / 31

slide-37
SLIDE 37

DragonProg

▶ We came from a world of RTOS ▶ 1 big process ▶ Lots of threads and priorities ▶ Little reusability and high maintenance overhead ▶ Switch to a new architecture based on several processes

Drones Still Going Open Source 17 / 31

slide-38
SLIDE 38

DragonProg

▶ We came from a world of RTOS ▶ 1 big process ▶ Lots of threads and priorities ▶ Little reusability and high maintenance overhead ▶ Switch to a new architecture based on several processes

Drones Still Going Open Source 17 / 31

slide-39
SLIDE 39

DragonProg

▶ We came from a world of RTOS ▶ 1 big process ▶ Lots of threads and priorities ▶ Little reusability and high maintenance overhead ▶ Switch to a new architecture based on several processes

Drones Still Going Open Source 17 / 31

slide-40
SLIDE 40

DragonProg

▶ We came from a world of RTOS ▶ 1 big process ▶ Lots of threads and priorities ▶ Little reusability and high maintenance overhead ▶ Switch to a new architecture based on several processes

Drones Still Going Open Source 17 / 31

slide-41
SLIDE 41

DragonProg

▶ We came from a world of RTOS ▶ 1 big process ▶ Lots of threads and priorities ▶ Little reusability and high maintenance overhead ▶ Switch to a new architecture based on several processes

Drones Still Going Open Source 17 / 31

slide-42
SLIDE 42

Dragonfmy

▶ Processes are now split ▶ 3 main processes ▶ IPC to exchange data at high rate ▶ One process in charge of video : Parrot IMaging Process ▶ Use of libshdata/libtelemetry to export/import data

Drones Still Going Open Source 18 / 31

slide-43
SLIDE 43

Dragonfmy

▶ Processes are now split ▶ 3 main processes ▶ IPC to exchange data at high rate ▶ One process in charge of video : Parrot IMaging Process ▶ Use of libshdata/libtelemetry to export/import data

Drones Still Going Open Source 18 / 31

slide-44
SLIDE 44

Dragonfmy

▶ Processes are now split ▶ 3 main processes ▶ IPC to exchange data at high rate ▶ One process in charge of video : Parrot IMaging Process ▶ Use of libshdata/libtelemetry to export/import data

Drones Still Going Open Source 18 / 31

slide-45
SLIDE 45

Dragonfmy

▶ Processes are now split ▶ 3 main processes ▶ IPC to exchange data at high rate ▶ One process in charge of video : Parrot IMaging Process ▶ Use of libshdata/libtelemetry to export/import data

Drones Still Going Open Source 18 / 31

slide-46
SLIDE 46

Dragonfmy

▶ Processes are now split ▶ 3 main processes ▶ IPC to exchange data at high rate ▶ One process in charge of video : Parrot IMaging Process ▶ Use of libshdata/libtelemetry to export/import data

Drones Still Going Open Source 18 / 31

slide-47
SLIDE 47

Pimp

Drones Still Going Open Source 19 / 31

slide-48
SLIDE 48

libtelemetry

▶ Library to import/export data between processes ▶ Built on top of libshdata ▶ Non-blocking ▶ Uses shm ▶ Timestamped data ▶ https://github.com/Parrot-Developers/libshdata ▶ https://github.com/Parrot-Developers/telemetry

Drones Still Going Open Source 20 / 31

slide-49
SLIDE 49

libtelemetry

▶ Library to import/export data between processes ▶ Built on top of libshdata ▶ Non-blocking ▶ Uses shm ▶ Timestamped data ▶ https://github.com/Parrot-Developers/libshdata ▶ https://github.com/Parrot-Developers/telemetry

Drones Still Going Open Source 20 / 31

slide-50
SLIDE 50

libtelemetry

▶ Library to import/export data between processes ▶ Built on top of libshdata ▶ Non-blocking ▶ Uses shm ▶ Timestamped data ▶ https://github.com/Parrot-Developers/libshdata ▶ https://github.com/Parrot-Developers/telemetry

Drones Still Going Open Source 20 / 31

slide-51
SLIDE 51

libtelemetry

▶ Library to import/export data between processes ▶ Built on top of libshdata ▶ Non-blocking ▶ Uses shm ▶ Timestamped data ▶ https://github.com/Parrot-Developers/libshdata ▶ https://github.com/Parrot-Developers/telemetry

Drones Still Going Open Source 20 / 31

slide-52
SLIDE 52

libtelemetry

▶ Library to import/export data between processes ▶ Built on top of libshdata ▶ Non-blocking ▶ Uses shm ▶ Timestamped data ▶ https://github.com/Parrot-Developers/libshdata ▶ https://github.com/Parrot-Developers/telemetry

Drones Still Going Open Source 20 / 31

slide-53
SLIDE 53

libtelemetry

▶ Library to import/export data between processes ▶ Built on top of libshdata ▶ Non-blocking ▶ Uses shm ▶ Timestamped data ▶ https://github.com/Parrot-Developers/libshdata ▶ https://github.com/Parrot-Developers/telemetry

Drones Still Going Open Source 20 / 31

slide-54
SLIDE 54

Video implementation with ArduPilot

Video implementation with ArduPilot

Drones Still Going Open Source 21 / 31

slide-55
SLIDE 55

AP_Module

▶ Dynamically linked plugin ▶ Implements hooks called by difgerent subsystems in ArduPilot ▶ Needs a plugin implementation

Drones Still Going Open Source 22 / 31

slide-56
SLIDE 56

AP_Module

▶ Dynamically linked plugin ▶ Implements hooks called by difgerent subsystems in ArduPilot ▶ Needs a plugin implementation

Drones Still Going Open Source 22 / 31

slide-57
SLIDE 57

AP_Module

▶ Dynamically linked plugin ▶ Implements hooks called by difgerent subsystems in ArduPilot ▶ Needs a plugin implementation

Drones Still Going Open Source 22 / 31

slide-58
SLIDE 58

libapm-telemetry

ap_hook_AHRS_update

void ap_hook_AHRS_update(const struct AHRS_state *state) { struct timespec ts; int ret; uint64_t time_us; /* check structure version */ if (state->structure_version != AHRS_state_version) { ULOGE("Wrong structure version"); return; } /* copy AHRS data to local structures */ memcpy(export.body_quaternion , state->quat, sizeof(export.body_quaternion)); /* export the data in telemetry */ time_us = state->time_us + export.time_offset; ret = time_us_to_timespec(&time_us, &ts); if (ret < 0) { ULOGE("error converting timespec to us %s", strerror(-ret)); return; } tlm_producer_put_sample(export.ahrs_producer , &ts); } Drones Still Going Open Source 23 / 31

slide-59
SLIDE 59

Video on Disco

pimp-ctl pimp-ctl stream-start 192.168.42.2 9999 gst-launch on remote side gst-launch-1.0 udpsrc port=9999 ! ”application/x-rtp, payload=96” ! rtph264depay ! avdec_h264 ! autovideosink

Drones Still Going Open Source 24 / 31

slide-60
SLIDE 60

Building code for Parrot Disco

Building code for Parrot Disco

Drones Still Going Open Source 25 / 31

slide-61
SLIDE 61

Build ardupilot for Disco

Using Alchemy https://github.com/ncarrier/apm-disco-manifest Using waf build system git clone https://github.com/ArduPilot/ardupilot cd ardupilot git submodule init git submodule update ./modules/waf/waf-light confjgure –board=disco ./modules/waf/waf-light build -j6

Drones Still Going Open Source 26 / 31

slide-62
SLIDE 62

What’s left to do ?

What’s left to do ?

Drones Still Going Open Source 27 / 31

slide-63
SLIDE 63

Remaining tasks

▶ Image quality improvements ▶ MAVLINK support to start streaming ▶ Piloting from Skycontroller 2 ▶ Allow users to develop video plugins ▶ Write a fully Open Source version of the video pipeline

Drones Still Going Open Source 28 / 31

slide-64
SLIDE 64

Remaining tasks

▶ Image quality improvements ▶ MAVLINK support to start streaming ▶ Piloting from Skycontroller 2 ▶ Allow users to develop video plugins ▶ Write a fully Open Source version of the video pipeline

Drones Still Going Open Source 28 / 31

slide-65
SLIDE 65

Remaining tasks

▶ Image quality improvements ▶ MAVLINK support to start streaming ▶ Piloting from Skycontroller 2 ▶ Allow users to develop video plugins ▶ Write a fully Open Source version of the video pipeline

Drones Still Going Open Source 28 / 31

slide-66
SLIDE 66

Remaining tasks

▶ Image quality improvements ▶ MAVLINK support to start streaming ▶ Piloting from Skycontroller 2 ▶ Allow users to develop video plugins ▶ Write a fully Open Source version of the video pipeline

Drones Still Going Open Source 28 / 31

slide-67
SLIDE 67

Remaining tasks

▶ Image quality improvements ▶ MAVLINK support to start streaming ▶ Piloting from Skycontroller 2 ▶ Allow users to develop video plugins ▶ Write a fully Open Source version of the video pipeline

Drones Still Going Open Source 28 / 31

slide-68
SLIDE 68

Parrot SLAM.dunk

Parrot SLAM.dunk

Drones Still Going Open Source 29 / 31

slide-69
SLIDE 69

Parrot SLAM.dunk

▶ Development Kit for Autonomous Flight ▶ Tegra K1 ▶ Stereo Cameras and sensors ▶ Ubuntu Desktop ▶ ROS support

Drones Still Going Open Source 30 / 31

slide-70
SLIDE 70

Parrot SLAM.dunk

▶ Development Kit for Autonomous Flight ▶ Tegra K1 ▶ Stereo Cameras and sensors ▶ Ubuntu Desktop ▶ ROS support

Drones Still Going Open Source 30 / 31

slide-71
SLIDE 71

Parrot SLAM.dunk

▶ Development Kit for Autonomous Flight ▶ Tegra K1 ▶ Stereo Cameras and sensors ▶ Ubuntu Desktop ▶ ROS support

Drones Still Going Open Source 30 / 31

slide-72
SLIDE 72

Parrot SLAM.dunk

▶ Development Kit for Autonomous Flight ▶ Tegra K1 ▶ Stereo Cameras and sensors ▶ Ubuntu Desktop ▶ ROS support

Drones Still Going Open Source 30 / 31

slide-73
SLIDE 73

Parrot SLAM.dunk

▶ Development Kit for Autonomous Flight ▶ Tegra K1 ▶ Stereo Cameras and sensors ▶ Ubuntu Desktop ▶ ROS support

Drones Still Going Open Source 30 / 31

slide-74
SLIDE 74

Conclusion

Questions ?

Drones Still Going Open Source 31 / 31