Commit Graph

1445 Commits

Author SHA1 Message Date
Silvan Fuhrer 1e56d9c219 Rework flaps/spoilers logic
- remove deprecated actuator_controls[INDEX_FLAPS/SPOILERS/AIRBRAKES]
- use new topic normalized_unsigned_setpoint.msg (with instances flaps_setpoint
and spoilers_setpoint) to pass into control allocation
- remove flaps/spoiler related fields from attitude_setpoint topic
- CA: add possibility to map flaps/spoilers to any control surface
- move flaps/spoiler pitch trimming to CA (previously called DTRIM_FLAPS/SPOILER)
- move manual flaps/spoiler handling from rate to attitude controller

FW Position controller: change how negative switch readings are intepreted
for flaps/spoilers (considered negative as 0).

VTOL: Rework spoiler publishing in hover

- pushlish spoiler_setpoint.msg in the VTOL module if in hover
- also set spoilers to land configuration if in Descend mode

Allocation: add slew rate limit of 0.5 to flaps/spoilers configuration change

Instead of doing the flaps/spoilers slew rate limiting in the FW Position Controller
(which then only is applied in Auto flight), do it consistently over all flight
modes, so also for manual modes.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-06 22:43:41 +01:00
Silvan Fuhrer 16594bffa9 Rework landing gear logic
- remove deprecated actuator_controls[INDEX_LANDING_GEAR]
- remove dead code in mc rate controller that used to prevent it from being retracted
on the ground (anyway had no effect as it only affected the actuator_control[LANDING_GEAR]
which wasn't sent to the control allocation)
- for VTOLs handle deployment/retraction of landing gear in AUTO  as a MC (retract if
more than 2m above ground, deploy if WP is a landing WP), plus additionally when transition
flight task is called (ALTITUDE mode and higher)
- for FW in AUTO: add logic in FW Position Controller, depending on waypoint type mainly
- manual landing gear settings always come through (a manual command overrides a previous
auto command, and vice-versa)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-06 22:43:41 +01:00
Silvan Fuhrer 4b54ddfe61 Remove INDEX_COLLECTIVE_TILT from actuator_controls and instead use new topic tiltrotor_extra_controls
Tiltrotor_extra_controls also contains collective thrust beside collective tilt, as passing a 3D
thrust setpoint vector beside the tilt is not feasible.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-06 22:43:41 +01:00
Eric Katzfey 5cade89499
Improve logging for Modal IO ESC (#21188)
- always publish esc_status
 - when enabled via MODAL_IO_VLOG param, enable actuator debug output

 - for modal_io commands, use ESC HW ID values instead of motor number for easier use
 - publish esc_status message for command line commands

 - Uncommented the code that fills in the cmdcount and power fields in the esc_status topic

---------

Co-authored-by: Travis Bottalico <travis@modalai.com>
2023-03-06 09:51:22 -05:00
Silvan Fuhrer dc4926dc4d remove WheelEncoders.msg
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-06 09:43:01 -05:00
Silvan Fuhrer 76116d79f9 TECS: remove umcommanded_descent flag
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-01 10:39:09 +01:00
Silvan Fuhrer 527225357b TECS: remove unused TECS_MODE_CLIMBOUT
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-01 10:39:09 +01:00
Silvan Fuhrer 526e066d9a Commander: rework GPS invalid warning to use estimator feedback instead of separate GPS quality thresholds
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-02-24 13:32:38 +01:00
Beat Küng 3f2336af32
navigator: add ModeCompleted signalling topic 2023-02-07 19:11:52 -05:00
Daniel Sahu fa6fda6cce
ekf2: new gravity observation (#21038)
Signed-off-by: Daniel M. Sahu <danielmohansahu@gmail.com>
2023-02-07 13:28:58 -05:00
Silvan Fuhrer 9b3a28dff5 Commander: add local_position_accuracy_low flag, incl. warning and RTL
Set this flag to true if local position is valid but accuracy low, such that
the operator can be warned before system switches to position-failure failsafe.
Additionally, switch to RTL if currently in Mission or Loiter to try to reach home
or fly out of GNSS-denied area.

Set low accuracy threshold to 50m by default for FW and VTOL.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-02-01 16:47:11 +01:00
Beat Küng b1709743f7 commander: add wind or flight time limit exceeded mode requirement
This prevents switching into any of these modes once the condition is set.
2023-02-01 08:48:09 +01:00
Hamish Willee f25abbc80a Fix magnetometer typo 2023-01-30 10:24:16 +01:00
Silvan Fuhrer d53d200aa5 Update msg/TecsStatus.msg
Co-authored-by: KonradRudin <98741601+KonradRudin@users.noreply.github.com>
2023-01-26 17:04:43 +01:00
Silvan Fuhrer 88ec117e59 TECS: rename tecs_status.altitude_filtered to altitude_sp_ref
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-01-26 17:04:43 +01:00
Silvan Fuhrer 06f4195663 PositionControllerStatus.msg: add comments
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-01-26 17:04:43 +01:00
Silvan Fuhrer fc1c5da92c tecs_status.msg: add comments to states
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-01-26 17:04:43 +01:00
Silvan Fuhrer 148ffe4e25 add support for DO_CHANGE_ALTITUDE
Do the same as DO_REPOSITION wit only the altitude field populated
and MAV_DO_REPOSITION_FLAGS set, which means:
- switch to Loiter mode if not already in it
- set the current altitude to what is specified in the altitdue field,
keep current altitude setpoint otherwise
- keep current position setpoint
- fall back to current estimated position in case a position setpoint
is not finite

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-01-25 16:40:27 +01:00
bresch 6e30f8f5cb ekf2: use dedicated aid_src message for flow for terrain aiding 2023-01-21 15:31:19 -05:00
Daniel Agar 1aa8ec4537
drivers: initial VectorNav (VN-100, VN-200, VN-300) support 2023-01-20 19:09:30 -05:00
Jukka Laitinen 2985b5b9c2 msg/ActuatorTest.msg: Use default queue size the same as MAX_NUM_MOTORS
For the esc_calibration code, the actuator test is published for each motor
in a row. If the orb queue size is too small, messages are lost and not
received in mixer_module.

Set the default orb queue size of ActuatorTest high enough to keep the commands
for all motors in the queue.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-14 09:19:10 -05:00
Silvan Fuhrer 303b879748 VTOL/Commander: rename transition_failsafe to vtol_fixed_wing_system_failure
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-01-13 19:02:21 +03:00
Konrad f5524fa605 TECS: Combine both airspeed and airspeed derivative filters in TECS into one MIMO filter using a steady state Kalman filter. 2022-12-21 09:04:19 +01:00
Daniel Agar 54a32eb2f7
ekf2: EV overhaul yaw and position fusion (#20501)
- move EV yaw and EV position to new state machines
 - EV yaw and EV pos now configured via EKF2_EV_CTRL (migrated from EKF2_AID_MASK)
 - new EV position offset estimator to enable EV position while GPS position is active (no more EV pos delta fusion)
 - yaw_align now strictly means north (no more rotate external vision aid mask)
 - automatic switching between EV yaw, and yaw align north based on GPS quality
2022-12-20 10:23:56 -05:00
Zachary Lowell e4f641e9b5
Qurt qshell implementation (#20736) 2022-12-09 16:49:41 -05:00
Matthias Grob 331cb21dee manual_control_setpoint: change stick axes naming
In review it was requested to have a different name for
manual_control_setpoint.z because of the adjusted range.

I started to investigate what naming is most intuitive and found
that most people recognize the stick axes as roll, pitch, yaw, throttle.
It comes at no surprise because other autopilots
and APIs seem to share this convention.

While changing the code I realized that even within the code base
the axes are usually assigned to a variable with that name or
have comments next to the assignment clarifying the axes
using these names.
2022-11-28 19:25:55 +01:00
Matthias Grob 83246c84cf Switch manual_control_setpoint.z scaling from [0,1] to [-1,1]
To be consistent with all other axes of stick input and avoid future
rescaling confusion.

Note: for the MAVLink message 69 MANUAL_CONTROL it's using the full range
according to the message specs now [-1000,1000].
2022-11-28 19:25:55 +01:00
Silvan Fuhrer 90e1f98c57 FW Launch Detection: refactor state machine and pubish launch_detection_status message
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer a787a326e3 Fixed-wing: split out control of steering wheel into seperate message LandingGearWheel
Completely detach the steering wheel logic from the yaw controller (beside using the
same manual stick input in a manual flight mode).

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-22 13:46:25 -05:00
Silvan Fuhrer 6c611a7e8b VehicleAttitudeSetpoint: rename fw_control_yaw to fw_control_yaw_wheel to make usage clearer
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-22 13:46:25 -05:00
Daniel Agar 9e7db0ed54
merge vehicle_angular_acceleration into vehicle_angular_velocity (#20531)
- vehicle_angular_velocity and vehicle_angular_acceleration are produced together from the same input data, consumed together, and share the the same metadata (timestamps)
 - individually these topics each have 16 bytes of metadata (2 timestamps) for 12 bytes of data (x,y,z float32)
2022-11-14 11:03:59 -05:00
Michael Schaeuble d7fde289de Use gimbal attitude for the camera feedback when available
The CameraFeedback module used only the vehicle attitude for the camera orientation so far. With this change, the gimbal_device_attitude_status is used to compute the global camera orientation when a gimbal is used.
2022-11-14 09:26:14 -05:00
Silvan Fuhrer 83e906e2e9 Control_allocator_status.msg: remove allocated_ fields
It's enough that the setpoints and the unallocated values are logged, from these
 the allocated values can be calculated if required.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-02 14:56:13 +01:00
Silvan Fuhrer bace45ba8d LandDetector: log rotational_movement
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-01 18:35:54 +01:00
JaeyoungLim a90857f651
FW separate reset integrals for messages (#20502)
This commit separates integral resets for attitude and rate control setpoints
2022-11-01 06:06:27 +01:00
Hamish Willee 96a305322a
params/uorb docs: rename mixer to control allocation (#20447) 2022-10-24 13:22:26 +02:00
Daniel Agar cea185268e
msg ROS2 compatibility, microdds_client improvements (timesync, reduced code size, added topics, etc), fastrtps purge
- update all msgs to be directly compatible with ROS2
 - microdds_client improvements
   - timesync
   - reduced code size
   - add to most default builds if we can afford it
   - lots of other little changes
 - purge fastrtps (I tried to save this multiple times, but kept hitting roadblocks)
2022-10-19 19:36:47 -04:00
Daniel Agar 535415a537 ekf2: add OF estimator aid src status 2022-10-18 14:19:16 -04:00
Silvan Fuhrer 5ea8c6e507 FlightTaskAuto: remove unused _getTargetVelocityXY()
Inclusive velocity_valid field in position_setpoint message that's then
no longer needed.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-10-17 16:12:15 -04:00
Silvan Fuhrer 42c613a0c7 position_setpoint.msg: remove unused alt_valid
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-10-17 16:12:15 -04:00
Silvan Fuhrer 42dd9b5063 position_setpoint.msg: remove unused velocity_frame field
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-10-17 16:12:15 -04:00
Beat Küng d542ffc10c refactor vehicle_status_flags: rename to failsafe_flags 2022-10-13 16:05:25 -04:00
Daniel Agar 2de990fd4b estimator_aid_source split GNSS pos (3d) -> pos (2d) + hgt
- per estimator air source status only keep a single set of flags and
timestamp that applies to the entire source
2022-10-13 11:28:50 -04:00
bresch 5f54f6fcda ekf2: migrate sideslip fusion to SymForce
- split fusion into update (compute innov and innov_var) and actual fusion to the state vector
- use estimator_aid_source_1d struct to group the data
2022-10-12 09:55:35 -04:00
Beat Küng 9b7a8d4568 vehicle_status_flags: add group 'Other' 2022-10-11 22:31:20 -04:00
Beat Küng 38d3739b6d refactor commander: rename rc_signal_lost -> manual_control_signal_lost, data_link_lost -> gcs_connection_lost 2022-10-11 22:31:20 -04:00
Beat Küng acaa50a448 geofence: add and report reason for violation 2022-10-11 22:31:20 -04:00
mcsauder ebc88afe46 Apply Google Style to Commander Private methods, rename geofence message geofence_violation to primary_geofence_breached. 2022-10-11 22:31:20 -04:00
Beat Küng e4bb219d10 vehicle_status_flags: cleanup message, move non-failsafe flags to vehicle_status 2022-10-11 22:31:20 -04:00
Beat Küng ae6377dfa0 mission_result: remove unused fields 2022-10-11 22:31:20 -04:00