Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(DO NOT MERGE) Faulty controller implementation #637

Open
wants to merge 374 commits into
base: main
Choose a base branch
from

Conversation

juniorsundar-tii
Copy link

Purpose

Trigger built for SITL with faulty flight-controller

Implements

Dynamic fault injection via parameters. Currently only affects the sensors:

  • IMU
  • Barometer
  • Magnetometer
  • GPS

Observe parameters:

  • SENS_<sensor_abbr>_FAULT
  • SENS_<sensor_abbr>_NOISE
  • SENS_<sensor_abbr>_SHIF
  • SENS_<sensor_abbr>_SCAL
  • SENS_<sensor_abbr>_DRIFT

To-do

Support more sensors and actuators

jlaitine and others added 30 commits October 26, 2023 12:48
…gnal

Sigaction lets us specify that only the wanted signal is handled with the callback

Signed-off-by: Jukka Laitinen <[email protected]>
In protected NuttX targets, uORB resides in both kernel- and userspace.
However, mmap is not a kernel space API, and must not be directly used
from kernel space, if MMU mappings are in use.

Why? Because when the kernel side uORB implementation calls mmap,
where would the mapping go ? Obviously it would be mapped to the
user shared memory virtual addresses, which is a no-no.

Fix this by implementing a very dirty, temporary workaround for kernel.
datawriters were not recreated in case of reconnection to agent.
Pub&Sub instances are cleared after connection lost is detected,
so they are forced to be recreated when connection is regained.
- Add/Modify UAVCAN module parameters to allow finer behavior control
- Expand UAVCAN mem pool block size
…rspace

MTIME register is mapped by MMU directly to user space; thre is no need to do the heavy IOCTL for it

Signed-off-by: Jukka Laitinen <[email protected]>
Instead of using a const value for USRIO_START, which fails when dynamic
linking is used (i.e. CONFIG_BUILD_KERNEL), obtain the location of MTIME
via syscall to the kernel side HRT.
…ed with different algorithms

This can be used e.g. for bootloader/table of contents creation or in crypto backend code

Signed-off-by: Jukka Laitinen <[email protected]>
…oesn't exist

This is only to resolve linking issues with bootloaders which don't use the random

Signed-off-by: Jukka Laitinen <[email protected]>
… use the PEM for signing in cryptotools.py

This harmonizes the generation and usage of keys. All keys can be simply generated as PEM files with openssl, and public key parts can be injected in DER format.

Signed-off-by: Jukka Laitinen <[email protected]>
In case where keystore backend is real HW, it may need deinitializing
in case it is used both in the bootloader and in PX4. Add the interface function for that.

Signed-off-by: Jukka Laitinen <[email protected]>
Makes it a bit simpler to select correct linker script(s) for each
build type.
…ices

This is more or less hardcoded module, which can be used as basis for
more advanced functionality later.

Signed-off-by: Jukka Laitinen <[email protected]>
…st in rcS

This is done only because rpnet is currently slow to start. Revert this change if/when
the rpnet startup issues are fixed

Signed-off-by: Jukka Laitinen <[email protected]>
Instead of starting the worker when a process is created, start it when
a call to a hrt service happens. This drops ~30 unnecessary threads from
the system, as most user processes use hrt only to obtain the system time.
… name for "sdcard" in board configuration

Signed-off-by: Jukka Laitinen <[email protected]>
Usage:
Define CONFIG_UXRCE_DDS_TOPICS_YAML="<name of new yaml file>" into
board specific .px4board config file.
Create/copy dds topics yaml file into board dir src/ directory.
 e.g. boards/px4/fmu5x/src/dds_topics_low_bw.yaml

Build log shows the used yaml file name:
 "microdds_client: use dds topics yaml: 'xxxxx'"
assert() does not work in px4 because it makes a release build that defines
NDEBUG for all source files, which in turn disables assert() tests.
jlaitine and others added 29 commits January 29, 2024 12:06
…ister in non-flat builds

Signed-off-by: Jukka Laitinen <[email protected]>
In the while loop condition check, take pending acked uorb messages
into account only in case we are not waiting for ack to the previous
acked mavlink message.
Fix a memory leak in uorb systemcmd

Signed-off-by: Jukka Laitinen <[email protected]>
TODO: squash with:
      808bc2d
          uORBManager: Manage the unhandled callback triggers properly at unregister in non-flat builds

Signed-off-by: Jukka Laitinen <[email protected]>
There is already a counter of how many times the callback semaphore has been posted
so there is no need to poll the semaphore value.

Signed-off-by: Jukka Laitinen <[email protected]>
The information is read and cached via uORB
Implements user space version of buffered console. Uses the /dev/console
device.

This fixes SD card flight logs in kernel mode.
Consider these as obsolete now

Signed-off-by: Jukka Laitinen <[email protected]>
build(deps): bump actions/checkout from 1 to 4
build(deps): bump docker/build-push-action from 3 to 5
build(deps): bump docker/metadata-action from 4 to 5

Signed-off-by: dependabot[bot] <[email protected]>
Instead of using a global perf list (that does not work in protected builds)
allocate the perf objects into shared memory.
Targets:
src/modules/uxrce_dds_client/dds_topics.yaml
"         "/sensors/vehicle_imu/VehicleIMU.cpp
"                             "/VehicleIMU.hpp
"                 "/sensor_params.c
"         "/simulation/sensor_baro_sim/SensorBaroSim.cpp
"                                    "/SensorBaroSim.hpp
"                    "/sensor_mag_sim/SensorMagSim.cpp
"                                   "/SensorMagSim.hpp
"                    "/sensor_gps_sim/SensorGpsSim.cpp
"                                   "/SensorGpsSim.hpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.