Commit Graph

15622 Commits

Author SHA1 Message Date
Gautier Hattenberger 6ad7fa93d0 Fix settings in log (#2569)
* [log] add the latest generated settings if available to log file

This way, the exact order of the settings used during the flight might
be available.
The only false case would be to start a server, rebuild and aircraft
with different parameters or target, then flash and start the plane. In
this case, there is no guarantee that the information is correct.
However, this is the best we can do, since we can't know when starting
the server with which target the aircraft will be used.

close #2563

* [fix] use correct FP dumping tool for replay
2020-08-26 16:15:24 +02:00
Tom van Dijk a3645e219e Module for transparent control of external GPIOs (#2564)
* GCC wrap example
* Rename pca95x4 to pca95xx
* Fix softi2c_spin hanging
     Suspected cause is sys_time_usleep hanging when called from SPI,
     because interrupts are disabled. But not confirmed. Adding LED
     code fixes the hang, so cannot test.

Co-authored-by: Tom van Dijk <tomvand@users.noreply.github.com>
2020-08-21 16:51:51 +02:00
Ewoud Smeur 5b634a9c8a some improvements of the README (#2565) 2020-08-17 18:23:38 +02:00
Gautier Hattenberger 5dfb6f2259 [fix] handle more exceptions when parsing conf (#2562)
it is currently crashing the server when their is an error in the conf
files
2020-08-17 18:21:39 +02:00
Hector Garcia de Marina 7dff606068 Merge pull request #2567 from OpenUAS/fix_for_gspeed_spiking_issue
Fix for gspeed spiking issue #2566
2020-08-15 20:52:49 +02:00
Open UAS 42fb2d8b4e Fix for gspeed spiking issue #2566 2020-08-15 16:25:33 +02:00
alexandre bustico 2ae834f228 Fix dshot and dma (#2552)
* dshot : driver that contain dma buffer should be in a non cached memory section

* dshot, dma : dma buffer must be in a volatile array

* esc_dshot and dma : fix dma burst condition for activation

* esc_dshot and dma : fix volatile missing in declaration

* lower adc and dma priority to preserve dshot timing

* remove unnecessary volatile declaration for dma buffer

* esc_dshot : replace frame + 4 sync bits by : 2 sync bits + frame + 2 syncs bits : in order to fix malformed frame in case of DMA latency
2020-07-31 18:23:34 +02:00
Fabien-B 03350bb4d7 Sphinx doc (#2558)
* [Doc] Adds doc about imu congiguration and fix some doc.
* [doc] Edit quick start doc.
* [Doc] Add "interfacing with Paparazzi" page.
* [Doc] Fix radio conf doc.
* [doc] Adds warning about out-of-date doc.

Co-authored-by: Gautier Hattenberger <gautier.hattenberger@enac.fr>
2020-07-28 16:45:46 +02:00
Ewoud Smeur 3b4ce8232e Cyclone guidance code (#2533) 2020-07-27 15:35:26 +02:00
Gautier Hattenberger de22fb1c29 [rotorcraft] split arming code definition from autopilot (#2550)
the arming states are currently defined in autopilot_static.h, which is
not compatible with the use of generated autopilot
2020-07-27 12:29:34 +02:00
Gautier Hattenberger c53756b7b0 [effectiveness] module and tool to log and process control effectiveness (#2551) 2020-07-27 12:28:51 +02:00
Hector Garcia de Marina af382fad07 unit instead of value (#2557) 2020-07-25 15:08:21 +02:00
Ralph R. Schmidt d047a9bb81 StereoWedgeBug (#2555)
* First comit of clean branch

* Added new drone airframe files (xml and model folder) for gazebo

* Renamed sdf file for bebop drone with stereo cams

* Added custom configuration and control panel files
 On branch stereoCamerasNewDrone
 Changes to be committed:
	new file:   conf/userconf/tudelft/ralphthesis2020_conf.xml
	new file:   conf/userconf/tudelft/ralphthesis2020_control_panel.xml

* Added new files necessary for a new bebop model with stereo vision
On branch stereoCamerasNewDrone
Changes to be committed:
	new file:   conf/airframes/tudelft/bebop_ralphthesis2020_stereo.xml
	new file:   conf/flight_plans/tudelft/ralphthesis2020_stereo_cyberzoo.xml
	modified:   conf/simulator/gazebo/airframes/bebop_w_stereo_cams.xml
	modified:   conf/simulator/gazebo/models/bebop_w_stereo_cams/bebop_w_stereo_cams.sdf
	modified:   conf/simulator/gazebo/models/bebop_w_stereo_cams/model.config
	modified:   conf/userconf/tudelft/ralphthesis2020_conf.xml

* Replaced cameras on bebop (front + down) with a stereo setup

On branch stereoCamerasNewDrone
Changes to be committed:
	modified:   conf/simulator/gazebo/models/bebop_w_stereo_cams/bebop_w_stereo_cams.sdf

* Solved low resolution in left camera

On branch stereoCamerasNewDrone
Changes to be committed:
	modified:   conf/simulator/gazebo/models/bebop_w_stereo_cams/bebop_w_stereo_cams.sdf

* Created new module "wedgebu" and added it to the airframe "bebop_ralphthesis2020_stereo.xml"
Also, used "make" to create tool for creating modules
On branch wedgeBug
Your branch is up to date with 'origin/wedgeBug'.
Changes to be committed:
	modified:   conf/airframes/tudelft/bebop_ralphthesis2020_stereo.xml
	new file:   conf/modules/wedgebug.xml
	modified:   conf/userconf/tudelft/ralphthesis2020_conf.xml
	new file:   sw/airborne/modules/wedgebug/wedgebug.c
	new file:   sw/airborne/modules/wedgebug/wedgebug.h
	new file:   sw/tools/create_module/create_module_ui.py
	new file:   sw/tools/create_module/datalink_ui.py
	new file:   sw/tools/create_module/event_ui.py
	modified:   sw/tools/create_module/files_create.py
	new file:   sw/tools/create_module/init_ui.py
	new file:   sw/tools/create_module/periodic_ui.py

* Added functions to copy images from left and right camera to global variables
On branch wedgeBug
Your branch is ahead of 'origin/wedgeBug' by 1 commit.
 Changes to be committed:
	modified:   conf/airframes/tudelft/bebop_ralphthesis2020_stereo.xml
	modified:   conf/modules/wedgebug.xml
	modified:   conf/simulator/gazebo/models/bebop_w_stereo_cams/bebop_w_stereo_cams.sdf
	modified:   sw/airborne/modules/wedgebug/wedgebug.c

* Added function to compare individual pixels of  images types (image_t)

* Tried to figure out why the C++ Mat object of the left gray pixels looks different to the left image

* A rough implementation and proof of the copy function (note: copy buf entries by incrementing pointer)
Changes to be committed:
	deleted:    Color_Image.jpg
	modified:   conf/airframes/tudelft/bebop_ralphthesis2020_stereo.xml
	deleted:    merged_stereo_image.jpg
	modified:   sw/airborne/modules/wedgebug/wedgebug.c
	modified:   sw/airborne/modules/wedgebug/wedgebug.h
	modified:   sw/airborne/modules/wedgebug/wedgebug_opencv.cpp
	modified:   sw/airborne/modules/wedgebug/wedgebug_opencv.h

* Finalized 1) image merging function for YY image and 2) function for saving gray images using openCV

* Created C++ function to create and return disparity image. Also changed gazebo world.

* 1) Added FPS like controlls for drone, using Xbox controller. 2) Added cropping image functionality of block matching function.

* SBM can take 16 bit images now, save function uses an image_t struct and a new type called "IMAGE_OPENCV_DISP" was added, specifically for OpenCV disparity images.

* Added openCV dependent openin and closing functions

* Added 1) openCV dependent dilation and sobel operation functions, 2) 3d point structure to image.h 3) Loop in wedebug.c for findin edge point closest to target.

* Added functions to convert world coordinates to camera coordinates (turned out to be a wrong implementation. Next commit will be the correct implementation)

* Added functions to convert world to agent to camera coordinates (and vice versa)

* Cleaned up coordinate conversion functions

* 1. Created new world for drone testing, 2. Created new waytpoints for drone testing, 4. Created state machine template in module 5. Debugged the "SBM_OCV" function 6. Filled in the state for "Initial position", "Move to start", "Start position" and  "Goal reached" 7. Started to fill in the state "Move to goal" 8. Created function to get median distance of object in front ("median_disparity_to_point") 9. Created function to determine angle between drone and goal point ("heading_towards_waypoin") 10. Cleaned up code, removed non-essential variables (especially images) and added new variables.

* Converted edge detection algorithm into a function and cleaned code more. Also created more global variables.

* Added draft approach for "EDGE_DETECTION"

* Quick save

* First draft of code. The robot can evade a board in its way and reach the goal. Also  increase periodic loop speed to 15 hz to counter the fast turning of the drone

* Included code for measuring metrics and displaying them. Also, cleaned the code some more.

* Cleaned code, added comments to describe code and variables and got rid of bug in function calculating heading direction.

* Removed bug in POSITION_EDGE state, where a new holding point was not set, after an obstacle was encountered. Also added various shapes (with birck texture) for testing.

* Added more shapes for experiment and added settings to change in GCS

* Changed camera settings to mimic those of Mathies et al. 2014. The drone can now avoid the standard metal board and the brick wall (type 2 2 x 2 meters)!

* Implemented state machine for control modes.

* Simplified code

* Cleaned code

* Added a  flag to detect changes in the navigation mode used

* Merged background processes under the condition that the state machine is running in certain state

* Debugged time measurement of total time (metric 1)

* Cleaned code

* MAde debug options state number independent (i.e. they have been renamed to include the name of the state and not the number)

* Remove states: POSITION_INITIAL, MOVE_TO_START and POSITION_START from finite state machine. Also all associate variables have been removed.

* Changed "NUMER_OF_STATES" to "NUMBER_OF_STATES". Also increased "max_obstacle_confidence" from 3 to 5, to avoid fake obstacle detection.

* Added metric measurement when in direct flight.

* Added aluminum bar as object for goal marker and creted button for drone to move to start position and another button for drone to start the experiment. In the current example the drone goes around a 2x2 meter wall.

* Added saving flag and functions for report (in c and cpp file)

* Added median kernel dimensions as options in settings

* Made unused waypoints invisible in the GCS

* Added two more objects for investigation (with a larger hole for the drone to fly through). Also fine tuned the code.

* Commit before change of depth image.

* Added 16 bit background processes for greater precision. Also change some funciton in C++ file to better handle 16bit images

* Using depht works, but its not fine tuned and code is messy.

* Ibligatory commit so that I can checkout a different branch.

* Added depth image on which edge detection is now based on (used to be based on disparity). It works relatively ok with all shapes investigated.

* A save after the experiments for the first repor thave been finalized.

* After demonstration

* Added code to toggle between p2DWedgeBug and p3DWedgeBug.

* Removed original files that were created during the previous merge process.

* Added background processes that works with a 16 bit disparity image (i.e. more precise distance measurement)

* Made finite state machine more readable. Also refined find_best_edge coordinates2 function. Additionally, added function to got from image place coordinates to camera coordinate using depth as input. Lastly, depth is now measured in cm when considerring the thresholds.

* Successfully integrated edge search over depth image instead of disparity image (tested in direct control mode only). Next step is to implement this for the guided mode.

* Addressed bug: The baseline used by the drone model was not the same as in the c file. This has been changed such that the baseline in the drone model now resembles the one in the c file.
By addressing this bug of the Bug algorithm the drone can now judge distances accurately. This in turn results in the drone being able to accurately avoid the wall (2mxm) obstacle.

* Changed flight plan to start experiment atuomatically.

* Just a checkpoint

* Added tree models.

* Removed non used objects from world file.

* Reverted back to opencv_bebop

* Reverted back to original files for push to master

* Added new shapes for experimentation

* Deleted blacklisted

* Cleaned code before push

* Added missing varibales and added declarations.

* Run style bash script and renamed image enum name (IMAGE_INT16)

* Corrected typos and delted unused control panel config file.
2020-07-17 18:53:28 +02:00
Gautier Hattenberger de3858cd4b Fix modules and telemetry freq (#2553)
* [generator] set prescaler at run/compile time for modules

* [generator] fix freq for periodic and cleaning

* [datalink] fix freq in datalink modules extra_dl and mavlink
2020-07-16 13:44:06 +02:00
Tom van Dijk a91ed27ec4 VL53L1X I2C level (#2554)
* Set vl53l1x default i2c level to 2V8 (instead of 1V8)

Co-authored-by: Tom van Dijk <tomvand@users.noreply.github.com>
2020-07-15 11:45:46 +02:00
Mohammad Jafar Mashhadi eeac31e1e4 Added try...except to be more safe after pprzlink api changes. (#2548)
* Updated pprzlink library to the latest version

* Added try...except to crazyradio2ivy.py to be safer after pprzlink API changes. paparazzi/pprzlink#117

* Updated request messages with the new pprzlink API

* Added a #noqa comment so linters won't remove the seemingly unused import.

* Updated the guided_mode_example.py to have a wait timeout.
2020-07-14 01:01:36 +02:00
Gautier Hattenberger 4575375876 [conf] cleaning some airframe files for CI builds (#2547)
mostly by moving modules from 'modules' to 'firmware' section, which
should be done in all airframe files now.
2020-07-07 15:24:44 +02:00
Tom van Dijk 1d966d1c1f FIX softI2C marking transaction complete before stop bit (#2549)
Fixed an error in the softi2c state machine that marked transactions
as success/failed before the stop bit was sent, causing potential
deadlocks when softi2c blocking functions are called in a tight loop.

Co-authored-by: Tom van Dijk <tomvand@users.noreply.github.com>
2020-07-07 14:49:09 +02:00
Freek van Tienen b9bf07b5ae [module] Controller for in the windtunnel to perform step inputs (#2510)
Co-authored-by: Christophe De Wagter <dewagter@gmail.com>
2020-07-07 14:46:49 +02:00
Gautier Hattenberger 09c0c8ccb9 Aircraft generator (#2545)
* [ocaml] massive update of the build process
convert individual code generator to a single process, parsing everything once and calling the required generators
- remove all subsystems makefiles
- fix module name
- example of radio file without ctl attribute

* [build] start with flight plan to make semaphore happy
* [ocaml] move the buffer outside the lazy block
for some reason, it seems to make problems with compilation server
Semaphore
it really makes no sense, but nevermind...
2020-07-05 21:38:09 +02:00
Ewoud Smeur e0a23a55c1 Compile EKF2 on chibiOS with cpp 11 (#2539) 2020-07-03 19:33:52 +02:00
Tom van Dijk 1cc01d4653 Eachine Trashcan support (#2540)
Co-authored-by: Open UAS <>
Co-authored-by: Tom van Dijk <tomvand@users.noreply.github.com>
2020-07-03 15:52:32 +02:00
Christophe De Wagter 94b1c3d24f System identification module (#2544)
Co-authored-by: Joost Meulenbeld <joost.meulenbeld@gmail.com>
2020-07-03 15:46:25 +02:00
Ewoud Smeur c118b0801c fixed ref reset on mode switch heading issue (#2536)
Just setting the ref attiude to the current one and the ref rate and
acceleration to zero should be pretty robust.
2020-07-03 15:44:33 +02:00
Christophe De Wagter dbbaced393 [module] servo_tester update: automatic sweep option (#2543) 2020-07-01 18:56:24 +02:00
Christophe De Wagter 9a149fbbd2 [chibios] Enable PWN Driver 4 when using SERVO 7AND8 on LISA-MX (#2542) 2020-06-30 15:21:34 +02:00
Gautier Hattenberger e227d5a5af [airframe] update twinjet airframe
10 years old, using a Tiny2, and still flying!
2020-06-29 14:27:06 +02:00
Hector Garcia de Marina 5993d39278 Erase dynamic sweep gvf (#2534)
* dynamic sweep erased
* remove not used header
* bug fixed 90/270 degrees
* code style
2020-05-27 16:42:30 +02:00
Roderick Tam 8b140c1db7 Instead of 'import commands' use 'import subprocess' as this is compatible with Python3. 2020-05-27 15:50:31 +02:00
joezie 4f62afe90a Navigation: fix calculations of ground speeds and navigation progress (#2532)
Fixes issue #2531
2020-05-26 11:14:29 +02:00
Gautier Hattenberger 9d9a0d175b mark as v5.17 devel until next release v5.17_devel 2020-05-15 11:58:52 +02:00
Gautier Hattenberger 3fb4ee4d55 stable release v5.16 v5.16.0_stable 2020-05-15 11:54:17 +02:00
Gautier Hattenberger 1d54969256 [fix] fix build with a proper config of WS2812 timer 2020-05-15 10:44:29 +02:00
pprz 019beedf86 [board] update ws2812 for apogee and tawaki 2020-05-15 09:56:22 +02:00
Gautier Hattenberger 022e6abed9 [driver] add pmw3901mb driver
correspond to the flow2 deck from bitcraze
update chibios SPI driver
tested on crazyflie and crazybee

merge and close #2529
2020-05-15 09:37:51 +02:00
IMAN SHIRDAREH 6e9df8bd09 Removing unneeded parenthesis (#2530) 2020-05-10 14:29:50 +02:00
Ewoud Smeur 45621705e4 execute calibration with python3 2020-05-05 22:53:10 +02:00
Ewoud Smeur 7a530723a0 adapt calibration script to python updates 2020-05-05 22:53:10 +02:00
Matteo Barbera 3559306dd8 Modified disco airframe used in flat spin landing experiment (#2525)
* Modified disco airframe used in flat spin landing experiment

* Added disco_modified.xml airframe to conf

* Removed unnecessary nav modules and sim defines, updated servo ThrottleHigh value

* Fixed ThrottleHigh() value
2020-05-04 10:11:53 +02:00
Ewoud Smeur ce4f35bbe4 Bebop2 flight delft (#2527)
* Flying a bebop2 outside in Delft

* tagged flying bebop2 airframe
2020-05-01 23:37:42 +02:00
Gautier Hattenberger b269f9cf27 [fix] give a proper ID for multiranger ABI message 2020-04-29 10:31:34 +02:00
Gautier Hattenberger cf5a989072 Multi ranger deck integration (#2524)
* [driver] factorize some vl53l1x function and use event loop

- the reading of data is still not blocking, but using the
  event loop to perform all reading transactions in a row instead of
  splitting them in several periodic calls
- move boot and reading sequence to the peripheral driver
- add an auto address increment option to support several sensors

[vl53l1] change boot return status to void

* [module] support for the multi-ranger deck for crazyflie

- add driver of the pca95x4 I/O expander
- read and publish data of the 5 vl53l1x sensor of the deck

* [conf] update config of crazyflie

- update example in Enac folder
- allow multi-ranger deck with forcefield module
- use same IMU defaults than original crazyflie settings

* [bug] syslink send_message buffer was 2 bytes too short

* [sonar] poll new data at 50 Hz
2020-04-22 18:00:48 +02:00
Ewoud Smeur 66a0f367a7 WLS VLA (#2523)
* simulation for bebop without act feedback

* Remove use of variable length arrays in WLS CA

Instead use defines to fix the length of arrays at compile time

* Use module conf to set control allocation size

By defining the control allocation problem size in the makefile section
of the module xml, there is no need to introduce a dependency on the
generated airframe file in the wls_alloc code

* Fix bebop simulation problem

Somehow the small inertia caused the drone to start upside down, maybe
some kind of overflow somewhere? In any case, this small change was
enough to do a simulation without issues...
2020-04-17 22:12:20 +02:00
Gautier Hattenberger e8037af520 [jsbsim] support of more recent jsbsim versions (#2520)
The development of jsbsim is now switch to git with an new active team.
The stable release v1.0.0rc1 has several fix and improvements, but
requires some modification from us to properly handle the type of file
path passed as arguments to load models.

Also, the default path when pkg-config is not found was /opt, which was
used in very early versions of NPS. The default is now /usr so that it
is compatible with a standard install of the new lib version.
2020-04-16 13:52:48 +02:00
Christophe De Wagter b53f085f1d [ground] Distance measuring during flight, Ubuntu18.04 update + time (#2521)
* [ground] Distance measuring during flight, Ubuntu18.04 update + time counter

* remove printf as this freezes pprzcenter

Co-Authored-By: Matteo Barbera <matteo.barbera97@gmail.com>

* remove printf

Co-Authored-By: Matteo Barbera <matteo.barbera97@gmail.com>

* line endings

* Fix distance counter to work with different number of messages

* Nicer code in distance coutner

Co-authored-by: Matteo Barbera <matteo.barbera97@gmail.com>
Co-authored-by: danielwillemsen <danielwillemsen@live.nl>
2020-04-12 16:17:38 +02:00
Tom van Dijk 0bc9009d72 VL53L1X laser ranger driver and sonar module (#2519) 2020-04-07 15:46:20 +02:00
Gautier Hattenberger 2908635efe [i2c] define gpio_port_t for lpc as well 2020-04-07 14:32:06 +02:00
Gautier Hattenberger f848aa1725 [board] GNU_SOURCE flag for beaglebone
should we really keep this board ?
2020-04-07 14:32:06 +02:00
Gautier Hattenberger de667ef302 [i2c] fix gpio port type to remove warnings 2020-04-07 14:32:06 +02:00
Gautier Hattenberger 6c288edd46 [i2c] remove warning for cast_qual in softi2c 2020-04-07 14:32:06 +02:00