we now use optional args to give
ActuatorEffectivenessTiltrotorVTOL::updateSetpoint the necessary info
about the preflight check. All the other
ActuatorEffectiveness*::updateSetpoint functions can be used exactly
like before, by ignoring the optional arguments.
Rather than the previous solution of setting a member variable only when
_actuator_effectiveness is an instance of
ActuatorEffectivenessTiltrotorVTOL, this also allows us to lose the ugly
dynamic_cast (poor cpp man's instanceof).
the other dynamic_cast is replaced by checking _effectiveness_source_id
which should be equivalent.
Previously, the approach to modify collective tilt control was to send
the corresponding tiltrotor_extra_control uOrb message from
ControlAllocator, which then influences
ActuatorEffectivenessTiltrotorVTOL with minimal changes.
This was a bit hacky and introduced potentially conflicting uOrb
messages. So, with this new approach we pass the same information via
argument.
Specifically, the class ActuatorEffectiveness now declares
updateSetpoint with an extra argument, preflight_check_running. It is
only used in ActuatorEffectivenessTiltrotorVTOL, but has to be included
as a "dummy" in all other classes inheriting from ActuatorEffectiveness.
The argument can be used to bypass the collective tilt/thrust setpoints,
instead replacing them with values from public class member variables
which can be set from outside just before calling updateSetpoints.
Also, slight refactor in ControlAllocator by splitting up the functions
related to the preflight check into smaller parts
this adds a new flag to ActuatorEffectivenessTiltrotorVTOL:
_preflight_check_running. We set it from ControlAllocator, and if true
we always add collective tilt to the actuator setpoint.
previously it would always change _user_mode_intention to
_prev_nav_state forever. now we change it only if we are in preflight
check mode to not interfere with anything else later.
- currently triggered via param COM_DO_CS_CHECK. ultimately this will
be replaced by a mavlink cmd
- new VehicleStatus.nav_state, NAVIGATION_STATE_CS_PREFLIGHT_CHECK.
this is how commander tells ControlAllocator to conduct the check
- (todo) within ControlAllocator we overwrite torque setpoints to do
the check. additionally we can also control servos directly from
there, in a different mode if that is needed.
This fixes a race condition when switching from a flight mode that is
not a flight task (e.g.: stabilized). In this case, the reset counters
were initialized to 0 and deltas were applied to the first setpoints if
the EKF had any of its reset counters different from 0.
* ark: v6x: disable net binary config, update default net config
* added back CONFIG_IPCFG_BINARY=y
---------
Co-authored-by: Alex Klimaj <alex@arkelectron.com>
To simplify logic for wrap-around cases and cases in which bins outside the FOV may be filled. Bin indices are offset such that the 0th bin is the first bin within the sensor FOV. This way we can always fill bins from smallest to largest index.
These functions help simplify repeated calculations accross driver and collision prevention files that are computing bins, angles and sensor offsets in obstacle maps.
The current approach was wrong because the gimbal protocol now
handles the case properly where the autopilot is in charge of a
non-MAVLink gimbal.
This means that we don't need to send message "as if we were a gimbal
device" and instead set thet gimbal_device_id to 1 (up to 6) to indicate
we are in charge or a non-MAVLink gimbal.
New GCC versions inline builtin function like memcpy. On the fmu-v6xrt we can't call the functions inside imxrt_ocram_initialize because the ram function still needs to be initialized.
This commit add a compile hint to not use builtins inside the imxrt_ocram_initialize function
* fix sign error in appropriate place
In PR https://github.com/PX4/PX4-Autopilot/pull/24175 I changed the
control surface deflection signs in generate_fw_aerodynamics to make the
1103 airframe work correctly. However, this breaks the 1101 airframe,
introducing sing errors there.
So, here the change in generate_fw_aerodynamics is reverted to the state
before PR #24175. Instead, the signs are set correctly by using
the HIL_ACT_REV bitfield in the respective airframe config files.
* match control surface parameters to SIH model