mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-06 19:00:27 +08:00
Trims conversion_table down to just the TRQ1_ block, which was added May-2024 and so is still required. Everything above it - battery (Oct-2013), serial baud (Jan-2015), MOT_THR (Aug-2017), COMPASS_ENABLE (Apr-2019), WP_RADIUS (May-2019), sailboat (May-2019), ATC_TURN_MAX_G (May-2021), WP_PIVOT (Dec-2021) and PRX1_ (Aug-2022) - is present in Rover-4.4.0, the oldest release a Rover user can be moving from once the migration floor is 4.3, as Rover has no 4.3. Also removes the WP_SPEED/CRUISE_SPEED conversion (May-2019) and the attitude control FF/FILT conversion (Jul-2019) on the same grounds.
809 lines
29 KiB
C++
809 lines
29 KiB
C++
#include "Rover.h"
|
|
|
|
#include <AP_Beacon/AP_Beacon.h>
|
|
#include <AP_Gripper/AP_Gripper.h>
|
|
|
|
/*
|
|
Rover parameter definitions
|
|
*/
|
|
|
|
const AP_Param::Info Rover::var_info[] = {
|
|
// @Param: FORMAT_VERSION
|
|
// @DisplayName: Eeprom format version number
|
|
// @Description: This value is incremented when changes are made to the eeprom format
|
|
// @User: Advanced
|
|
GSCALAR(format_version, "FORMAT_VERSION", 1),
|
|
|
|
// @Param: LOG_BITMASK
|
|
// @DisplayName: Log bitmask
|
|
// @Description: Bitmap of what log types to enable in on-board logger. This value is made up of the sum of each of the log types you want to be saved. On boards supporting microSD cards or other large block-storage devices it is usually best just to enable all basic log types by setting this to 65535.
|
|
// @Bitmask: 0:Fast Attitude,1:Medium Attitude,2:GPS,3:System Performance,4:Throttle,5:Navigation Tuning,7:IMU,8:Mission Commands,9:Battery Monitor,10:Rangefinder,11:Compass,12:Camera,13:Steering,14:RC Input-Output,19:Raw IMU,20:Video Stabilization,21:Optical Flow
|
|
// @User: Advanced
|
|
GSCALAR(log_bitmask, "LOG_BITMASK", DEFAULT_LOG_BITMASK),
|
|
|
|
// RST_SWITCH_CH was here
|
|
|
|
// @Param: INITIAL_MODE
|
|
// @DisplayName: Initial driving mode
|
|
// @Description: This selects the mode to start in on boot. This is useful for when you want to start in AUTO mode on boot without a receiver. Usually used in combination with when AUTO_TRIGGER_PIN or AUTO_KICKSTART.
|
|
// @CopyValuesFrom: MODE1
|
|
// @User: Advanced
|
|
GSCALAR(initial_mode, "INITIAL_MODE", (int8_t)Mode::Number::MANUAL),
|
|
|
|
// SYSID_THISMAV was here
|
|
|
|
// SYSID_MYGCS was here
|
|
|
|
// TELEM_DELAY was here
|
|
|
|
// @Param: GCS_PID_MASK
|
|
// @DisplayName: GCS PID tuning mask
|
|
// @Description: bitmask of PIDs to send MAVLink PID_TUNING messages for
|
|
// @User: Advanced
|
|
// @Bitmask: 0:Steering,1:Throttle,2:Pitch,3:Left Wheel,4:Right Wheel,5:Sailboat Heel,6:Velocity North,7:Velocity East
|
|
GSCALAR(gcs_pid_mask, "GCS_PID_MASK", 0),
|
|
|
|
// @Param: AUTO_TRIGGER_PIN
|
|
// @DisplayName: Auto mode trigger pin
|
|
// @Description: pin number to use to enable the throttle in auto mode. If set to -1 then don't use a trigger, otherwise this is a pin number which if held low in auto mode will enable the motor to run. If the switch is released while in AUTO then the motor will stop again. This can be used in combination with INITIAL_MODE to give a 'press button to start' rover with no receiver.
|
|
// @Values: -1:Disabled,0:APM TriggerPin0,1:APM TriggerPin1,2:APM TriggerPin2,3:APM TriggerPin3,4:APM TriggerPin4,5:APM TriggerPin5,6:APM TriggerPin6,7:APM TriggerPin7,8:APM TriggerPin8,50:AUX1,51:AUX2,52:AUX3,53:AUX4,54:AUX5,55:AUX6
|
|
// @Range: -1 127
|
|
// @User: Standard
|
|
GSCALAR(auto_trigger_pin, "AUTO_TRIGGER_PIN", -1),
|
|
|
|
// @Param: AUTO_KICKSTART
|
|
// @DisplayName: Auto mode trigger kickstart acceleration
|
|
// @Description: X acceleration in meters/second/second to use to trigger the motor start in auto mode. If set to zero then auto throttle starts immediately when the mode switch happens, otherwise the rover waits for the X acceleration to go above this value before it will start the motor
|
|
// @Units: m/s/s
|
|
// @Range: 0 20
|
|
// @Increment: 0.1
|
|
// @User: Standard
|
|
GSCALAR(auto_kickstart, "AUTO_KICKSTART", 0.0f),
|
|
|
|
// @Param: CRUISE_SPEED
|
|
// @DisplayName: Target cruise speed in auto modes
|
|
// @Description: The target speed in auto missions.
|
|
// @Units: m/s
|
|
// @Range: 0 100
|
|
// @Increment: 0.1
|
|
// @User: Standard
|
|
GSCALAR(speed_cruise, "CRUISE_SPEED", CRUISE_SPEED),
|
|
|
|
|
|
// @Param: CRUISE_THROTTLE
|
|
// @DisplayName: Base throttle percentage in auto
|
|
// @Description: The base throttle percentage to use in auto mode. The CRUISE_SPEED parameter controls the target speed, but the rover starts with the CRUISE_THROTTLE setting as the initial estimate for how much throttle is needed to achieve that speed. It then adjusts the throttle based on how fast the rover is actually going.
|
|
// @Units: %
|
|
// @Range: 0 100
|
|
// @Increment: 1
|
|
// @User: Standard
|
|
GSCALAR(throttle_cruise, "CRUISE_THROTTLE", 50),
|
|
|
|
// @Param: PILOT_STEER_TYPE
|
|
// @DisplayName: Pilot input steering type
|
|
// @Description: Pilot RC input interpretation
|
|
// @Values: 0:Default,1:Two Paddles Input,2:Direction reversed when backing up,3:Direction unchanged when backing up
|
|
// @User: Standard
|
|
GSCALAR(pilot_steer_type, "PILOT_STEER_TYPE", 0),
|
|
|
|
// @Param: FS_ACTION
|
|
// @DisplayName: Failsafe Action
|
|
// @Description: What to do on a failsafe event
|
|
// @Values: 0:Nothing,1:RTL,2:Hold,3:SmartRTL or RTL,4:SmartRTL or Hold,5:Terminate,6:Loiter or Hold
|
|
// @User: Standard
|
|
GSCALAR(fs_action, "FS_ACTION", (int8_t)FailsafeAction::Hold),
|
|
|
|
// @Param: FS_TIMEOUT
|
|
// @DisplayName: Failsafe timeout
|
|
// @Description: The time in seconds that a failsafe condition must persist before the failsafe action is triggered
|
|
// @Units: s
|
|
// @Range: 1 100
|
|
// @Increment: 0.5
|
|
// @User: Standard
|
|
GSCALAR(fs_timeout, "FS_TIMEOUT", 1.5),
|
|
|
|
// @Param: FS_THR_ENABLE
|
|
// @DisplayName: Throttle Failsafe Enable
|
|
// @Description: The throttle failsafe allows you to configure a software failsafe activated by a setting on the throttle input channel to a low value. This can be used to detect the RC transmitter going out of range. Failsafe will be triggered when the throttle channel goes below the FS_THR_VALUE for FS_TIMEOUT seconds.
|
|
// @Values: 0:Disabled,1:Enabled,2:Enabled Continue with Mission in Auto
|
|
// @User: Standard
|
|
GSCALAR(fs_throttle_enabled, "FS_THR_ENABLE", FS_THR_ENABLED),
|
|
|
|
// @Param: FS_THR_VALUE
|
|
// @DisplayName: Throttle Failsafe Value
|
|
// @Description: The PWM level on the throttle channel below which throttle failsafe triggers.
|
|
// @Range: 910 1100
|
|
// @Increment: 1
|
|
// @User: Standard
|
|
GSCALAR(fs_throttle_value, "FS_THR_VALUE", 910),
|
|
|
|
// @Param: FS_GCS_ENABLE
|
|
// @DisplayName: GCS failsafe enable
|
|
// @Description: Enable ground control station telemetry failsafe. When enabled the Rover will execute the FS_ACTION when it fails to receive MAVLink heartbeat packets for FS_TIMEOUT seconds.
|
|
// @Values: 0:Disabled,1:Enabled,2:Enabled Continue with Mission in Auto
|
|
// @User: Standard
|
|
GSCALAR(fs_gcs_enabled, "FS_GCS_ENABLE", FS_GCS_DISABLED),
|
|
|
|
// @Param: FS_CRASH_CHECK
|
|
// @DisplayName: Crash check action
|
|
// @Description: What to do on a crash event. When enabled the rover will go to hold if a crash is detected.
|
|
// @Values: 0:Disabled,1:Hold,2:HoldAndDisarm
|
|
// @User: Standard
|
|
GSCALAR(fs_crash_check, "FS_CRASH_CHECK", FS_CRASH_DISABLE),
|
|
|
|
// @Param: FS_EKF_ACTION
|
|
// @DisplayName: EKF Failsafe Action
|
|
// @Description: Controls the action that will be taken when an EKF failsafe is invoked
|
|
// @Values: 0:Disabled,1:Hold,2:ReportOnly
|
|
// @User: Advanced
|
|
GSCALAR(fs_ekf_action, "FS_EKF_ACTION", FS_EKF_HOLD),
|
|
|
|
// @Param: FS_EKF_THRESH
|
|
// @DisplayName: EKF failsafe variance threshold
|
|
// @Description: Allows setting the maximum acceptable compass and velocity variance
|
|
// @Values: 0.6:Strict, 0.8:Default, 1.0:Relaxed
|
|
// @User: Advanced
|
|
GSCALAR(fs_ekf_thresh, "FS_EKF_THRESH", 0.8f),
|
|
|
|
// @Param: MODE_CH
|
|
// @DisplayName: Mode channel
|
|
// @Description: RC Channel to use for driving mode control
|
|
// @User: Advanced
|
|
GSCALAR(mode_channel, "MODE_CH", MODE_CHANNEL),
|
|
|
|
// @Param: MODE1
|
|
// @DisplayName: Mode1
|
|
// @Values: 0:Manual,1:Acro,3:Steering,4:Hold,5:Loiter,6:Follow,7:Simple,8:Dock,9:Circle,10:Auto,11:RTL,12:SmartRTL,15:Guided
|
|
// @User: Standard
|
|
// @Description: Driving mode for switch position 1 (910 to 1230 and above 2049)
|
|
GARRAY(modes, 0, "MODE1", (int8_t)Mode::Number::MANUAL),
|
|
|
|
// @Param: MODE2
|
|
// @DisplayName: Mode2
|
|
// @Description: Driving mode for switch position 2 (1231 to 1360)
|
|
// @CopyValuesFrom: MODE1
|
|
// @User: Standard
|
|
GARRAY(modes, 1, "MODE2", (int8_t)Mode::Number::MANUAL),
|
|
|
|
// @Param: MODE3
|
|
// @CopyFieldsFrom: MODE1
|
|
// @DisplayName: Mode3
|
|
// @Description: Driving mode for switch position 3 (1361 to 1490)
|
|
GARRAY(modes, 2, "MODE3", (int8_t)Mode::Number::MANUAL),
|
|
|
|
// @Param: MODE4
|
|
// @CopyFieldsFrom: MODE1
|
|
// @DisplayName: Mode4
|
|
// @Description: Driving mode for switch position 4 (1491 to 1620)
|
|
GARRAY(modes, 3, "MODE4", (int8_t)Mode::Number::MANUAL),
|
|
|
|
// @Param: MODE5
|
|
// @CopyFieldsFrom: MODE1
|
|
// @DisplayName: Mode5
|
|
// @Description: Driving mode for switch position 5 (1621 to 1749)
|
|
GARRAY(modes, 4, "MODE5", (int8_t)Mode::Number::MANUAL),
|
|
|
|
// @Param: MODE6
|
|
// @CopyFieldsFrom: MODE1
|
|
// @DisplayName: Mode6
|
|
// @Description: Driving mode for switch position 6 (1750 to 2049)
|
|
GARRAY(modes, 5, "MODE6", (int8_t)Mode::Number::MANUAL),
|
|
|
|
// variables not in the g class which contain EEPROM saved variables
|
|
|
|
// @Group: COMPASS_
|
|
// @Path: ../libraries/AP_Compass/AP_Compass.cpp
|
|
GOBJECT(compass, "COMPASS_", Compass),
|
|
|
|
// @Group: SCHED_
|
|
// @Path: ../libraries/AP_Scheduler/AP_Scheduler.cpp
|
|
GOBJECT(scheduler, "SCHED_", AP_Scheduler),
|
|
|
|
// @Group: BARO
|
|
// @Path: ../libraries/AP_Baro/AP_Baro.cpp
|
|
GOBJECT(barometer, "BARO", AP_Baro),
|
|
|
|
#if AP_RELAY_ENABLED
|
|
// @Group: RELAY
|
|
// @Path: ../libraries/AP_Relay/AP_Relay.cpp
|
|
GOBJECT(relay, "RELAY", AP_Relay),
|
|
#endif
|
|
|
|
// @Group: RCMAP_
|
|
// @Path: ../libraries/AP_RCMapper/AP_RCMapper.cpp
|
|
GOBJECT(rcmap, "RCMAP_", RCMapper),
|
|
|
|
// SR0 through SR6 were here
|
|
|
|
// AP_SerialManager was here
|
|
|
|
#if AP_RANGEFINDER_ENABLED
|
|
// @Group: RNGFND
|
|
// @Path: ../libraries/AP_RangeFinder/AP_RangeFinder.cpp
|
|
GOBJECT(rangefinder, "RNGFND", RangeFinder),
|
|
#endif
|
|
|
|
// @Group: INS
|
|
// @Path: ../libraries/AP_InertialSensor/AP_InertialSensor.cpp
|
|
GOBJECT(ins, "INS", AP_InertialSensor),
|
|
|
|
#if AP_SIM_ENABLED
|
|
// @Group: SIM_
|
|
// @Path: ../libraries/SITL/SITL.cpp
|
|
GOBJECT(sitl, "SIM_", SITL::SIM),
|
|
#endif
|
|
|
|
// @Group: AHRS_
|
|
// @Path: ../libraries/AP_AHRS/AP_AHRS.cpp
|
|
GOBJECT(ahrs, "AHRS_", AP_AHRS),
|
|
|
|
#if AP_CAMERA_ENABLED
|
|
// @Group: CAM
|
|
// @Path: ../libraries/AP_Camera/AP_Camera.cpp
|
|
GOBJECT(camera, "CAM", AP_Camera),
|
|
#endif
|
|
|
|
#if AC_PRECLAND_ENABLED
|
|
// @Group: PLND_
|
|
// @Path: ../libraries/AC_PrecLand/AC_PrecLand.cpp
|
|
GOBJECT(precland, "PLND_", AC_PrecLand),
|
|
#endif
|
|
|
|
#if HAL_MOUNT_ENABLED
|
|
// @Group: MNT
|
|
// @Path: ../libraries/AP_Mount/AP_Mount.cpp
|
|
GOBJECT(camera_mount, "MNT", AP_Mount),
|
|
#endif
|
|
|
|
// @Group: ARMING_
|
|
// @Path: ../libraries/AP_Arming/AP_Arming.cpp
|
|
GOBJECT(arming, "ARMING_", AP_Arming),
|
|
|
|
// @Group: BATT
|
|
// @Path: ../libraries/AP_BattMonitor/AP_BattMonitor.cpp
|
|
GOBJECT(battery, "BATT", AP_BattMonitor),
|
|
|
|
// @Group: BRD_
|
|
// @Path: ../libraries/AP_BoardConfig/AP_BoardConfig.cpp
|
|
GOBJECT(BoardConfig, "BRD_", AP_BoardConfig),
|
|
|
|
#if HAL_MAX_CAN_PROTOCOL_DRIVERS
|
|
// @Group: CAN_
|
|
// @Path: ../libraries/AP_CANManager/AP_CANManager.cpp
|
|
GOBJECT(can_mgr, "CAN_", AP_CANManager),
|
|
#endif
|
|
|
|
// GPS driver
|
|
// @Group: GPS
|
|
// @Path: ../libraries/AP_GPS/AP_GPS.cpp
|
|
GOBJECT(gps, "GPS", AP_GPS),
|
|
|
|
#if HAL_NAVEKF2_AVAILABLE
|
|
// @Group: EK2_
|
|
// @Path: ../libraries/AP_NavEKF2/AP_NavEKF2.cpp
|
|
GOBJECTN(ahrs.ekf2.EKF2, NavEKF2, "EK2_", NavEKF2),
|
|
#endif
|
|
|
|
#if HAL_NAVEKF3_AVAILABLE
|
|
// @Group: EK3_
|
|
// @Path: ../libraries/AP_NavEKF3/AP_NavEKF3.cpp
|
|
GOBJECTN(ahrs.ekf3.EKF3, NavEKF3, "EK3_", NavEKF3),
|
|
#endif
|
|
|
|
// @Group: MIS_
|
|
// @Path: ../libraries/AP_Mission/AP_Mission.cpp
|
|
GOBJECTN(mode_auto.mission, mission, "MIS_", AP_Mission),
|
|
|
|
#if AP_RSSI_ENABLED
|
|
// @Group: RSSI_
|
|
// @Path: ../libraries/AP_RSSI/AP_RSSI.cpp
|
|
GOBJECT(rssi, "RSSI_", AP_RSSI),
|
|
#endif
|
|
|
|
// @Group: NTF_
|
|
// @Path: ../libraries/AP_Notify/AP_Notify.cpp
|
|
GOBJECT(notify, "NTF_", AP_Notify),
|
|
|
|
#if HAL_BUTTON_ENABLED
|
|
// @Group: BTN_
|
|
// @Path: ../libraries/AP_Button/AP_Button.cpp
|
|
GOBJECT(button, "BTN_", AP_Button),
|
|
#endif
|
|
|
|
// @Group:
|
|
// @Path: Parameters.cpp
|
|
GOBJECT(g2, "", ParametersG2),
|
|
|
|
#if OSD_ENABLED || OSD_PARAM_ENABLED
|
|
// @Group: OSD
|
|
// @Path: ../libraries/AP_OSD/AP_OSD.cpp
|
|
GOBJECT(osd, "OSD", AP_OSD),
|
|
#endif
|
|
|
|
#if AP_OPTICALFLOW_ENABLED
|
|
// @Group: FLOW
|
|
// @Path: ../libraries/AP_OpticalFlow/AP_OpticalFlow.cpp
|
|
GOBJECT(optflow, "FLOW", AP_OpticalFlow),
|
|
#endif
|
|
|
|
// @Group:
|
|
// @Path: ../libraries/AP_Vehicle/AP_Vehicle.cpp
|
|
PARAM_VEHICLE_INFO,
|
|
|
|
#if HAL_GCS_ENABLED
|
|
// @Group: MAV
|
|
// @Path: ../libraries/GCS_MAVLink/GCS.cpp
|
|
GOBJECT(_gcs, "MAV", GCS),
|
|
#endif
|
|
|
|
AP_VAREND
|
|
};
|
|
|
|
/*
|
|
2nd group of parameters
|
|
*/
|
|
const AP_Param::GroupInfo ParametersG2::var_info[] = {
|
|
// 1 was AP_Stats
|
|
|
|
// 2 was SYSID_ENFORCE
|
|
|
|
// @Group: SERVO
|
|
// @Path: ../libraries/SRV_Channel/SRV_Channels.cpp
|
|
AP_SUBGROUPINFO(servo_channels, "SERVO", 3, ParametersG2, SRV_Channels),
|
|
|
|
// @Group: RC
|
|
// @Path: ../libraries/RC_Channel/RC_Channels_VarInfo.h
|
|
AP_SUBGROUPINFO(rc_channels, "RC", 4, ParametersG2, RC_Channels_Rover),
|
|
|
|
#if AP_ROVER_ADVANCED_FAILSAFE_ENABLED
|
|
// @Group: AFS_
|
|
// @Path: ../libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.cpp
|
|
AP_SUBGROUPINFO(afs, "AFS_", 5, ParametersG2, AP_AdvancedFailsafe),
|
|
#endif
|
|
|
|
// 6 was AP_Beacon
|
|
|
|
// 7 was used by AP_VisualOdometry
|
|
|
|
// @Group: MOT_
|
|
// @Path: ../libraries/AR_Motors/AP_MotorsUGV.cpp
|
|
AP_SUBGROUPINFO(motors, "MOT_", 8, ParametersG2, AP_MotorsUGV),
|
|
|
|
// @Group: WENC
|
|
// @Path: ../libraries/AP_WheelEncoder/AP_WheelEncoder.cpp
|
|
AP_SUBGROUPINFO(wheel_encoder, "WENC", 9, ParametersG2, AP_WheelEncoder),
|
|
|
|
// @Group: ATC
|
|
// @Path: ../libraries/APM_Control/AR_AttitudeControl.cpp
|
|
AP_SUBGROUPINFO(attitude_control, "ATC", 10, ParametersG2, AR_AttitudeControl),
|
|
|
|
// @Param: TURN_RADIUS
|
|
// @DisplayName: Turn radius of vehicle
|
|
// @Description: Turn radius of vehicle in meters while at low speeds. Lower values produce tighter turns in steering mode
|
|
// @Units: m
|
|
// @Range: 0 10
|
|
// @Increment: 0.1
|
|
// @User: Standard
|
|
AP_GROUPINFO("TURN_RADIUS", 11, ParametersG2, turn_radius, 0.9),
|
|
|
|
// @Param: ACRO_TURN_RATE
|
|
// @DisplayName: Acro mode turn rate maximum
|
|
// @Description: Acro mode turn rate maximum
|
|
// @Units: deg/s
|
|
// @Range: 0 360
|
|
// @Increment: 1
|
|
// @User: Standard
|
|
AP_GROUPINFO("ACRO_TURN_RATE", 12, ParametersG2, acro_turn_rate, 180.0f),
|
|
|
|
// @Group: SRTL_
|
|
// @Path: ../libraries/AP_SmartRTL/AP_SmartRTL.cpp
|
|
AP_SUBGROUPINFO(smart_rtl, "SRTL_", 13, ParametersG2, AP_SmartRTL),
|
|
|
|
// 14 was WP_SPEED and should not be re-used
|
|
|
|
// @Param: RTL_SPEED
|
|
// @DisplayName: Return-to-Launch speed default
|
|
// @Description: Return-to-Launch speed default. If zero use WP_SPEED or CRUISE_SPEED.
|
|
// @Units: m/s
|
|
// @Range: 0 100
|
|
// @Increment: 0.1
|
|
// @User: Standard
|
|
AP_GROUPINFO("RTL_SPEED", 15, ParametersG2, rtl_speed, 0.0f),
|
|
|
|
// @Param: FRAME_CLASS
|
|
// @DisplayName: Frame Class
|
|
// @Description: Frame Class
|
|
// @Values: 0:Undefined,1:Rover,2:Boat,3:BalanceBot
|
|
// @User: Standard
|
|
AP_GROUPINFO("FRAME_CLASS", 16, ParametersG2, frame_class, 1),
|
|
|
|
#if HAL_PROXIMITY_ENABLED
|
|
// @Group: PRX
|
|
// @Path: ../libraries/AP_Proximity/AP_Proximity.cpp
|
|
AP_SUBGROUPINFO(proximity, "PRX", 18, ParametersG2, AP_Proximity),
|
|
#endif
|
|
|
|
#if AP_AVOIDANCE_ENABLED
|
|
// @Group: AVOID_
|
|
// @Path: ../libraries/AC_Avoidance/AC_Avoid.cpp
|
|
AP_SUBGROUPINFO(avoid, "AVOID_", 19, ParametersG2, AC_Avoid),
|
|
#endif
|
|
|
|
// 20 was PIVOT_TURN_RATE and should not be re-used
|
|
|
|
// @Param: BAL_PITCH_MAX
|
|
// @DisplayName: BalanceBot Maximum Pitch
|
|
// @Description: Pitch angle in degrees at 100% throttle
|
|
// @Units: deg
|
|
// @Range: 0 15
|
|
// @Increment: 0.1
|
|
// @User: Standard
|
|
AP_GROUPINFO("BAL_PITCH_MAX", 21, ParametersG2, bal_pitch_max, 10),
|
|
|
|
// @Param: CRASH_ANGLE
|
|
// @DisplayName: Crash Angle
|
|
// @Description: Pitch/Roll angle limit in degrees for crash check. Zero disables check
|
|
// @Units: deg
|
|
// @Range: 0 60
|
|
// @Increment: 1
|
|
// @User: Standard
|
|
AP_GROUPINFO("CRASH_ANGLE", 22, ParametersG2, crash_angle, 0),
|
|
|
|
#if AP_FOLLOW_ENABLED
|
|
// @Group: FOLL
|
|
// @Path: ../libraries/AP_Follow/AP_Follow.cpp
|
|
AP_SUBGROUPINFO(follow, "FOLL", 23, ParametersG2, AP_Follow),
|
|
#endif
|
|
|
|
// @Param: FRAME_TYPE
|
|
// @DisplayName: Frame Type
|
|
// @Description: Frame Type
|
|
// @Values: 0:Default,1:Omni3,2:OmniX,3:OmniPlus,4:Omni3Mecanum
|
|
// @User: Standard
|
|
// @RebootRequired: True
|
|
AP_GROUPINFO("FRAME_TYPE", 24, ParametersG2, frame_type, 0),
|
|
|
|
// @Param: LOIT_TYPE
|
|
// @DisplayName: Loiter type
|
|
// @Description: Loiter behaviour when moving to the target point
|
|
// @Values: 0:Forward or reverse to target point,1:Always face bow towards target point,2:Always face stern towards target point
|
|
// @User: Standard
|
|
AP_GROUPINFO("LOIT_TYPE", 25, ParametersG2, loit_type, 0),
|
|
|
|
#if HAL_SPRAYER_ENABLED
|
|
// @Group: SPRAY_
|
|
// @Path: ../libraries/AC_Sprayer/AC_Sprayer.cpp
|
|
AP_SUBGROUPINFO(sprayer, "SPRAY_", 26, ParametersG2, AC_Sprayer),
|
|
#endif
|
|
|
|
// @Group: WRC
|
|
// @Path: ../libraries/AP_WheelEncoder/AP_WheelRateControl.cpp
|
|
AP_SUBGROUPINFO(wheel_rate_control, "WRC", 27, ParametersG2, AP_WheelRateControl),
|
|
|
|
#if HAL_RALLY_ENABLED
|
|
// @Group: RALLY_
|
|
// @Path: AP_Rally.cpp,../libraries/AP_Rally/AP_Rally.cpp
|
|
AP_SUBGROUPINFO(rally, "RALLY_", 28, ParametersG2, AP_Rally_Rover),
|
|
#endif
|
|
|
|
// @Param: SIMPLE_TYPE
|
|
// @DisplayName: Simple_Type
|
|
// @Description: Simple mode types
|
|
// @Values: 0:InitialHeading,1:CardinalDirections
|
|
// @User: Standard
|
|
// @RebootRequired: True
|
|
AP_GROUPINFO("SIMPLE_TYPE", 29, ParametersG2, simple_type, 0),
|
|
|
|
// @Param: LOIT_RADIUS
|
|
// @DisplayName: Loiter radius
|
|
// @Description: Vehicle will drift when within this distance of the target position
|
|
// @Units: m
|
|
// @Range: 0 20
|
|
// @Increment: 1
|
|
// @User: Standard
|
|
AP_GROUPINFO("LOIT_RADIUS", 30, ParametersG2, loit_radius, 2),
|
|
|
|
// @Group: WNDVN_
|
|
// @Path: ../libraries/AP_WindVane/AP_WindVane.cpp
|
|
AP_SUBGROUPINFO(windvane, "WNDVN_", 31, ParametersG2, AP_WindVane),
|
|
|
|
// 32 to 36 were old sailboat params
|
|
|
|
// 37 was airspeed
|
|
|
|
// @Param: MIS_DONE_BEHAVE
|
|
// @DisplayName: Mission done behave
|
|
// @Description: Behaviour after mission completes
|
|
// @Values: 0:Hold in Auto Mode,1:Loiter in Auto Mode,2:Acro Mode,3:Manual Mode
|
|
// @User: Standard
|
|
AP_GROUPINFO("MIS_DONE_BEHAVE", 38, ParametersG2, mis_done_behave, 0),
|
|
|
|
// 39 was AP_Gripper
|
|
|
|
// @Param: BAL_PITCH_TRIM
|
|
// @DisplayName: Balance Bot pitch trim angle
|
|
// @Description: Balance Bot pitch trim for balancing. This offsets the tilt of the center of mass.
|
|
// @Units: deg
|
|
// @Range: -2 2
|
|
// @Increment: 0.1
|
|
// @User: Standard
|
|
AP_GROUPINFO("BAL_PITCH_TRIM", 40, ParametersG2, bal_pitch_trim, 0),
|
|
|
|
// 41 was Scripting
|
|
|
|
// @Param: STICK_MIXING
|
|
// @DisplayName: Stick Mixing
|
|
// @Description: When enabled, this adds steering user stick input in auto modes, allowing the user to have some degree of control without changing modes.
|
|
// @Values: 0:Disabled,1:Enabled
|
|
// @User: Advanced
|
|
AP_GROUPINFO("STICK_MIXING", 42, ParametersG2, stick_mixing, 0),
|
|
|
|
// @Group: WP_
|
|
// @Path: ../libraries/AR_WPNav/AR_WPNav.cpp
|
|
AP_SUBGROUPINFO(wp_nav, "WP_", 43, ParametersG2, AR_WPNav_OA),
|
|
|
|
// @Group: SAIL_
|
|
// @Path: sailboat.cpp
|
|
AP_SUBGROUPINFO(sailboat, "SAIL_", 44, ParametersG2, Sailboat),
|
|
|
|
#if AP_OAPATHPLANNER_ENABLED
|
|
// @Group: OA_
|
|
// @Path: ../libraries/AC_Avoidance/AP_OAPathPlanner.cpp
|
|
AP_SUBGROUPINFO(oa, "OA_", 45, ParametersG2, AP_OAPathPlanner),
|
|
#endif
|
|
|
|
// @Param: SPEED_MAX
|
|
// @DisplayName: Speed maximum
|
|
// @Description: Maximum speed vehicle can obtain at full throttle. If 0, it will be estimated based on CRUISE_SPEED and CRUISE_THROTTLE.
|
|
// @Units: m/s
|
|
// @Range: 0 30
|
|
// @Increment: 0.1
|
|
// @User: Advanced
|
|
AP_GROUPINFO("SPEED_MAX", 46, ParametersG2, speed_max, 0.0f),
|
|
|
|
// @Param: LOIT_SPEED_GAIN
|
|
// @DisplayName: Loiter speed gain
|
|
// @Description: Determines how aggressively LOITER tries to correct for drift from loiter point. Higher is faster but default should be acceptable.
|
|
// @Range: 0 5
|
|
// @Increment: 0.01
|
|
// @User: Advanced
|
|
AP_GROUPINFO("LOIT_SPEED_GAIN", 47, ParametersG2, loiter_speed_gain, 0.5f),
|
|
|
|
// @Param: FS_OPTIONS
|
|
// @DisplayName: Failsafe Options
|
|
// @Description: Bitmask to enable failsafe options
|
|
// @Bitmask: 0:Failsafe enabled in Hold mode
|
|
// @User: Advanced
|
|
AP_GROUPINFO("FS_OPTIONS", 48, ParametersG2, fs_options, 0),
|
|
|
|
#if HAL_TORQEEDO_ENABLED
|
|
// @Group: TRQ
|
|
// @Path: ../libraries/AP_Torqeedo/AP_Torqeedo.cpp
|
|
AP_SUBGROUPINFO(torqeedo, "TRQ", 49, ParametersG2, AP_Torqeedo),
|
|
#endif
|
|
|
|
// @Group: PSC
|
|
// @Path: ../libraries/APM_Control/AR_PosControl.cpp
|
|
AP_SUBGROUPINFO(pos_control, "PSC", 51, ParametersG2, AR_PosControl),
|
|
|
|
// @Param: GUID_OPTIONS
|
|
// @DisplayName: Guided mode options
|
|
// @Description: Options that can be applied to change guided mode behaviour
|
|
// @Bitmask: 6:SCurves used for navigation
|
|
// @User: Advanced
|
|
AP_GROUPINFO("GUID_OPTIONS", 52, ParametersG2, guided_options, 0),
|
|
|
|
// @Param: MANUAL_OPTIONS
|
|
// @DisplayName: Manual mode options
|
|
// @Description: Manual mode specific options
|
|
// @Bitmask: 0:Enable steering speed scaling
|
|
// @User: Advanced
|
|
AP_GROUPINFO("MANUAL_OPTIONS", 53, ParametersG2, manual_options, 0),
|
|
|
|
#if MODE_DOCK_ENABLED
|
|
// @Group: DOCK
|
|
// @Path: mode_dock.cpp
|
|
AP_SUBGROUPPTR(mode_dock_ptr, "DOCK", 54, ParametersG2, ModeDock),
|
|
#endif
|
|
|
|
// @Param: MANUAL_STR_EXPO
|
|
// @DisplayName: Manual Steering Expo
|
|
// @Description: Manual steering expo to allow faster steering when stick at edges
|
|
// @Values: 0:Disabled,0.1:Very Low,0.2:Low,0.3:Medium,0.4:High,0.5:Very High
|
|
// @Range: -0.5 0.95
|
|
// @User: Advanced
|
|
AP_GROUPINFO("MANUAL_STR_EXPO", 55, ParametersG2, manual_steering_expo, 0),
|
|
|
|
// @Param: FS_GCS_TIMEOUT
|
|
// @DisplayName: GCS failsafe timeout
|
|
// @Description: Timeout before triggering the GCS failsafe
|
|
// @Units: s
|
|
// @Range: 2 120
|
|
// @Increment: 1
|
|
// @User: Standard
|
|
AP_GROUPINFO("FS_GCS_TIMEOUT", 56, ParametersG2, fs_gcs_timeout, 5),
|
|
|
|
// @Group: CIRC
|
|
// @Path: mode_circle.cpp
|
|
AP_SUBGROUPINFO(mode_circle, "CIRC", 57, ParametersG2, ModeCircle),
|
|
|
|
// @Param: CRASH_THR_MIN
|
|
// @DisplayName: Crash throttle minimum
|
|
// @Description: Throttle above this threshold accompanied by a low speed condition triggers crash detection. Zero disables velocity and turn rate checks.
|
|
// @Units: %
|
|
// @Range: 0 100
|
|
// @Increment: 1
|
|
// @User: Advanced
|
|
AP_GROUPINFO("CRASH_THR_MIN", 58, ParametersG2, crash_thr_min, 5),
|
|
|
|
// @Param: CRASH_VEL_MIN
|
|
// @DisplayName: Crash velocity minimum
|
|
// @Description: Velocity below this threshold with accompanying throttle demand triggers crash detection. Zero disables velocity check.
|
|
// @Units: m/s
|
|
// @Range: 0 60
|
|
// @Increment: 0.1
|
|
// @User: Advanced
|
|
AP_GROUPINFO("CRASH_VEL_MIN", 59, ParametersG2, crash_vel_min, 0.08),
|
|
|
|
// @Param: CRASH_TRAT_MIN
|
|
// @DisplayName: Crash turn rate minimum
|
|
// @Description: Turn rate below this threshold with accompanying throttle demand triggers crash detection. Zero disables turn rate check.
|
|
// @Units: deg/s
|
|
// @Range: 0 360
|
|
// @Increment: 1
|
|
// @User: Advanced
|
|
AP_GROUPINFO("CRASH_TRAT_MIN", 60, ParametersG2, crash_turn_rate_min, 10.0),
|
|
|
|
// @Param: CRASH_TIMEOUT
|
|
// @DisplayName: Crash timeout
|
|
// @Description: Crash conditions persisting for this duration trigger crash detection.
|
|
// @Units: s
|
|
// @Range: 0 60
|
|
// @Increment: 0.5
|
|
// @User: Advanced
|
|
AP_GROUPINFO("CRASH_TIMEOUT", 61, ParametersG2, crash_timeout, 2.0),
|
|
|
|
// @Param: GUID_TIMEOUT
|
|
// @DisplayName: Guided mode timeout
|
|
// @Description: Guided mode timeout after which vehicle will stop if no updates are received from caller. Only applicable during velocity, throttle, heading or turn rate control
|
|
// @Units: s
|
|
// @Range: 0.1 5
|
|
// @User: Advanced
|
|
AP_GROUPINFO("GUID_TIMEOUT", 62, ParametersG2, guided_timeout, 3.0),
|
|
|
|
AP_GROUPEND
|
|
};
|
|
|
|
ParametersG2::ParametersG2(void)
|
|
:
|
|
#if AP_ROVER_ADVANCED_FAILSAFE_ENABLED
|
|
afs(),
|
|
#endif
|
|
wheel_rate_control(wheel_encoder),
|
|
motors(wheel_rate_control),
|
|
attitude_control(),
|
|
smart_rtl(),
|
|
#if HAL_PROXIMITY_ENABLED
|
|
proximity(),
|
|
#endif
|
|
#if MODE_DOCK_ENABLED
|
|
mode_dock_ptr(&rover.mode_dock),
|
|
#endif
|
|
#if AP_AVOIDANCE_ENABLED
|
|
avoid(),
|
|
#endif
|
|
#if AP_FOLLOW_ENABLED
|
|
follow(),
|
|
#endif
|
|
windvane(),
|
|
wp_nav(attitude_control, pos_control),
|
|
sailboat(),
|
|
pos_control(attitude_control)
|
|
{
|
|
AP_Param::setup_object_defaults(this, var_info);
|
|
}
|
|
|
|
|
|
/*
|
|
This is a conversion table from old parameter values to new
|
|
parameter names. The startup code looks for saved values of the old
|
|
parameters and will copy them across to the new parameters if the
|
|
new parameter does not yet have a saved value. It then saves the new
|
|
value.
|
|
|
|
Note that this works even if the old parameter has been removed. It
|
|
relies on the old k_param index not being removed
|
|
|
|
The second column below is the index in the var_info[] table for the
|
|
old object. This should be zero for top level parameters.
|
|
*/
|
|
const AP_Param::ConversionInfo conversion_table[] = {
|
|
// PARAMETER_CONVERSION - Added: May-2024 for Rover-4.6
|
|
{ Parameters::k_param_g2, 113, AP_PARAM_INT8, "TRQ1_TYPE" },
|
|
{ Parameters::k_param_g2, 177, AP_PARAM_INT8, "TRQ1_ONOFF_PIN" },
|
|
{ Parameters::k_param_g2, 241, AP_PARAM_INT8, "TRQ1_DE_PIN" },
|
|
{ Parameters::k_param_g2, 305, AP_PARAM_INT16, "TRQ1_OPTIONS" },
|
|
{ Parameters::k_param_g2, 369, AP_PARAM_INT8, "TRQ1_POWER" },
|
|
{ Parameters::k_param_g2, 433, AP_PARAM_FLOAT, "TRQ1_SLEW_TIME" },
|
|
{ Parameters::k_param_g2, 497, AP_PARAM_FLOAT, "TRQ1_DIR_DELAY" },
|
|
};
|
|
|
|
|
|
void Rover::load_parameters(void)
|
|
{
|
|
AP_Vehicle::load_parameters(g.format_version, Parameters::k_format_version);
|
|
|
|
AP_Param::convert_old_parameters(&conversion_table[0], ARRAY_SIZE(conversion_table));
|
|
|
|
AP_Param::set_frame_type_flags(AP_PARAM_FRAME_ROVER);
|
|
|
|
SRV_Channels::set_default_function(CH_1, SRV_Channel::k_steering);
|
|
SRV_Channels::set_default_function(CH_3, SRV_Channel::k_throttle);
|
|
|
|
if (is_balancebot()) {
|
|
g2.crash_angle.set_default(30);
|
|
}
|
|
|
|
// configure safety switch to allow stopping the motors while armed
|
|
#if HAL_HAVE_SAFETY_SWITCH
|
|
AP_Param::set_default_by_name("BRD_SAFETYOPTION", AP_BoardConfig::BOARD_SAFETY_OPTION_BUTTON_ACTIVE_SAFETY_OFF|
|
|
AP_BoardConfig::BOARD_SAFETY_OPTION_BUTTON_ACTIVE_SAFETY_ON|
|
|
AP_BoardConfig::BOARD_SAFETY_OPTION_BUTTON_ACTIVE_ARMED);
|
|
#endif
|
|
|
|
static const AP_Param::G2ObjectConversion g2_conversions[] {
|
|
#if AP_STATS_ENABLED
|
|
// PARAMETER_CONVERSION - Added: Jan-2024 for Rover-4.6
|
|
{ &stats, stats.var_info, 1 },
|
|
#endif
|
|
#if AP_SCRIPTING_ENABLED
|
|
// PARAMETER_CONVERSION - Added: Jan-2024 for Rover-4.6
|
|
{ &scripting, scripting.var_info, 41 },
|
|
#endif
|
|
#if AP_GRIPPER_ENABLED
|
|
// PARAMETER_CONVERSION - Added: Feb-2024 for Copter-4.6
|
|
{ &gripper, gripper.var_info, 39 },
|
|
#endif
|
|
#if AP_BEACON_ENABLED
|
|
// PARAMETER_CONVERSION - Added: Jun-2026 for Rover-4.8
|
|
{ &beacon, beacon.var_info, 6 },
|
|
#endif // AP_BEACON_ENABLED
|
|
};
|
|
|
|
AP_Param::convert_g2_objects(&g2, g2_conversions, ARRAY_SIZE(g2_conversions));
|
|
|
|
// PARAMETER_CONVERSION - Added: Feb-2024 for Rover-4.6
|
|
#if HAL_LOGGING_ENABLED
|
|
AP_Param::convert_class(g.k_param_logger, &logger, logger.var_info, 0, true);
|
|
#endif
|
|
|
|
// PARAMETER_CONVERSION - Added: Jul-2025 for ArduPilot-4.7
|
|
#if AP_RPM_ENABLED
|
|
AP_Param::convert_class(g.k_param_rpm_sensor_old, &rpm_sensor, rpm_sensor.var_info, 0, true, true);
|
|
#endif
|
|
|
|
static const AP_Param::TopLevelObjectConversion toplevel_conversions[] {
|
|
#if AP_SERIALMANAGER_ENABLED
|
|
// PARAMETER_CONVERSION - Added: Feb-2024 for Rover-4.6
|
|
{ &serial_manager, serial_manager.var_info, Parameters::k_param_serial_manager_old },
|
|
#endif
|
|
};
|
|
|
|
AP_Param::convert_toplevel_objects(toplevel_conversions, ARRAY_SIZE(toplevel_conversions));
|
|
|
|
#if HAL_GCS_ENABLED
|
|
// Move parameters into new MAV_ parameter namespace
|
|
// PARAMETER_CONVERSION - Added: Mar-2025 for ArduPilot-4.7
|
|
{
|
|
static const AP_Param::ConversionInfo gcs_conversion_info[] {
|
|
{ Parameters::k_param_sysid_this_mav_old, 0, AP_PARAM_INT16, "MAV_SYSID" },
|
|
{ Parameters::k_param_sysid_my_gcs_old, 0, AP_PARAM_INT16, "MAV_GCS_SYSID" },
|
|
{ Parameters::k_param_g2, 2, AP_PARAM_INT8, "MAV_OPTIONS" },
|
|
{ Parameters::k_param_telem_delay_old, 0, AP_PARAM_INT8, "MAV_TELEM_DELAY" },
|
|
};
|
|
AP_Param::convert_old_parameters(&gcs_conversion_info[0], ARRAY_SIZE(gcs_conversion_info));
|
|
}
|
|
#endif // HAL_GCS_ENABLED
|
|
|
|
}
|