288 Commits

Author SHA1 Message Date
Christophe De Wagter 15accba262 Fix ahrs_int_cmpl_quat in NPS simulation by updating state input filters in sim_overwrite_ahrs (#3611)
Issues due date / Add labels to issues (push) Has been cancelled
Doxygen / build (push) Has been cancelled
2026-03-05 11:19:28 +01:00
Fabien-B e2c11a4265 [sys_time] sys_time cleanup (#3580)
Issues due date / Add labels to issues (push) Has been cancelled
Doxygen / build (push) Has been cancelled
2026-02-03 13:00:54 +01:00
Gautier Hattenberger 37a86bb389 [indi] rewrite indi stabilization and guidance for modularity (#3565)
Issues due date / Add labels to issues (push) Has been cancelled
Doxygen / build (push) Has been cancelled
This PR allows to redefine the outer-loop for stabilization and
guidance, and to specify the guidance model for something else than a
quarotor (but still not an hybrid).
Two use case are proposed:
- replace the PD control of the outer-loop (still used by default) by
  and Hinfinity controller
- parametrize the guidance for an hexa-copter with tilted motors,
  allowing to produce side force for lateral motion control.
2026-02-02 18:41:03 +01:00
Gautier Hattenberger 41048101d0 [rover] improve support for ROVER firmware (#3530)
Issues due date / Add labels to issues (push) Has been cancelled
Doxygen / build (push) Has been cancelled
- possibility to use basic PID with steering rover
- fix navigation
- add support for mission mode
- fix simulator (orientation was wrong, leading to opposite steering
  between sim and reality)
- add support of 2 wheels rover in simulation
- add and update config files
2025-09-30 08:54:06 +02:00
NoahWe 92531947d6 update jsbsim wmm (#3458)
Doxygen / build (push) Has been cancelled
Issues due date / Add labels to issues (push) Has been cancelled
2025-05-26 13:49:17 +02:00
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
Gautier Hattenberger 1e50fb70ce [state] fix bug when checking if airspeed is valid (#3434)
Doxygen / build (push) Has been cancelled
Docker update / build_docker_image (push) Has been cancelled
Issues due date / Add labels to issues (push) Has been cancelled
It is currently clearing the flags instead of checking them.
Also remove the direct airspeed update from NPS, use ABI message only.
2025-02-21 01:13:25 +01:00
Gautier Hattenberger dfd8e93927 State interface input filter (#3409)
* [generator] generate unique ID and names table for modules
* [state] add accessors for the state origin
* [state] don't access directly to state origin, use getters
* [state] filter inputs with module ID
* [ahrs] convert AHRS modules to state input filter
- selection of ahrs with settings from each module
- init functions for each ahrs modules
- remove old chimu
* update unit test
* [ins] decoupled INS implementation
To allow multiple INS at the same time:
- remove weak functions from ins.c
- remove the INS_TYPE_H define
- use ABI message to trigger INS reset
* [state] protect for c++
2024-12-03 22:34:27 +01:00
Gautier Hattenberger 45abdefc86 [sonar] protect sonar reading by mutex for bebop (#3408)
Both ABI and telemetry messages are not thread-safe and should be
protected by mutex.
Simulation of sonar is handled by NPS.
2024-11-08 15:06:31 +01:00
Tomaso Maria Luigi De Ponti 6c8c6f118b Additional changes to use commands instead of actuator_pprz (#3330)
* first push

* Remove redundant logic
2024-07-22 15:56:31 +02:00
Tomaso Maria Luigi De Ponti 50694ba217 Use Commands instead of actuator_pprz (#3265)
* Add actuator type attribute to command

* Implemented new command based counting of the atuators in the oneloop controller

* Added group attribute to dtd file. Initialize as empty subgroup count of commands. Avoid unnecessary array to list conversion.

* Generate list of names from defined commands

* Use the defined commands number and  name in NPS

* Update sw/tools/generators/gen_airframe.ml

Co-authored-by: Gautier Hattenberger <gautier.hattenberger@enac.fr>

* Added logic to remove redundant code

---------

Co-authored-by: Gautier Hattenberger <gautier.hattenberger@enac.fr>
2024-04-16 23:06:23 +02:00
Gautier Hattenberger fe35af7382 [nps] fix inconsistent sensor scaling in simulation (#3230) 2024-01-29 16:19:05 +01:00
Christophe De Wagter 94c79d42ca Cleanup airframes: make test_all_confs (#3217) 2023-12-18 21:51:01 +01:00
Gautier Hattenberger 41451d5422 [sim] moving the old ocaml simulator to NPS (#3167)
- the exact same basic model is now a NPS FDM
- sim target still woks, it is just an alias to NPS with the proper FDM
- the old ocaml files are removed
- AHRS and INS are bypassed, since the accelerations are not well calculated by the model
2023-11-07 10:21:12 +01:00
Gautier Hattenberger 4ae40567ed [hitl] rewrite support for hardware in the loop simulation (#3146)
- old way (based on ins_vectornav) is not supported anymore
- directly send sensor data and receive commands with a dedicated link
- examples with USB link for better results
- update sphinx documentation
- compilation in a single build
2023-10-31 14:48:55 +01:00
Freek van Tienen b9564ddffc [nps] Fix NPS compile warnings 2023-05-12 13:38:03 +02:00
Fabien-B 2a98d9fb69 Add PyBullet FDM for nps. (#3024) 2023-04-16 22:10:53 +02:00
Gautier Hattenberger 0b1ce4679e [nps] variables in nps_main should be extern (#2933)
fix #2932
2022-10-21 11:15:56 +02:00
Freek van Tienen ff37e63af4 [imu] Fix new imu structure 2022-09-20 14:37:58 +02:00
Jesús Bautista Villar 4d4fbc2852 Rover steering wheel (#2845)
* Steering wheel rover main files and guidance

* Fix: Undeclared function nav_reset_alt warning

* GVF mission flight plan

* NPS FDM for rovers

* GVF low_level_control.c included in gvf.c

* Rover main loop for non chibios arch (copy/paste from rotorcraft)

* Delete conf/modules/rover.xml

The creation of this file was a mistake.

* NPS for rover fixed

* rover_guidance_steering periodic -> autopilot state machine

* Fixes and comments
2022-03-24 15:31:12 +01:00
Gautier Hattenberger e436d78c84 [autopilot] merge AP and FBW in normal operation (#2828)
There is no longer a separated FBW in normal operation for fixedwing,
only a single AP task/thread.
The code for main_ap is now factorized for all firmwares.
Dual MCU support (separated AP and FBW) is still possible, based on the
rotorcraft implementation and intermcu pprzlink messages. Relevant code
is also factorized and available in all firmwares.
The recovery mode (in case of hard fault) is still available for
fixedwing with ChibiOS implementation.
Only intermcu_uart is supported at the moment. Other options (spi/can)
might be added back in the future if really used.

Some other evolution are made:
- in the radio_control and actuators modules, now integrated to AP and
using ABI messages
- the message parsing on datalink event (defined in module) that is now
properly filtering the messages based on their class and allowing to
have multiple callbacks for the same message
- cleaning the part of code that were using the old intermcu fixedwing
interface
2022-03-10 14:21:04 +01:00
Gautier Hattenberger 05de94932c [fix] protect ivy operations with mutex in nps (#2835) 2022-03-09 11:26:35 +01:00
Tom van Dijk f9ca2ff410 Fix #2807 inconsistent coordinate transform in nps_fdm_gazebo (#2808)
* FIX #2807 by using pprz geodetic transformations instead of Gazebo's

* Cleanup

* Remove outdated section in nps_fdm_gazebo

* (WIP) clean up position transform and change to double accuracy

* Replace fdm_gazebo's spherical functions by paparazzi's

Co-authored-by: Tom van Dijk <tomvand@users.noreply.github.com>
2022-01-18 11:16:46 +01:00
Gautier Hattenberger e075daf06f [module] wind estimation from quadrotor motion (#2800)
- add a generic linear kalman filter lib
- add a quad model with linear drag and simplified for recent jsbsim
- add example frame and noisy NPS sensor config

see "Estimating wind using a quadrotor" in IMAV2021 proceedings
2021-11-28 22:24:44 +01:00
Gautier Hattenberger eef2792d39 [modules] move datalink from subsystems to modules 2021-11-13 00:48:14 +01:00
Gautier Hattenberger 304f957a0b [modules] move actuators from subsystems to modules 2021-11-13 00:48:14 +01:00
Gautier Hattenberger f7e16fce9b [modules] move INS from subsystems to modules 2021-11-13 00:48:14 +01:00
Gautier Hattenberger 246de70255 [modules] move AHRS from subsystems to modules 2021-11-13 00:48:14 +01:00
Gautier Hattenberger 7408724495 [modules] move IMU from subsystems to modules 2021-11-13 00:48:14 +01:00
Gautier Hattenberger a4632c33ca [modules] move gps from subsystems to modules 2021-11-13 00:48:14 +01:00
Gautier Hattenberger f638a40b83 [modules] move radio control to modules 2021-11-13 00:48:08 +01:00
Gautier Hattenberger 6694dd4e72 [modules] move ABI interface to modules 2021-11-13 00:46:56 +01:00
Gautier Hattenberger 491aefb45c [modules] move commands from subsystems to modules 2021-11-13 00:46:45 +01:00
Gautier Hattenberger b7d18eef9b [modules] move electrical subsystem to module 2021-11-13 00:46:45 +01:00
Gautier Hattenberger 10d59311a2 update various code for errors and warnings or fit reorg 2021-07-27 13:34:23 +02:00
Ewoud Smeur 3b4ce8232e Cyclone guidance code (#2533) 2020-07-27 15:35:26 +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
OpenUAS 4b23c592e5 WMM updated for 2020-2025 period (#2485) 2020-02-07 11:46:56 +01:00
Gautier Hattenberger ba283792a0 Bug fix imav2019 (#2462)
* [bug] fix takeoff detect

error in detection logic, introduced in #2319

* [bug] conf by name and id should not be 'property' methods

* [nps] don't send DL_VALUE message when datalink is disabled

* [rtcm] add timer between message sending to prevent buffer overflow

part of #2407 ongoing work but seems necessary for proper operation with
RTK modules
2019-10-08 10:33:01 -07:00
Kirk Scheper 0391b4df26 [nps][bebop] update gazebo sim camera (#2383)
This pull request updates the Bebop camera simulation in order to work with the new defines and settings from #2364. It also includes a number of small fixes by @kirkscheper .

The new setup renders the entire camera sensor, which allows the crop and zoom settings to be changed at runtime just as on the real drone. The resolution of the simulated sensor can be reduced for better runtime performance.

----

* update gazebo sim camera

* WIP Revert Bebop SDF cam hfov to 3.0, TODO update to full sensor size

* WIP mt9f002.c remove OUTPUT_SCALER comment

* WIP FIX image.c casting problem

vectors.pos is now cast to float to prevent unwanted implicit
casting to uint. I did not change the point_t types as I
do not have time to test this, but this would be a good idea for a later
pull request.

* WIP lucas_kanade.c comment keep_bad_points

* WIP opticflow_module.c replace memcpy with assignment for readability

* WIP nps_fdm_gazebo fix mt9f117 check for bottom_cam instead of front_cam

* WIP nps_fdm_gazebo do not set env_texture_size

The current size (2048) is probably large enough for all
realistic ZOOM settings.

* WIP ERROR nps_fdm_gazebo fix camera, corrupt image in gazebo :/

* WIP ERROR zoom is not tuneable at runtime :/

* WIP fixed sensor resolution in gazebo

Since the zoom should be adjustable at runtime, the zoom factor
will need to be implemented in the image sampling routine,
it cannot be set beforehand in the bebop model.

* WIP include mt9f002.c and mt9v117.c in NPS

Added simple wrapper files to prevent overwriting the video_thread_nps.c ones.

* WIP enable runtime zoom and offset changes for mt9f002 in NPS!

Zoom and offset settings can now be adjusted at runtime just like
on the real drone. The mt9f002.c code handles the bounds checking
etc.

* WIP take out string comparison in read_image

* WIP ignore GCC errors that do not appear in compilation for ARM

Might be better to actually fix these errors, but I am not familiar
with that part of the code.

* WIP remove todo file

* FIX ardrone2_gazebo build error

linking error was caused by undefined reference to mt9f002 struct
(which is not used in the ardrone). Removing the NPS MT9F002 define
means that this struct is always linked, even though it may not be
used. To fix, I added an empty `__attribute__((weak))` struct that
prevents these linking errors, but could cause unexpected behavior
when a Bebop model or other model with mt9f002 camera is used
without the bebop_cam module.

* FIX naming conflict after merge

* FIX Allow arbitrary simulated sensor sizes for runtime improvement

The FDM can now handle arbitrary sizes for the camera sensor.
This allows the sensor size to be reduced from the real-world
4608x3288 to a lower resolution to reduce rendering times, at
the cost of lower-resolution images.

The downscaling of the sensor is controlled using the
`NPS_MT9F002_SENSOR_RES_DIVIDER` define.

* Update Bebop 2 gazebo models for new front- and bottom cam code
2019-06-17 10:39:51 +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
Tom van Dijk 2430b31f0f [gazebo] add ROS support and sonar sensor (#2399) 2019-02-28 09:58:12 +01:00
Kirk Scheper 70d221ed62 upgrade voltage and current to float (#2360)
merged with https://github.com/paparazzi/pprzlink/pull/95
2019-01-15 18:26:07 +01:00
Kirk Scheper a88bbac7eb Update gazebo from v7 to v8/v9 compatibility (#2357)
* update gazebo from v7 to v8/v9 compatibility

* upgrade docker
2018-11-28 11:03:41 +01:00
Michal Podhradsky 4673d710f8 Indicate when HITL is not getting AP data (#2353) 2018-11-26 12:42:41 -08:00
Christophe De Wagter 95cf154618 Camera intrinsics are not initialized for Gazebo (#2338)
* Camera intrinsics are not initialized for Gazebo

* Also update fps in MT9F002 mode
2018-10-04 19:30:13 +02:00
Gautier Hattenberger 2298c2b391 global fix of current warnings and errors in CI server (#2341) 2018-10-04 19:09:05 +02:00
Michal Podhradsky 929438c1eb Minor stylistic fixes in vectornav and nps (#2321) 2018-09-09 10:49:58 +02:00
Gautier Hattenberger 5d6e783824 [sensors] airspeed and incidence sensors use ABI
- state interface is not updated directly, it should go through air_data
  or eventually some INS filter
- NPS is updated as well
- tas_from_eas (air_data) takes at least the altitude into account (not
  temperature) when direct measurements of P and T are not availble
2018-09-05 15:43:20 +02:00
Kirk Scheper b9d3ea4ac3 added agl estimator when assuming non flat ground (#1910)
* added agl estimator when assuming non flat ground

* add documentation and expand message

* update pprzlink
2018-07-25 23:06:47 +02:00