* Add jsbsim bridge to enable jsbsim for px4 SITL/HIL on jsbsim
This is a PX4 HIL/SITL integration into JSBSim. JSBSim is an open source flight dynamics model (http://jsbsim.sourceforge.net/)
Currently there are three models available which is the rascal, quadrotor_x, hexarotor_x integrated into the bridge.
The simulation can be run with the firmware with the following command for example
```
make px4_sitl jsbsim_rascal
```
The visualization is done flightgear and is done by the bridge sending UDP packets to flightgear. To disable the visualization `HEADLESS=1` when running the make command.
The simulation can be configured through the configuration files under the `config` directory through a xml file. Senor configurations, The xml file name should match the name of the model.
* Update Tools/sitl_run.sh
Co-authored-by: Beat Küng <beat-kueng@gmx.net>
Co-authored-by: Beat Küng <beat-kueng@gmx.net>
Nuttx now supports sh and source (.)
sh will open a new process for each invocation.
This means the child can not modify the parent
env. So we must use . to matain how nuttx worked.
Since rc.vehicle_setup is used in both we use
source and alis as we did with sh.
- moves process airframe deps to the tar generation, to ensure whenever
airframes are processed, the tar is extracted first.
This is required, because if the airframe processing is done on pruned
ROMFS, it's missing the tags.
- avoid using init.d/rcS in dependencies, use a separate file instead.
This is because pruning modifies the rcS, and the next rebuild was
seeing a changed rcS, resulting in unnecessary regeneration.
It loads the battery parameters but then overwrites them
with hardcoded values and it breaks the ModuleParams
parent/child hierarchy. Both is undesired.
* [WIP] i2c_spi_buses: add '-q' for quiet startup flag
And enable for optional board sensors.
* ROMFS: rc.sensors try starting all optional I2C sensors quietly
Co-authored-by: Daniel Agar <daniel@agar.ca>
- in practice this is mostly useful for identifying incorrect rotations
which we mostly have in 45 degree increments
- handling a vehicle on the ground can easily disturb one mag by more than 30 degrees, so this is often distracting noise
- the values of the parameters GND_MAX_ANG and GND_WHEEL_BASE are outdated. They belonged to another Rover setup.
- in the mixer file rover_diff_and_servo.main.mix the steering was controlled by roll, but in PX4 rover steering is controlled by yaw. And this was the reason why the attitude control did not work correctly
- the DF Robot GPX:Asurada rover has actual a steering angle of 60 degrees. And and wheel base of 0.17m. Parameter values in the airframe file are changed to this values
because we need to have SITL simulation as realistic as possible
compared to a real flight with default settings such that we
either fix the problems or adjust the defaults already in SITL testing.
- avoids the need for ekf2_timestamp publications by q and lpe
- adds logger to the lockstep cycle and makes it poll on ekf2_timestamps
or vehicle_attitude. This avoids dropped samples (required for replay).
- IMU integration move from drivers (PX4Accelerometer/PX4Gyroscope) to sensors/vehicle_imu
- sensors: voted_sensors_update now consumes vehicle_imu
- delete sensor_accel_integrated, sensor_gyro_integrated
- merge sensor_accel_status/sensor_gyro_status into vehicle_imu_status
- sensors status output minor improvements (ordering, whitespace, show selected sensor device id and instance)
Before #14212 the velocity control gains used in the multicopter
position controller were defined as a scale between velocity error in
one axis (or it's integral and derivative respectively) and the unit
thrust vector. The problem with this is that the normalization of the
unit thrust vector changes per vehicle or even vehicle configuration
as 0 and 100% thrust get a different physical response. That's why
the gains are now defined as scale between velocity error
(integral/derivative) and the output acceleration in m/s².
- skip avionics rail voltage check when USB connected
- skip forced reboot on USB disconnect if circuit breaker set
- avionics voltage preflight check don't silently fail if system_power unavailble
- explicitly set supply check circuit breaker (CBRK_SUPPLY_CHK)
This adds a sitl target and aiframe configs for the r1_rover, which is a differential rover example for SITL rover. The model is based on the aion robotics r1 rover
Only have it higher for VTOL and fixed wing.
Multicopter position controlled flight is in our experience always <1g.
Acrobatic flying definitely exceeds the acceleration but if control
doesn't rely on the GPS velocity and position there shouldn't be any
problem.
-decrease L1 period for tighter mission tracking in fw mode
- increase backtransition duration, we can now do this is we have active
deceleration control
Signed-off-by: RomanBapst <bapstroman@gmail.com>
@fury1895 reported very valuable feedback from testing
the acceleration feed-forward on VTOL:
> MPC_JERK_MAX 4.5 (from 5 on it felt too aggressive)
> MPC_JERK_AUTO 4
> some hovering, some transitions, and a mission. Everything good.
> I'd say you feel the difference in position mode and you see it in
> Auto modes. Great improvement!
rc.io is called from 2 places in rc.interface:
- if [ $OUTPUT_MODE = io -o $OUTPUT_MODE = uavcan_esc ]:
- 'set OUTPUT_MODE io' is only set within USE_IO=yes, so removing
the check in rc.io has no effect.
- in case of UAVCAN, we also want the IO for RC, now covered in the next
case.
- Further down ('Start IO for RC input if needed.').
This is intended to start IO for RC only, when fmu is already started.
However the previous check '$USE_IO = yes' in rc.io prevented that.
In addition we don't start rc_input in case of $USE_IO = no.
Fixes no RC on Pixhawk 2 with SYS_USE_IO=0.
* MC_HTE: unitialize with hover_thrust parameter
* MC_HTE: constrain hover thrust setter between 0.1 and 0.9
* MC_HTE: integrate with land detector and velocity controller
* MCHoverThrustEstimator: Always publish an estimate even when not fusing measurements. This is required as the land detector and the position controller need to receive a hover thrust value.
* MC_HTE: use altitude agl threshold to start the estimator
local_position.z is relative to the origin of the EKF while dist_bottom
is above ground
Co-authored-by: bresch <brescianimathieu@gmail.com>
The implementation before this change had two timeouts, a hard-coded
timeout of 0.5 seconds as well as a by param configurable timeout with
certain failsafe actions set.
This change aims to fix two problems:
1. The hard-coded offboard timeout can be triggered easily with sped up
lockstep simulation. Since i t is hard-coded it can't be adapted to
the speed factor.
2. The offboard signal can time out but no action will be taken just
yet. This means we end up in an in-between stage where no warning or
failsafe action has happened yet, even though certain flags are set
to a timeout state.
This patch aims to fix this by unifying the two timeouts to the existing
configurable param. The convoluted double timeout logic is replaced by a
simple hysteresis.
For anyone that has previously not changed the default timeout param (0),
the param will now be changed to 0.5 seconds which reflects the
previously hardcoded time. For anyone with a specific timeout
configured, the behaviour should remain the same.
Also, going forward, timeouts lower than 0.5 seconds should be possible.
Sometimes in CI for VTOL we saw disarms before the spoolup and ramp were
over and the takeoff would actually happen. By raising the auto-disarm
time we should be able to work around this and get CI less flaky.
Channels belonging to a certain timer were not all grouped together.
This is required by the .first_channel_index and .last_channel_index data
members.
We introduce a new mixer geometry to solve the problem.
* add support for unmanned underwater vehicles:
* airframe uuv_generic + uuv_hippocammpus including mav_type = 12 for submarines
* mixer for UUVs with X-shaped thruster setup similar to quadcopter
* add module uuv_att_control for underwater robot attitude control
* add rc.uuv_defaults/apps for autostarting e.g. ekf2 and uuv_att_control app