Commit Graph

81 Commits

Author SHA1 Message Date
Jesús Bautista Villar 4ee8e5e1b9 [gvf] Refactor GVF module framework, add GVF_IK, fix bugs, and provide full example config (#3451) 2025-05-16 22:00:28 +02:00
Angel-HF e089fd48f7 Implement classic GVF for rotorcrafts (#3327)
* [modules] implemented GVF for rotorcrafts

* Note about Crazyradio communication with Crazyflies
2024-07-12 17:44:01 +02:00
Freek van Tienen fd3479c2d7 [conf] Fix build warnings and small bugfixes 2023-09-18 12:09:49 +02:00
Gautier Hattenberger 28ef30ed80 Nav rotorcraft rework (#2964)
This is a complete rework of the navigation for rotorcraft with the key features:

- all nav functions and interface in float
- nav function are registered (decoupling between nav API and implementation of standard pattern)
- submodes to specify if setpoint is a position (legacy), speed or accel (better integration of algorithms like GVF)
- guidance (H and V) is reorganized with default function to implement (run_pos, run_speed, run_accel) 
- guidance control (the old default PID) is separated from the guidance logic

---------

Co-authored-by: Freek van Tienen <freek.v.tienen@gmail.com>
2023-03-02 22:15:23 +01:00
Freek van Tienen 2a0dba4025 [chibios] Add STM32H7 (#2859)
* [chibios] Add STM32H7

* [chibios] Update to latest version

* [chibios] Cleanup board configuration

* [chibios] Cleanup peripheral drivers

* [chibios] Fix bootloader interrupt vector done inside ChibiOS

* [sdlogger] Enable RTC by default

* [chibios] Fix DMA buffers SPI/I2C

* [formatting] Fix formatting/styling of files

* [chibios] Change PWM configuration (small fixes i2c and makefile)

* [chibios] Generic board files

* [boards] Fix apogee board

* [conf] Cleanup airframes and remove Navstik board
2022-05-18 17:38:58 +02:00
Gautier Hattenberger addc8d051c [cleaning] removing some old stuff (#2696)
* [cleaning] removing some old stuff

- infrared sensors and related ahrs
- mkk and asctec actuators
- old carto modules
- fix bebop actuators for NPS
- clean airframe and conf

* [conf] add back asctec_v2 actuators that is still being used
2021-04-16 17:56:16 +02:00
Gautier Hattenberger 4c1785d00b [cleaning] drop support of LPC21 boards and related conf (#2695) 2021-04-14 14:05:17 +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
Freek van Tienen 009b121cfd [ins] Add EKF2 from the PX4 ECL library (#2402)
* [abi] Add timestamp to AGL and BARO_ABS

* [make] Add support for c++0x for all architectures

* [math] Add air density calculation

* [gps] Add horizontal and vertical position accuracy

* [boards] PX4FMU change default baudrate and add SBUS

* [ins] Add EKF2

* [tests] Add Bebop2 with EKF2

* [nps] Fix jsbsim simulator initialisation and GPS accuracy
2019-04-12 23:12:31 +02:00
Gautier Hattenberger 26b66809b0 Conf cleaning (#2327)
* [cleaning] remove PBN module
* [cleaning] remove ENOSE module
* [cleaning] update ENAC conf

* Cleaning on flight plans

* [cleaning] clean example and test conf

* add gazebo to the install step and compile example airframe
2018-09-27 11:15:27 +02:00
kirkscheper 53f78c4492 updated hff to accept velocity as only input and add bias 2017-10-18 23:01:36 +02:00
kirkscheper e9ff78ad00 Fix optical flow nans when using feature management 2017-10-18 22:58:08 +02:00
knmcguire f400d5748f Flight plan example for autopilot mode guided (#2101)
Use flight plan state machine to control a rotorcraft in guided mode.
Also use ABI messages to send color detection information.
2017-08-23 18:19:32 +02:00
tomvand 9d1e71b1ea Add Gazebo simulation to NPS (#2069)
* Setup code for Gazebo

Currently only partially initializes the fdm struct, which produces
incorrect results in the GCS.
Compilation, however, already seems to work as expected!

Next step is to fetch data from Gazebo.

* Closed-loop flight in Gazebo

Finished the first implementation of the Gazebo FDM. It is now possible
to perform closed-loop flights using Paparazzi together with Gazebo.

Look at the example_ardrone2.xml airframe file for the required gazebo tags.
The following modifications are made:
- change fdm type to "gazebo"
- add definitions for ACTUATOR_THRUSTS and ACTUATOR_TORQUES. These were
  obtained from the JSBsim ardrone model. The oredr is the same as the
  ACTUATOR_NAMES.

The Gazebo world needs an aircraft model that is (by default) named
"paparazzi_uav". This model should include links with the names listed
in ACTUATOR_NAMES in the airframe file, as these are used to apply
forces on the quadrotor.

Known bugs:
- No fixed wing aircraft yet.
- Not all fields in the fdm struct are set. Most of the atmosphere
  fields are not implemented yet.
- AHRS and INS need to be bypassed, these do not yet work correctly.
- No quadrotor models are supplied with paparazzi yet (although it is
  included in the example world file).

* Added cameras, but sensor update causes crash

As in the quick standalone examples, gazebo regularly crashes when
cameras are used.

This is an intermediary commit where most of the camera infrastructure
is present, but not functional yet because of an unknown bug regarding
Gazebo.

* Simplified problem, located crash

Crash occurs when gazebo::sensors::run_once() is called during
the fdm update step. The exception (Ogre internal exception,
cannot create GL vertex buffer) only occurs after the main loop
has been performed a few times (10-20x typically).

Ignoring the error by catching the exception does not make it go
away.

* Add ogre to fdm_gazebo makefile

* Further changes for debugging, not fixed yet

* FIX bug

Turns out that fdm_init and fdm_run_step are not running in the same
thread, which apparently caused some problems with Gazebo.

The gazebo initialization code that starts the server is now moved
to the run_step function, and cameras work fine now.

Next step is to get the images from Gazebo to the video_thread_nps module.

* Transport images to Paparazzi

Added code that converts Gazebo's RGB888 images to Paparazzi's
YUV422 format, and calls the registered video callbacks.

* Finish video streaming

Finished video streaming. Video streaming in the paparazzi master
branch does not seem to work in simulation or even on a real ardrone.
Therefore, reverted to v5.10 viewvideo.c and rtp.c and now the streaming
works correctly.

* Separate UAV model from world.

Added a models/ directory to conf/simulator/gazebo, now the UAV model
can be included in the world file. The models/ dir is added to Gazebo's
search paths when the server is launched, so it does not require
any additional steps from the user.

* Move Gazebo modifications from examples/ardrone2.xml to examples/ardrone2_gazebo.xml

Reverted changes to the original airframe and moved these to a
separate example.

* Remove .sdp file

Remove .sdp file that should not have been included with commits.

* Move changes in conf_example.xml to separate entry

Moved the changes to conf_example.xml (selected flightplan, modules etc.)
to a separate etry named 'ardrone2 (Gazebo)'.

* Clean up changes to computer_vision module

- Removed unused viewvideo_nps.c.
- Add doc comments in video_thread_nps.c

* Fix bug in conf_example

Spaces in aircraft name caused compilation error, changed to
'ardrone2_gazebo'.

* Fix duplicate ac_id in conf_example

* Remove debug code from nps_fdm_gazebo.cpp and add comments

* Reduce weight of cameras

Cameras weighed 10 grams, which was quite much. Now reduced to 1 gram.

* Fix camera not active

During the cleanup of the ardrone gazebo model, the always_on tag
was removed. Now, the cameras are activated during gazebo_video_init

Also removed further debug code from nps_fdm_gazebo.cpp.

* Restore master branch video streamer and rtp encoder

The streamer of the master branh does not work correctly atm, but
this will be moved to a separate issue.

* Fix compilation warnings

Fixed all compilation warnings (tested with Gazebo 8).

Unused arguments are now marked as such.

The NPS makefile is modified to use CXXFLAGS in addition to CFLAGS,
which solves the std=c++11 related warnings.

fdm_gazebo.cpp now ignores deprecated warnings, as all of these
come from Gazebo. Not the cleanest solution, but it works for now.

* Add documentation to fdm module xml and add copyright notices where appropriate

* Fix code style

Fixed code style using the tool included with paparazzi.

* Fix missing model.config

.gitignore caused the model.config files for the Gazebo models to
be excluded from the commit. Added an exception to .gitignore and
added the missing file.

* Fix INS by adding placeholder atmospheric data values

Added placeholder values to the atmospheric section of the NPM
struct. These should be valid for low altitude, low speed flights.

Previously, these values were uninitialized which caused INS to fail
(incorrect altitude estimates). With these placeholder values,
the INS works ok and no longer needs to be bypassed.

* Fix makefile targets in video_rtp_stream and cv_colorfilter

(Re)added target="ap|nps" attribute to the module .xml files.
2017-06-13 22:12:11 +02:00
Michal Podhradsky de58bd52ac Added AggieAir airframes 2017-05-06 09:59:36 -07:00
Felix Ruess d9b1cd21f6 [conf] fix Quad Navstik and update some settings 2017-01-29 11:47:35 +01:00
Gautier Hattenberger 61ec3e302f [conf] update settings in test and demo conf files 2017-01-10 21:11:11 +01:00
Felix Ruess fb4d3f42af [rotorcraft] re-use main timer if PERIODIC_FREQUENCY == MODULE_FREQUENCY (#1971)
Use the main periodc freq timer for modules if the freqs are the same
This is e.g. useful to log the important values every time the control loop runs.

should fix #1923
2016-12-16 17:22:32 +01:00
Felix Ruess 8cd43d40e3 [conf] update settings_modules
to avoid annoying reodering changes when opening a conf is opened in Paparazzi Center
2016-12-15 00:34:46 +01:00
Christophe De Wagter aa3294cd4e [servo_switch] -> module name=switch type=servo|uart 2016-10-14 21:26:44 +02:00
podhrmic fe5500811f Airframe fixes 2016-10-06 17:48:35 -07:00
Felix Ruess eca3d3b229 [conf] update settings_modules in example confs 2016-09-26 20:38:14 +02:00
Felix Ruess 82b9b52fed [conf] update confs for removed settings 2016-09-20 14:21:13 +02:00
Felix Ruess 17d32772c0 [imu] convert imu subsystems to modules (#1788)
* [imu] convert imu subsystems to modules

Also
- get rid of explicit imu init|event|periodic calls in main
- each imu implementation has their own imu_x_init/event/periodic

* [imu] fix some imu modules

* [imu] fix bad paths

* [imu] add imu_common module that every implementation autoloads

and put body_to_imu settings in imu_common module

* [imu] fix imu_ardrone2

* [conf] add imu_common settings module in conf_example and conf_tests
2016-08-12 12:02:38 +02:00
Felix Ruess 62544b28c9 [conf] update settings to loaded modules 2016-07-01 11:55:02 +02:00
Deon Blaauw f1f75e96b8 Hybrid guidance code for hybrid drones (#1769)
This pull request is for the guidance algorithms used to control hybrid drones like the Quadshot and MavShot. It supports autonomous waypoint navigation as well as "forward-flight". The code was flight tested in autonomous waypoint navigation mode, including autonomous landing (using sonar).
2016-06-30 21:51:52 +02:00
Felix Ruess dfa6678b6c [conf] commit reordering done by pprz center 2016-06-16 19:42:45 +02:00
Roland Meertens a32b8fb6fb Dual video thread solution (#1648)
This pull request allows you to use both the front camera and the bottom camera on the bebop, and to run optical flow on the bottom camera while running something else on the front camera. 

- modules can call cv_add_to_device(&camera, fun) to register the callback fun for the specified camera with the video thread
- use a linked list with listeners for the video
- saving jpeg encoded shots is now in a separate video_capture module
2016-06-01 12:15:44 +02:00
Michal Podhradsky 75f8e34e51 Skid landing (#1669)
Skid landing navigation routine.
Comes with an optional landing control for vertical control system
I did test the build at a localhost.
2016-05-26 15:37:17 -07:00
Felix Ruess 48b0dbd3bd [conf] update settings_modules in some confs 2016-04-21 01:00:18 +02:00
Felix Ruess ae2e9fa524 [conf] fix nps.makefile 2016-03-09 14:59:58 +01:00
Felix Ruess dbe0aae9f2 [conf] add air_data to some examples 2016-03-09 14:21:17 +01:00
Felix Ruess 8956cea922 [conf] update easystar_ets example
switch to Lisa/MX with IMU and add NPS target
and convert subsystems to modules
2016-03-07 15:24:35 +01:00
Freek van Tienen 36f2727c16 [conf] Update INDI settings file 2016-01-28 10:10:23 +01:00
Freek van Tienen 93959f5080 [conf] Remove unused rate controller and settings 2016-01-27 17:23:23 +01:00
Freek van Tienen a3a641c1ee [stabilization] INDI rewrite and rate control 2016-01-27 17:23:23 +01:00
Freek van Tienen 5138012e3f [parrot] Fix Bebop 2 rotation of Magneto and tuning 2015-11-24 14:04:08 +01:00
Freek van Tienen 25b947558a [conf] Add bebop 2 as example 2015-11-19 01:19:08 +01:00
Felix Ruess 43c62e64d5 [conf] add nps settings to example/test aircrafts 2015-09-12 16:19:37 +02:00
Felix Ruess f2a0bd56a3 [conf] update settings_modules in conf example and tests 2015-09-04 22:58:49 +02:00
Christophe De Wagter d016d46d84 [conf] Cleanup 2015-08-24 16:25:35 +02:00
Felix Ruess 2a04e5b5a4 [conf] fix ac_id for setup_elle0 2015-08-13 15:25:28 +02:00
Piotr Esden-Tempski 6a712d24cd [ELLE0] Added ELLE0 example airframe and sutup files. 2015-08-11 20:21:19 +02:00
Freek van Tienen b143548515 [conf] Fix navstik INDI config 2015-08-07 17:39:53 +02:00
Felix Ruess 0536b76f99 [conf] update settings in example/test confs 2015-07-30 13:55:22 +02:00
Felix Ruess f5c68c569b [airframes] some more cleanup 2015-07-25 10:38:43 +02:00
Felix Ruess 0eae573174 [airframes] move parrot airframes to examples/untested subdirs 2015-07-24 15:50:00 +02:00
Felix Ruess 978954a294 [conf] ups, bebop example aircraft uses normal bebop airframe 2015-07-22 13:14:04 +02:00
podhrmic ea77d1a395 [conf] Aiframe cleanup
- unused airframe xml files fronm conf_example and conf_test.xml were moved to untested folder

closes #1249
2015-07-21 23:28:49 +02:00
Felix Ruess d6a7562c00 [airframes] use standard motor mixing types for some quads
This will change the effect of the gains (depending on the type), but should be finally correct.
Especially the yaw commands have about half the effect now...
2015-07-21 14:24:09 +02:00