From 789437978dfa28c12bfcea13e1b616b976b3f66d Mon Sep 17 00:00:00 2001 From: Gautier Hattenberger Date: Tue, 20 Mar 2018 16:07:16 +0100 Subject: [PATCH] [swarm] add formation control for rotorcraft (#2246) * [swarm] add formation control for rotorcraft Based on Ewoud Smeur (INDI) and Hector Garcia de Marina (Formation control) work. See https://blog.paparazziuav.org/2017/12/02/pilot-a-super-rotorcraft - several UAV can be control from the ground (using a joystick for instance) by sending proper acceleration setpoint to the INDI guidance controller - configuration of the formation is done from a JSON file (2 example files provided) Some extra changes: - update accel from IMU in GPS passthrough INS - add accel setpoint to ABI messages - by to accel setpoint in INDI guidance - send ground reference from natnet2ivy - possibility to have a joystick labeled 'GCS' with input2ivy --- conf/abi.xml | 5 + conf/joystick/T1600M_ground.xml | 43 +++ conf/modules/fc_rotor.xml | 24 ++ conf/modules/guidance_indi.xml | 1 + conf/swarm/conf_2uav_rot.json | 52 +++ conf/swarm/conf_3uav_rot.json | 53 +++ .../rotorcraft/guidance/guidance_indi.c | 125 +++++-- .../rotorcraft/guidance/guidance_indi.h | 1 + sw/airborne/modules/fc_rotor/fc_rotor.c | 53 +++ sw/airborne/modules/fc_rotor/fc_rotor.h | 35 ++ sw/airborne/subsystems/abi_sender_ids.h | 7 + .../subsystems/ins/ins_gps_passthrough.c | 40 ++- sw/ground_segment/joystick/input2ivy.ml | 12 +- sw/ground_segment/python/fc_rotor/fc_rotor.py | 306 ++++++++++++++++++ .../python/fc_rotor/lib_rigid_formations.py | 122 +++++++ .../python/natnet3.x/NatNetClient.py | 2 +- .../python/natnet3.x/natnet2ivy.py | 15 +- 17 files changed, 859 insertions(+), 37 deletions(-) create mode 100644 conf/joystick/T1600M_ground.xml create mode 100644 conf/modules/fc_rotor.xml create mode 100644 conf/swarm/conf_2uav_rot.json create mode 100644 conf/swarm/conf_3uav_rot.json create mode 100644 sw/airborne/modules/fc_rotor/fc_rotor.c create mode 100644 sw/airborne/modules/fc_rotor/fc_rotor.h create mode 100755 sw/ground_segment/python/fc_rotor/fc_rotor.py create mode 100644 sw/ground_segment/python/fc_rotor/lib_rigid_formations.py diff --git a/conf/abi.xml b/conf/abi.xml index 269d937287..5c5eba22d9 100644 --- a/conf/abi.xml +++ b/conf/abi.xml @@ -151,6 +151,11 @@ Distance of object to track + + 0: 2D accel setpoint, 1: 3D accel setpoint + + + diff --git a/conf/joystick/T1600M_ground.xml b/conf/joystick/T1600M_ground.xml new file mode 100644 index 0000000000..47deec91fb --- /dev/null +++ b/conf/joystick/T1600M_ground.xml @@ -0,0 +1,43 @@ + + + + + + + + +