Compare commits
72 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 75ee48d8bb | |||
| 344babfe5a | |||
| 3e63aec18d | |||
| c49fea2a54 | |||
| 5238537e65 | |||
| 247bfc35c5 | |||
| b9ff50f92b | |||
| 6ef8add164 | |||
| bcd5f6e208 | |||
| f0a20c19f9 | |||
| bcd516f6af | |||
| 81ec385c3e | |||
| 3a54b482d2 | |||
| a1b8b3dabb | |||
| 22f4222795 | |||
| ee3708ca82 | |||
| 940ce18e59 | |||
| ae4322126a | |||
| c6bb6cd435 | |||
| 160ae487ff | |||
| 256b329aab | |||
| 95119027a9 | |||
| 9e90fd193f | |||
| 832a90e07f | |||
| 2e6fd9dd72 | |||
| 94dc757363 | |||
| 5cfa0d548c | |||
| fa9f8734d0 | |||
| 3d5cb891a6 | |||
| afbaa71bfc | |||
| 873aa89022 | |||
| 1b3c6f7fd2 | |||
| 6604c52c98 | |||
| ef252481a8 | |||
| f35b92a487 | |||
| 3e8f054a1c | |||
| eed966a1c6 | |||
| 5a430f0ba6 | |||
| 4a5c00d0e4 | |||
| 778f80ca59 | |||
| 339e0f9691 | |||
| 7687e6e33f | |||
| 001efc1c0b | |||
| eccfb18b51 | |||
| 1d86ede6c6 | |||
| 84ce7d2fc6 | |||
| a18453d632 | |||
| 3ec684153a | |||
| 2237bfa9a9 | |||
| 7895976a17 | |||
| d7ab21b8d6 | |||
| 59710b15ae | |||
| 0180ad3a63 | |||
| e0663cd6ad | |||
| a6863f0930 | |||
| 34d4eb7b9e | |||
| efc3e64c00 | |||
| 0369abd556 | |||
| 75e4047f2a | |||
| 310cbbedb1 | |||
| 6f81998e27 | |||
| edda54b26b | |||
| e29771cd97 | |||
| ac74a02d7c | |||
| d13692ca46 | |||
| 77d854b045 | |||
| fae563b35e | |||
| 4c130769bd | |||
| 599ea7545d | |||
| 9fd126194b | |||
| 6d15019717 | |||
| 6b2b20bd6e |
@@ -27,7 +27,7 @@ jobs:
|
||||
"failsafe_web",
|
||||
]
|
||||
container:
|
||||
image: px4io/px4-dev:v1.16.0-ondemand
|
||||
image: px4io/px4-dev:v1.16.0-rc1-258-g0369abd556
|
||||
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
|
||||
steps:
|
||||
- name: Install Node v20.18.0
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
name: Analyzing ${{ matrix.target }}
|
||||
runs-on: [runs-on,runner=8cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false]
|
||||
container:
|
||||
image: px4io/px4-dev:v1.16.0-ondemand
|
||||
image: px4io/px4-dev:v1.16.0-rc1-258-g0369abd556
|
||||
strategy:
|
||||
matrix:
|
||||
target: [px4_fmu-v5x, px4_fmu-v6x]
|
||||
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
name: Checking ${{ matrix.target }}
|
||||
runs-on: [runs-on,runner=8cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false]
|
||||
container:
|
||||
image: px4io/px4-dev:v1.16.0-ondemand
|
||||
image: px4io/px4-dev:v1.16.0-rc1-258-g0369abd556
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
- name: Build PX4 and Run Test [${{ matrix.config }}]
|
||||
uses: addnab/docker-run-action@v3
|
||||
with:
|
||||
image: px4io/px4-dev:v1.16.0-ondemand
|
||||
image: px4io/px4-dev:v1.16.0-rc1-258-g0369abd556
|
||||
options: -v ${{ github.workspace }}:/workspace
|
||||
run: |
|
||||
cd /workspace
|
||||
|
||||
@@ -11,13 +11,11 @@ on:
|
||||
- 'main'
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '.github/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
- '**'
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '.github/**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -33,6 +31,12 @@ jobs:
|
||||
- name: Git Ownership Workaround
|
||||
run: git config --system --add safe.directory '*'
|
||||
|
||||
- name: Update ROS Keys
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/ros2.list && \
|
||||
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
|
||||
|
||||
- name: Install gazebo
|
||||
run: |
|
||||
apt update && apt install -y gazebo11 libgazebo11-dev gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly libgstreamer-plugins-base1.0-dev
|
||||
|
||||
@@ -6,6 +6,11 @@ CONFIG:
|
||||
buildType: RelWithDebInfo
|
||||
settings:
|
||||
CONFIG: px4_sitl_default
|
||||
px4_sitl_spacecraft:
|
||||
short: px4_sitl_spacecraft
|
||||
buildType: RelWithDebInfo
|
||||
settings:
|
||||
CONFIG: px4_sitl_spacecraft
|
||||
px4_sitl_nolockstep:
|
||||
short: px4_sitl_nolockstep
|
||||
buildType: RelWithDebInfo
|
||||
@@ -301,6 +306,11 @@ CONFIG:
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: holybro_durandal-v1_default
|
||||
holybro_kakuteh7-wing_default:
|
||||
short: holybro_kakuteh7-wing
|
||||
buildType: MinSizeRel
|
||||
settings:
|
||||
CONFIG: holybro_kakuteh7-wing_default
|
||||
holybro_kakuteh7dualimu_default:
|
||||
short: holybro_kakuteh7dualimu
|
||||
buildType: MinSizeRel
|
||||
|
||||
@@ -216,12 +216,33 @@ foreach(board_extra_file ${OPTIONAL_BOARD_EXTRAS})
|
||||
if(CONFIG_SYSTEMCMDS_BL_UPDATE)
|
||||
# generate rc.board_bootloader_upgrade
|
||||
set(BOARD_FIRMWARE_BIN "${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_bootloader.bin")
|
||||
configure_file(${PX4_SOURCE_DIR}/platforms/nuttx/init/rc.board_bootloader_upgrade.in ${romfs_gen_root_dir}/init.d/rc.board_bootloader_upgrade @ONLY)
|
||||
message(STATUS "ROMFS: Adding platforms/nuttx/init/rc.board_bootloader_upgrade -> /etc/init.d/rc.board_bootloader_upgrade")
|
||||
|
||||
# Generate the file using configure_file at configure time to a temporary location
|
||||
set(bootloader_upgrade_tmp ${CMAKE_CURRENT_BINARY_DIR}/rc.board_bootloader_upgrade.tmp)
|
||||
configure_file(${PX4_SOURCE_DIR}/platforms/nuttx/init/rc.board_bootloader_upgrade.in ${bootloader_upgrade_tmp} @ONLY)
|
||||
|
||||
# Then copy it at build time with proper dependencies
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
${romfs_gen_root_dir}/init.d/rc.board_bootloader_upgrade
|
||||
rc.board_bootloader_upgrade.stamp
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${bootloader_upgrade_tmp} ${romfs_gen_root_dir}/init.d/rc.board_bootloader_upgrade
|
||||
COMMAND ${CMAKE_COMMAND} -E touch rc.board_bootloader_upgrade.stamp
|
||||
DEPENDS
|
||||
${bootloader_upgrade_tmp}
|
||||
${PX4_SOURCE_DIR}/platforms/nuttx/init/rc.board_bootloader_upgrade.in
|
||||
romfs_copy.stamp
|
||||
COMMENT "ROMFS: copying rc.board_bootloader_upgrade"
|
||||
)
|
||||
|
||||
list(APPEND extras_dependencies
|
||||
rc.board_bootloader_upgrade.stamp
|
||||
)
|
||||
else()
|
||||
# remove bootloader from extras
|
||||
list(REMOVE_ITEM OPTIONAL_BOARD_EXTRAS ${board_extra_file})
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ param set-default NAV_ACC_RAD 0.5
|
||||
|
||||
# Differential Parameters
|
||||
param set-default RD_WHEEL_TRACK 0.3
|
||||
param set-default RD_MAX_THR_YAW_R 1.5
|
||||
param set-default RD_TRANS_DRV_TRN 0.349066
|
||||
param set-default RD_TRANS_TRN_DRV 0.174533
|
||||
|
||||
@@ -31,14 +30,16 @@ param set-default RO_YAW_RATE_P 0.25
|
||||
param set-default RO_YAW_RATE_LIM 180
|
||||
param set-default RO_YAW_ACCEL_LIM 120
|
||||
param set-default RO_YAW_DECEL_LIM 1000
|
||||
param set-default RO_YAW_RATE_CORR 1.43
|
||||
|
||||
# Rover Attitude Control Parameters
|
||||
param set-default RO_YAW_P 5
|
||||
|
||||
# Rover Position Control Parameters
|
||||
# Rover Velocity Control Parameters
|
||||
param set-default RO_SPEED_LIM 2
|
||||
param set-default RO_SPEED_I 0.01
|
||||
param set-default RO_SPEED_P 0.1
|
||||
param set-defatul RO_SPEED_RED 1
|
||||
|
||||
# Pure Pursuit parameters
|
||||
param set-default PP_LOOKAHD_GAIN 1
|
||||
|
||||
@@ -1,51 +1,68 @@
|
||||
#!/bin/sh
|
||||
# @name Gazebo lawnmower
|
||||
# @name Gazebo - Zero Turn Lawnmower
|
||||
# @type Rover
|
||||
# @class Rover
|
||||
|
||||
. ${R}etc/init.d/rc.rover_differential_defaults
|
||||
|
||||
PX4_SIMULATOR=${PX4_SIMULATOR:=gz}
|
||||
PX4_GZ_WORLD=${PX4_GZ_WORLD:=default}
|
||||
PX4_GZ_WORLD=${PX4_GZ_WORLD:=lawn}
|
||||
PX4_SIM_MODEL=${PX4_SIM_MODEL:=lawnmower}
|
||||
|
||||
param set-default SIM_GZ_EN 1 # Gazebo bridge
|
||||
|
||||
param set-default NAV_ACC_RAD 0.5
|
||||
|
||||
# We can arm and drive in manual mode when it slides and GPS check fails:
|
||||
param set-default COM_ARM_WO_GPS 1
|
||||
|
||||
# Rover parameters
|
||||
# Differential Parameters
|
||||
param set-default RD_WHEEL_TRACK 0.9
|
||||
param set-default RD_YAW_RATE_I 0.1
|
||||
param set-default RD_YAW_RATE_P 5
|
||||
param set-default RD_MAX_ACCEL 1
|
||||
param set-default RD_MAX_JERK 3
|
||||
param set-default RD_MAX_SPEED 8
|
||||
param set-default RD_YAW_P 5
|
||||
param set-default RD_YAW_I 0.1
|
||||
param set-default RD_MAX_YAW_RATE 30
|
||||
param set-default RD_TRANS_DRV_TRN 0.349066
|
||||
param set-default RD_TRANS_TRN_DRV 0.174533
|
||||
|
||||
# Rover Control Parameters
|
||||
param set-default RO_ACCEL_LIM 1.5
|
||||
param set-default RO_DECEL_LIM 5
|
||||
param set-default RO_JERK_LIM 15
|
||||
param set-default RO_MAX_THR_SPEED 2.7
|
||||
|
||||
# Rover Rate Control Parameters
|
||||
param set-default RO_YAW_RATE_I 0.2
|
||||
param set-default RO_YAW_RATE_P 1.0
|
||||
param set-default RO_YAW_RATE_LIM 60
|
||||
param set-default RO_YAW_ACCEL_LIM 50
|
||||
param set-default RO_YAW_DECEL_LIM 1000
|
||||
param set-default RO_YAW_RATE_CORR 1.0
|
||||
|
||||
# Rover Attitude Control Parameters
|
||||
param set-default RO_YAW_P 5
|
||||
|
||||
# Rover Velocity Control Parameters
|
||||
param set-default RO_SPEED_LIM 2.1
|
||||
param set-default RO_SPEED_I 0.01
|
||||
param set-default RO_SPEED_P 0.1
|
||||
param set-defatul RO_SPEED_RED 1.0
|
||||
|
||||
# Pure pursuit parameters
|
||||
param set-default PP_LOOKAHD_MAX 30
|
||||
param set-default PP_LOOKAHD_MIN 2
|
||||
param set-default PP_LOOKAHD_GAIN 1
|
||||
param set-default PP_LOOKAHD_MAX 10
|
||||
param set-default PP_LOOKAHD_MIN 1
|
||||
|
||||
# Actuator mapping - set SITL motors/servos output parameters:
|
||||
|
||||
# "Motors" - motor channels 0 (Right) and 1 (Left) - via Wheels GZ bridge:
|
||||
param set-default SIM_GZ_WH_FUNC1 101 # right wheel
|
||||
#param set-default SIM_GZ_WH_MIN1 0
|
||||
#param set-default SIM_GZ_WH_MAX1 200
|
||||
#param set-default SIM_GZ_WH_DIS1 100
|
||||
#param set-default SIM_GZ_WH_FAIL1 100
|
||||
param set-default SIM_GZ_WH_MIN1 87
|
||||
param set-default SIM_GZ_WH_MAX1 113
|
||||
param set-default SIM_GZ_WH_DIS1 100
|
||||
param set-default SIM_GZ_WH_FAIL1 100
|
||||
|
||||
param set-default SIM_GZ_WH_FUNC2 102 # left wheel
|
||||
#param set-default SIM_GZ_WH_MIN2 0
|
||||
#param set-default SIM_GZ_WH_MAX2 200
|
||||
#param set-default SIM_GZ_WH_DIS2 100
|
||||
#param set-default SIM_GZ_WH_FAIL2 100
|
||||
param set-default SIM_GZ_WH_MIN2 87
|
||||
param set-default SIM_GZ_WH_MAX2 113
|
||||
param set-default SIM_GZ_WH_DIS2 100
|
||||
param set-default SIM_GZ_WH_FAIL2 100
|
||||
|
||||
param set-default SIM_GZ_WH_REV 0 # no need to reverse any wheels
|
||||
|
||||
|
||||
@@ -30,14 +30,16 @@ param set-default RO_MAX_THR_SPEED 3.1
|
||||
param set-default RO_YAW_RATE_I 0.1
|
||||
param set-default RO_YAW_RATE_P 1
|
||||
param set-default RO_YAW_RATE_LIM 180
|
||||
param set-default RO_YAW_RATE_CORR 1
|
||||
|
||||
# Rover Attitude Control Parameters
|
||||
param set-default RO_YAW_P 3
|
||||
|
||||
# Rover Position Control Parameters
|
||||
# Rover Velocity Control Parameters
|
||||
param set-default RO_SPEED_LIM 3
|
||||
param set-default RO_SPEED_I 0.1
|
||||
param set-default RO_SPEED_P 1
|
||||
param set-default RO_SPEED_RED 1
|
||||
|
||||
# Pure Pursuit parameters
|
||||
param set-default PP_LOOKAHD_GAIN 1
|
||||
|
||||
@@ -15,8 +15,6 @@ param set-default NAV_ACC_RAD 0.5
|
||||
|
||||
# Mecanum Parameters
|
||||
param set-default RM_WHEEL_TRACK 0.3
|
||||
param set-default RM_MAX_THR_YAW_R 1.2
|
||||
param set-default RM_MISS_SPD_GAIN 1
|
||||
|
||||
# Rover Control Parameters
|
||||
param set-default RO_ACCEL_LIM 3
|
||||
@@ -30,14 +28,16 @@ param set-default RO_YAW_RATE_P 0.1
|
||||
param set-default RO_YAW_RATE_LIM 120
|
||||
param set-default RO_YAW_ACCEL_LIM 240
|
||||
param set-default RO_YAW_DECEL_LIM 1000
|
||||
param set-default RO_YAW_RATE_CORR 1.75
|
||||
|
||||
# Rover Attitude Control Parameters
|
||||
param set-default RO_YAW_P 5
|
||||
|
||||
# Rover Position Control Parameters
|
||||
# Rover Velocity Control Parameters
|
||||
param set-default RO_SPEED_LIM 2
|
||||
param set-default RO_SPEED_I 0.5
|
||||
param set-default RO_SPEED_P 1
|
||||
param set-default RO_SPEED_RED 1
|
||||
|
||||
# Pure Pursuit parameters
|
||||
param set-default PP_LOOKAHD_GAIN 0.5
|
||||
|
||||
@@ -1,155 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name 6DoF Spacecraft Model
|
||||
#
|
||||
# @type Freeflyer with 8 thrusters
|
||||
#
|
||||
# @maintainer Pedro Roque <padr@kth.se>
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.sc_defaults
|
||||
|
||||
param set-default CA_AIRFRAME 15
|
||||
param set-default MAV_TYPE 99
|
||||
|
||||
param set-default CA_THRUSTER_CNT 12
|
||||
param set-default CA_R_REV 0
|
||||
|
||||
# param set-default FW_ARSP_MODE 1
|
||||
|
||||
# Auto to be provided by Custom Airframe
|
||||
param set-default CA_METHOD 0
|
||||
|
||||
# disable attitude failure detection
|
||||
param set-default FD_FAIL_P 0
|
||||
param set-default FD_FAIL_R 0
|
||||
|
||||
# Set proper failsafes
|
||||
param set-default COM_ACT_FAIL_ACT 0
|
||||
param set-default COM_LOW_BAT_ACT 0
|
||||
param set-default NAV_DLL_ACT 0
|
||||
param set-default GF_ACTION 1
|
||||
param set-default NAV_RCL_ACT 1
|
||||
param set-default COM_POSCTL_NAVL 2
|
||||
|
||||
# Set thrusters
|
||||
param set-default CA_THRUSTER0_PX -0.50
|
||||
param set-default CA_THRUSTER0_PY 0.50
|
||||
param set-default CA_THRUSTER0_PZ 0.0
|
||||
param set-default CA_THRUSTER0_CT 0.237
|
||||
param set-default CA_THRUSTER0_AX 0.0
|
||||
param set-default CA_THRUSTER0_AY -1.0
|
||||
param set-default CA_THRUSTER0_AZ 0.0
|
||||
|
||||
param set-default CA_THRUSTER1_PX 0.50
|
||||
param set-default CA_THRUSTER1_PY 0.50
|
||||
param set-default CA_THRUSTER1_PZ 0.0
|
||||
param set-default CA_THRUSTER1_CT 0.237
|
||||
param set-default CA_THRUSTER1_AX 0.0
|
||||
param set-default CA_THRUSTER1_AY -1.0
|
||||
param set-default CA_THRUSTER1_AZ 0.0
|
||||
|
||||
param set-default CA_THRUSTER2_PX 0.50
|
||||
param set-default CA_THRUSTER2_PY -0.50
|
||||
param set-default CA_THRUSTER2_PZ 0.0
|
||||
param set-default CA_THRUSTER2_CT 0.237
|
||||
param set-default CA_THRUSTER2_AX 0.0
|
||||
param set-default CA_THRUSTER2_AY 1.0
|
||||
param set-default CA_THRUSTER2_AZ 0.0
|
||||
|
||||
param set-default CA_THRUSTER3_PX -0.50
|
||||
param set-default CA_THRUSTER3_PY -0.50
|
||||
param set-default CA_THRUSTER3_PZ 0.0
|
||||
param set-default CA_THRUSTER3_CT 0.237
|
||||
param set-default CA_THRUSTER3_AX 0.0
|
||||
param set-default CA_THRUSTER3_AY 1.0
|
||||
param set-default CA_THRUSTER3_AZ 0.0
|
||||
|
||||
param set-default CA_THRUSTER4_PX -0.50
|
||||
param set-default CA_THRUSTER4_PY 0.0
|
||||
param set-default CA_THRUSTER4_PZ -0.50
|
||||
param set-default CA_THRUSTER4_CT 0.237
|
||||
param set-default CA_THRUSTER4_AX 1.0
|
||||
param set-default CA_THRUSTER4_AY 0.0
|
||||
param set-default CA_THRUSTER4_AZ 0.0
|
||||
|
||||
param set-default CA_THRUSTER5_PX 0.50
|
||||
param set-default CA_THRUSTER5_PY 0.0
|
||||
param set-default CA_THRUSTER5_PZ -0.50
|
||||
param set-default CA_THRUSTER5_CT 0.237
|
||||
param set-default CA_THRUSTER5_AX -1.0
|
||||
param set-default CA_THRUSTER5_AY 0.0
|
||||
param set-default CA_THRUSTER5_AZ 0.0
|
||||
|
||||
param set-default CA_THRUSTER6_PX 0.50
|
||||
param set-default CA_THRUSTER6_PY 0.0
|
||||
param set-default CA_THRUSTER6_PZ 0.50
|
||||
param set-default CA_THRUSTER6_CT 0.237
|
||||
param set-default CA_THRUSTER6_AX -1.0
|
||||
param set-default CA_THRUSTER6_AY 0.0
|
||||
param set-default CA_THRUSTER6_AZ 0.0
|
||||
|
||||
param set-default CA_THRUSTER7_PX -0.50
|
||||
param set-default CA_THRUSTER7_PY 0.0
|
||||
param set-default CA_THRUSTER7_PZ 0.50
|
||||
param set-default CA_THRUSTER7_CT 0.237
|
||||
param set-default CA_THRUSTER7_AX 1.0
|
||||
param set-default CA_THRUSTER7_AY 0.0
|
||||
param set-default CA_THRUSTER7_AZ 0.0
|
||||
|
||||
param set-default CA_THRUSTER8_PX 0.0
|
||||
param set-default CA_THRUSTER8_PY -0.50
|
||||
param set-default CA_THRUSTER8_PZ -0.50
|
||||
param set-default CA_THRUSTER8_CT 0.237
|
||||
param set-default CA_THRUSTER8_AX 0.0
|
||||
param set-default CA_THRUSTER8_AY 0.0
|
||||
param set-default CA_THRUSTER8_AZ 1.0
|
||||
|
||||
param set-default CA_THRUSTER9_PX 0.0
|
||||
param set-default CA_THRUSTER9_PY 0.50
|
||||
param set-default CA_THRUSTER9_PZ -0.50
|
||||
param set-default CA_THRUSTER9_CT 0.237
|
||||
param set-default CA_THRUSTER9_AX 0.0
|
||||
param set-default CA_THRUSTER9_AY 0.0
|
||||
param set-default CA_THRUSTER9_AZ 1.0
|
||||
|
||||
param set-default CA_THRUSTER10_PX 0.0
|
||||
param set-default CA_THRUSTER10_PY 0.50
|
||||
param set-default CA_THRUSTER10_PZ 0.50
|
||||
param set-default CA_THRUSTER10_CT 0.237
|
||||
param set-default CA_THRUSTER10_AX 0.0
|
||||
param set-default CA_THRUSTER10_AY 0.0
|
||||
param set-default CA_THRUSTER10_AZ -1.0
|
||||
|
||||
param set-default CA_THRUSTER11_PX 0.0
|
||||
param set-default CA_THRUSTER11_PY -0.50
|
||||
param set-default CA_THRUSTER11_PZ 0.50
|
||||
param set-default CA_THRUSTER11_CT 0.237
|
||||
param set-default CA_THRUSTER11_AX 0.0
|
||||
param set-default CA_THRUSTER11_AY 0.0
|
||||
param set-default CA_THRUSTER11_AZ -1.0
|
||||
|
||||
param set-default PWM_MAIN_FUNC1 101
|
||||
param set-default PWM_MAIN_FUNC2 102
|
||||
param set-default PWM_MAIN_FUNC3 103
|
||||
param set-default PWM_MAIN_FUNC4 104
|
||||
param set-default PWM_MAIN_FUNC5 105
|
||||
param set-default PWM_MAIN_FUNC6 106
|
||||
param set-default PWM_MAIN_FUNC7 107
|
||||
param set-default PWM_MAIN_FUNC8 108
|
||||
param set-default PWM_MAIN_FUNC9 109
|
||||
param set-default PWM_MAIN_FUNC10 110
|
||||
param set-default PWM_MAIN_FUNC11 111
|
||||
param set-default PWM_MAIN_FUNC12 112
|
||||
|
||||
# PWM Simulation
|
||||
param set PWM_SIM_PWM_MAX 10000
|
||||
param set PWM_SIM_PWM_MIN 0
|
||||
|
||||
# Controller Tunings
|
||||
param set-default SC_ROLLRATE_P 0.14
|
||||
param set-default SC_PITCHRATE_P 0.14
|
||||
param set-default SC_ROLLRATE_I 0.3
|
||||
param set-default SC_PITCHRATE_I 0.3
|
||||
param set-default SC_ROLLRATE_D 0.004
|
||||
param set-default SC_PITCHRATE_D 0.004
|
||||
@@ -20,7 +20,7 @@ param set-default COM_ARM_CHK_ESCS 0 # We don't have ESCs
|
||||
param set-default FD_ESCS_EN 0 # We don't have ESCs - but maybe we need this later?
|
||||
|
||||
param set-default CA_AIRFRAME 14
|
||||
param set-default MAV_TYPE 99
|
||||
param set-default MAV_TYPE 45
|
||||
|
||||
param set-default CA_THRUSTER_CNT 8
|
||||
param set-default CA_R_REV 0
|
||||
|
||||
@@ -114,7 +114,6 @@ px4_add_romfs_files(
|
||||
17001_flightgear_tf-g1
|
||||
17002_flightgear_tf-g2
|
||||
|
||||
71001_gazebo-classic_spacecraft_dart
|
||||
71002_gz_spacecraft_2d
|
||||
|
||||
# [22000, 22999] Reserve for custom models
|
||||
|
||||
@@ -26,7 +26,6 @@ param set-default NAV_ACC_RAD 0.5
|
||||
|
||||
# Differential Parameters
|
||||
param set-default RD_WHEEL_TRACK 0.3
|
||||
param set-default RD_MAX_THR_YAW_R 0.7
|
||||
param set-default RD_TRANS_DRV_TRN 0.785398
|
||||
param set-default RD_TRANS_TRN_DRV 0.139626
|
||||
|
||||
@@ -42,14 +41,16 @@ param set-default RO_YAW_RATE_P 0.1
|
||||
param set-default RO_YAW_RATE_LIM 250
|
||||
param set-default RO_YAW_ACCEL_LIM 600
|
||||
param set-default RO_YAW_DECEL_LIM 600
|
||||
param set-default RO_YAW_RATE_CORR 2.7
|
||||
|
||||
# Rover Attitude Control Parameters
|
||||
param set-default RO_YAW_P 2.5
|
||||
|
||||
# Rover Position Control Parameters
|
||||
# Rover Velocity Control Parameters
|
||||
param set-default RO_SPEED_LIM 1.6
|
||||
param set-default RO_SPEED_I 0.01
|
||||
param set-default RO_SPEED_P 0.1
|
||||
param set-default RO_SPEED_RED 1
|
||||
|
||||
# Pure Pursuit parameters
|
||||
param set-default PP_LOOKAHD_GAIN 1
|
||||
|
||||
@@ -33,14 +33,16 @@ param set-default RO_MAX_THR_SPEED 2.8
|
||||
param set-default RO_YAW_RATE_I 0.1
|
||||
param set-default RO_YAW_RATE_P 0.1
|
||||
param set-default RO_YAW_RATE_LIM 120
|
||||
param set-default RO_YAW_RATE_CORR 1
|
||||
|
||||
# Rover Attitude Control Parameters
|
||||
param set-default RO_YAW_P 2.5
|
||||
|
||||
# Rover Position Control Parameters
|
||||
# Rover Velocity Control Parameters
|
||||
param set-default RO_SPEED_LIM 2.5
|
||||
param set-default RO_SPEED_I 0.01
|
||||
param set-default RO_SPEED_P 0.1
|
||||
param set-default RO_SPEED_RED 1
|
||||
|
||||
# Pure pursuit parameters
|
||||
param set-default PP_LOOKAHD_GAIN 1
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
. ${R}etc/init.d/rc.sc_defaults
|
||||
|
||||
param set-default CA_AIRFRAME 14
|
||||
param set-default MAV_TYPE 99
|
||||
param set-default MAV_TYPE 45
|
||||
|
||||
param set-default CA_THRUSTER_CNT 8
|
||||
param set-default CA_R_REV 0
|
||||
|
||||
@@ -14,6 +14,7 @@ control_allocator start
|
||||
# Start attitude controller.
|
||||
#
|
||||
fw_rate_control start
|
||||
fw_indi_pos_control start
|
||||
fw_att_control start
|
||||
fw_mode_manager start
|
||||
fw_lat_lon_control start
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
# NOTE: Script variables are declared/initialized/unset in the rcS script.
|
||||
#
|
||||
|
||||
set VEHICLE_TYPE sc
|
||||
set VEHICLE_TYPE spacecraft
|
||||
|
||||
# MAV_TYPE_QUADROTOR 2
|
||||
#param set-default MAV_TYPE 12
|
||||
# MAV_TYPE_SPACECRAFT_ORBITTER
|
||||
param set-default MAV_TYPE 45
|
||||
|
||||
# Set micro-dds-client to use ethernet and IP-address 192.168.0.1
|
||||
param set-default UXRCE_DDS_AG_IP -1062731775
|
||||
|
||||
@@ -68,6 +68,15 @@ then
|
||||
. ${R}etc/init.d/rc.vtol_apps
|
||||
fi
|
||||
|
||||
#
|
||||
# Spapcecraft setup.
|
||||
#
|
||||
if [ $VEHICLE_TYPE = spacecraft ]
|
||||
then
|
||||
# Start standard multicopter apps.
|
||||
. ${R}etc/init.d/rc.sc_apps
|
||||
fi
|
||||
|
||||
#
|
||||
# Airship setup.
|
||||
#
|
||||
|
||||
@@ -280,6 +280,14 @@ else
|
||||
#
|
||||
send_event start
|
||||
|
||||
#
|
||||
# Start the hardfault streamer.
|
||||
#
|
||||
if param compare -s SYS_HF_MAV 1
|
||||
then
|
||||
hardfault_stream start
|
||||
fi
|
||||
|
||||
#
|
||||
# Start the resource load monitor.
|
||||
#
|
||||
|
||||
@@ -35,6 +35,7 @@ if args.filter:
|
||||
for board in args.filter.split(','):
|
||||
board_filter.append(board)
|
||||
|
||||
default_container = 'ghcr.io/px4/px4-dev:v1.16.0-rc1-258-g0369abd556'
|
||||
build_configs = []
|
||||
grouped_targets = {}
|
||||
excluded_boards = ['modalai_voxl2', 'px4_ros2'] # TODO: fix and enable
|
||||
@@ -86,7 +87,7 @@ def process_target(px4board_file, target_name):
|
||||
assert platform, f"PLATFORM not found in {px4board_file}"
|
||||
|
||||
if platform not in excluded_platforms:
|
||||
container = 'ghcr.io/px4/px4-dev:v1.16.0-ondemand'
|
||||
container = default_container
|
||||
if platform == 'posix':
|
||||
group = 'base'
|
||||
if toolchain:
|
||||
@@ -120,7 +121,7 @@ if(verbose):
|
||||
# - Events
|
||||
metadata_targets = ['airframe_metadata', 'parameters_metadata', 'extract_events']
|
||||
grouped_targets['base'] = {}
|
||||
grouped_targets['base']['container'] = 'ghcr.io/px4/px4-dev:v1.16.0-ondemand'
|
||||
grouped_targets['base']['container'] = default_container
|
||||
grouped_targets['base']['manufacturers'] = {}
|
||||
grouped_targets['base']['manufacturers']['px4'] = []
|
||||
grouped_targets['base']['manufacturers']['px4'] += metadata_targets
|
||||
|
||||
@@ -15,7 +15,7 @@ fi
|
||||
|
||||
# otherwise default to nuttx
|
||||
if [ -z ${PX4_DOCKER_REPO+x} ]; then
|
||||
PX4_DOCKER_REPO="px4io/px4-dev:v1.16.0-ondemand"
|
||||
PX4_DOCKER_REPO="px4io/px4-dev:v1.16.0-rc1-258-g0369abd556"
|
||||
fi
|
||||
|
||||
echo "PX4_DOCKER_REPO: $PX4_DOCKER_REPO";
|
||||
|
||||
@@ -27,3 +27,4 @@ six>=1.12.0
|
||||
toml>=0.9
|
||||
sympy>=1.10.1
|
||||
pycryptodome
|
||||
lark
|
||||
|
||||
@@ -62,6 +62,7 @@ CONFIG_MODULES_FW_RATE_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_GYRO_FFT=y
|
||||
CONFIG_MODULES_HARDFAULT_STREAM=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
|
||||
CONFIG_MODULES_LOAD_MON=y
|
||||
|
||||
@@ -43,6 +43,7 @@ CONFIG_FIGURE_OF_EIGHT=y
|
||||
CONFIG_MODULES_FW_RATE_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_HARDFAULT_STREAM=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
|
||||
CONFIG_MODULES_LOAD_MON=y
|
||||
|
||||
@@ -20,6 +20,7 @@ CONFIG_DRIVERS_GPS=y
|
||||
CONFIG_DRIVERS_IMU_BOSCH_BMI088=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_IIM42652=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_IIM42653=y
|
||||
CONFIG_COMMON_INS=y
|
||||
CONFIG_COMMON_LIGHT=y
|
||||
CONFIG_COMMON_MAGNETOMETER=y
|
||||
@@ -42,8 +43,8 @@ CONFIG_MODULES_EVENTS=y
|
||||
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
|
||||
CONFIG_MODULES_FW_ATT_CONTROL=y
|
||||
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
|
||||
CONFIG_MODULES_FW_MODE_MANAGER=y
|
||||
CONFIG_MODULES_FW_LATERAL_LONGITUDINAL_CONTROL=y
|
||||
CONFIG_MODULES_FW_MODE_MANAGER=y
|
||||
CONFIG_MODULES_FW_RATE_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
|
||||
@@ -12,10 +12,17 @@ else
|
||||
fi
|
||||
|
||||
iim42652 -s -R 22 start
|
||||
bmi088 -A -R 29 -s start
|
||||
bmi088 -G -R 29 -s start
|
||||
|
||||
ist8310 -I -R 18 start
|
||||
bmi088 -A -R 29 -s start
|
||||
if ! bmi088 -G -R 29 -s start
|
||||
then
|
||||
iim42653 -s -b 2 -R 22 start
|
||||
fi
|
||||
|
||||
if ! ist8310 -I -R 18 start
|
||||
then
|
||||
iis2mdc -I -R 37 start
|
||||
fi
|
||||
|
||||
bmp581 -s start
|
||||
icp201xx -I start
|
||||
|
||||
@@ -42,6 +42,7 @@ constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
|
||||
initSPIBus(SPI::Bus::SPI2, {
|
||||
initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortG, GPIO::Pin2}, SPI::DRDY{GPIO::PortG, GPIO::Pin3}),
|
||||
initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}),
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortD, GPIO::Pin12}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}),
|
||||
}, {GPIO::PortI, GPIO::Pin11}),
|
||||
// initSPIBus(SPI::Bus::SPI3,{
|
||||
// // no devices
|
||||
|
||||
@@ -5,6 +5,7 @@ CONFIG_BOARD_SERIAL_GPS2="/dev/ttyS1"
|
||||
CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS2"
|
||||
CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS3"
|
||||
CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS5"
|
||||
CONFIG_BOARD_SERIAL_RC="/dev/ttyS4"
|
||||
CONFIG_DRIVERS_ADC_BOARD_ADC=y
|
||||
CONFIG_DRIVERS_BAROMETER_BMP280=y
|
||||
CONFIG_DRIVERS_BAROMETER_GOERTEK_SPA06=y
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
#define BOARD_TYPE 1105
|
||||
#define BOARD_FLASH_SECTORS (14)
|
||||
#define BOARD_FLASH_SIZE (16 * 128 * 1024)
|
||||
#define APP_RESERVATION_SIZE (1 * 128 * 1024)
|
||||
#define APP_RESERVATION_SIZE (2 * 128 * 1024)
|
||||
|
||||
#define OSC_FREQ 16
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ CONFIG_MODULES_FW_LATERAL_LONGITUDINAL_CONTROL=y
|
||||
CONFIG_MODULES_FW_RATE_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_HARDFAULT_STREAM=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
|
||||
CONFIG_MODULES_LOAD_MON=y
|
||||
|
||||
@@ -62,6 +62,7 @@ CONFIG_MODULES_FW_LATERAL_LONGITUDINAL_CONTROL=y
|
||||
CONFIG_MODULES_FW_RATE_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_HARDFAULT_STREAM=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
|
||||
CONFIG_MODULES_LOAD_MON=y
|
||||
|
||||
@@ -63,6 +63,7 @@ CONFIG_MODULES_FW_RATE_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_GYRO_FFT=y
|
||||
CONFIG_MODULES_HARDFAULT_STREAM=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
|
||||
CONFIG_MODULES_LOAD_MON=y
|
||||
|
||||
@@ -23,6 +23,7 @@ CONFIG_MODULES_FW_MODE_MANAGER=y
|
||||
CONFIG_MODULES_FW_LATERAL_LONGITUDINAL_CONTROL=y
|
||||
CONFIG_FIGURE_OF_EIGHT=y
|
||||
CONFIG_MODULES_FW_RATE_CONTROL=y
|
||||
CONFIG_MODULES_FW_INDI_POS_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_GYRO_FFT=y
|
||||
|
||||
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 627 KiB |
|
Before Width: | Height: | Size: 472 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 464 KiB |
|
Before Width: | Height: | Size: 456 KiB |
|
Before Width: | Height: | Size: 524 KiB |
|
Before Width: | Height: | Size: 434 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 474 KiB After Width: | Height: | Size: 474 KiB |
|
After Width: | Height: | Size: 3.0 MiB |
|
After Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 3.1 MiB |
|
After Width: | Height: | Size: 2.1 MiB |
|
After Width: | Height: | Size: 2.1 MiB |
|
After Width: | Height: | Size: 2.2 MiB |
|
After Width: | Height: | Size: 2.1 MiB |
|
After Width: | Height: | Size: 2.1 MiB |
|
After Width: | Height: | Size: 3.2 MiB |
@@ -408,16 +408,17 @@
|
||||
- [Helicopter (experimental)](frames_helicopter/index.md)
|
||||
- [Helicopter Config/Tuning](config_heli/index.md)
|
||||
- [Rovers (experimental)](frames_rover/index.md)
|
||||
- [Ackermann Rovers](frames_rover/ackermann.md)
|
||||
- [Drive Modes](flight_modes_rover/ackermann.md)
|
||||
- [Configuration/Tuning](config_rover/ackermann.md)
|
||||
- [Differential Rovers](frames_rover/differential.md)
|
||||
- [Drive Modes](flight_modes_rover/differential.md)
|
||||
- [Configuration/Tuning](config_rover/differential.md)
|
||||
- [Aion Robotics R1](frames_rover/aion_r1.md)
|
||||
- [Mecanum Rovers](frames_rover/mecanum.md)
|
||||
- [Drive Modes](flight_modes_rover/mecanum.md)
|
||||
- [Configuration/Tuning](config_rover/mecanum.md)
|
||||
- [Drive Modes](flight_modes_rover/index.md)
|
||||
- [Manual](flight_modes_rover/manual.md)
|
||||
- [Auto](flight_modes_rover/auto.md)
|
||||
- [Configuration/Tuning](config_rover/index.md)
|
||||
- [Basic Setup](config_rover/basic_setup.md)
|
||||
- [Rate Tuning](config_rover/rate_tuning.md)
|
||||
- [Attitude Tuning](config_rover/attitude_tuning.md)
|
||||
- [Velocity Tuning](config_rover/velocity_tuning.md)
|
||||
- [Position Tuning](config_rover/position_tuning.md)
|
||||
- [Complete Vehicles](complete_vehicles_rover/index.md)
|
||||
- [Aion Robotics R1](complete_vehicles_rover/aion_r1.md)
|
||||
- [(Deprecated) Rover Position Control](frames_rover/rover_position_control.md)
|
||||
- [Submarines (experimental)](frames_sub/index.md)
|
||||
- [BlueROV2](frames_sub/bluerov2.md)
|
||||
|
||||
@@ -9,11 +9,45 @@ This topic explains how to build the PX4 bootloader, and several methods for fla
|
||||
|
||||
::: info
|
||||
|
||||
- Most boards will need to use the [Debug Probe](#debug-probe-bootloader-update) to update the bootloader.
|
||||
- You can use [QGC Bootloader Update](#qgc-bootloader-update-sys-bl-update) with firmware that includes the [`bl-update` module](../modules/modules_command.md#bl-update).
|
||||
This is the easiest way to update the bootloader, provided the board is able to load firmware.
|
||||
- You can also use the [Debug Probe](#debug-probe-bootloader-update) to update the bootloader.
|
||||
This is useful for updating/fixing the bootloader when the board is bricked.
|
||||
- On [FMUv6X-RT](../flight_controller/pixhawk6x-rt.md) you can [install bootloader/unbrick boards via USB](bootloader_update_v6xrt.md).
|
||||
This is useful if you don't have a debug probe.
|
||||
- On FMUv2 and some custom firmware (only) you can use [QGC Bootloader Update](#qgc-bootloader-update).
|
||||
:::
|
||||
|
||||
:::
|
||||
|
||||
## QGC Bootloader Update (`SYS_BL_UPDATE`)
|
||||
|
||||
The easiest way to update the bootloader is to first use _QGroundControl_ to install firmware that contains the desired/latest bootloader.
|
||||
You can then initiate bootloader update on next restart by setting the parameter: [SYS_BL_UPDATE](../advanced_config/parameter_reference.md#SYS_BL_UPDATE).
|
||||
|
||||
This approach can be used if the [`bl-update` module](../modules/modules_command.md#bl-update) is present in the firmware.
|
||||
The easiest way to check this is just to see if the [SYS_BL_UPDATE](../advanced_config/parameter_reference.md#SYS_BL_UPDATE) parameter is [found in QGroundControl](../advanced_config/parameters.md#finding-a-parameter).
|
||||
|
||||
:::warning
|
||||
Boards that include the module will have the line `CONFIG_SYSTEMCMDS_BL_UPDATE=y` in their `default.px4board` file (for examples [see this search](https://github.com/search?q=repo%3APX4%2FPX4-Autopilot+path%3A**%2Fdefault.px4board+CONFIG_SYSTEMCMDS_BL_UPDATE%3Dy&type=code)).
|
||||
You can enable this key in your own custom firmware if needed.
|
||||
:::
|
||||
|
||||
The steps are:
|
||||
|
||||
1. Insert an SD card (enables boot logging to debug any problems).
|
||||
1. [Update the Firmware](../config/firmware.md#custom) with an image containing the new/desired bootloader.
|
||||
|
||||
::: info
|
||||
The updated bootloader might be included the default firmware for your board or supplied in custom firmware.
|
||||
:::
|
||||
|
||||
1. Wait for the vehicle to reboot.
|
||||
1. [Find and enable](../advanced_config/parameters.md) the parameter [SYS_BL_UPDATE](../advanced_config/parameter_reference.md#SYS_BL_UPDATE).
|
||||
1. Reboot (disconnect/reconnect the board).
|
||||
The bootloader update will only take a few seconds.
|
||||
|
||||
Generally at this point you may then want to [update the firmware](../config/firmware.md) again using the correct/newly installed bootloader.
|
||||
|
||||
An specific example of this process for updating the [FMUv2 bootloader](#fmuv2-bootloader-update) is given below.
|
||||
|
||||
## Building the PX4 Bootloader
|
||||
|
||||
@@ -49,11 +83,9 @@ The instructions in the repo README explain how to use it.
|
||||
The following steps explain how you can "manually" update the bootloader using a [compatible Debug Probe](../debug/swd_debug.md#debug-probes-for-px4-hardware):
|
||||
|
||||
1. Get a binary containing the bootloader (either from dev team or [build it yourself](#building-the-px4-bootloader)).
|
||||
|
||||
1. Get a [Debug Probe](../debug/swd_debug.md#debug-probes-for-px4-hardware).
|
||||
2. Get a [Debug Probe](../debug/swd_debug.md#debug-probes-for-px4-hardware).
|
||||
Connect the probe your PC via USB and setup the `gdbserver`.
|
||||
|
||||
1. Go into the directory containing the binary and run the command for your target bootloader in the terminal:
|
||||
3. Go into the directory containing the binary and run the command for your target bootloader in the terminal:
|
||||
|
||||
- FMUv6X
|
||||
|
||||
@@ -78,7 +110,7 @@ The following steps explain how you can "manually" update the bootloader using a
|
||||
Bootloaders from [PX4/PX4-Bootloader](https://github.com/PX4/PX4-Bootloader) are named with the pattern `*_bl.elf`.
|
||||
:::
|
||||
|
||||
1. The _gdb terminal_ appears and it should display the following output:
|
||||
4. The _gdb terminal_ appears and it should display the following output:
|
||||
|
||||
```sh
|
||||
GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.20171128-git
|
||||
@@ -98,28 +130,27 @@ The following steps explain how you can "manually" update the bootloader using a
|
||||
Reading symbols from px4fmuv5_bl.elf...done.
|
||||
```
|
||||
|
||||
1. Find your `<dronecode-probe-id>` by running an `ls` command in the **/dev/serial/by-id** directory.
|
||||
|
||||
1. Now connect to the debug probe with the following command:
|
||||
5. Find your `<dronecode-probe-id>` by running an `ls` command in the **/dev/serial/by-id** directory.
|
||||
6. Now connect to the debug probe with the following command:
|
||||
|
||||
```sh
|
||||
tar ext /dev/serial/by-id/<dronecode-probe-id>
|
||||
```
|
||||
|
||||
1. Power on the Pixhawk with another USB cable and connect the probe to the `FMU-DEBUG` port.
|
||||
7. Power on the Pixhawk with another USB cable and connect the probe to the `FMU-DEBUG` port.
|
||||
|
||||
::: info
|
||||
If using a Dronecode probe you may need to remove the case in order to connect to the `FMU-DEBUG` port (e.g. on Pixhawk 4 you would do this using a T6 Torx screwdriver).
|
||||
:::
|
||||
|
||||
1. Use the following command to scan for the Pixhawk`s SWD and connect to it:
|
||||
8. Use the following command to scan for the Pixhawk`s SWD and connect to it:
|
||||
|
||||
```sh
|
||||
(gdb) mon swdp_scan
|
||||
(gdb) attach 1
|
||||
```
|
||||
|
||||
1. Load the binary into the Pixhawk:
|
||||
9. Load the binary into the Pixhawk:
|
||||
|
||||
```sh
|
||||
(gdb) load
|
||||
@@ -127,38 +158,10 @@ The following steps explain how you can "manually" update the bootloader using a
|
||||
|
||||
After the bootloader has updated you can [Load PX4 Firmware](../config/firmware.md) using _QGroundControl_.
|
||||
|
||||
## QGC Bootloader Update
|
||||
|
||||
The easiest approach is to first use _QGroundControl_ to install firmware that contains the desired/latest bootloader.
|
||||
You can then initiate bootloader update on next restart by setting the parameter: [SYS_BL_UPDATE](../advanced_config/parameter_reference.md#SYS_BL_UPDATE).
|
||||
|
||||
This approach can only be used if [SYS_BL_UPDATE](../advanced_config/parameter_reference.md#SYS_BL_UPDATE) is present in firmware.
|
||||
|
||||
:::warning
|
||||
Currently only FMUv2 and some custom firmware includes the desired bootloader.
|
||||
:::
|
||||
|
||||
The steps are:
|
||||
|
||||
1. Insert an SD card (enables boot logging to debug any problems).
|
||||
1. [Update the Firmware](../config/firmware.md#custom) with an image containing the new/desired bootloader.
|
||||
|
||||
::: info
|
||||
The updated bootloader might be supplied in custom firmware (i.e. from the dev team), or it or may be included in the latest main branch.
|
||||
:::
|
||||
|
||||
1. Wait for the vehicle to reboot.
|
||||
1. [Find and enable](../advanced_config/parameters.md) the parameter [SYS_BL_UPDATE](../advanced_config/parameter_reference.md#SYS_BL_UPDATE).
|
||||
1. Reboot (disconnect/reconnect the board).
|
||||
The bootloader update will only take a few seconds.
|
||||
|
||||
Generally at this point you may then want to [update the firmware](../config/firmware.md) again using the correct/newly installed bootloader.
|
||||
|
||||
An specific example of this process for updating the FMUv2 bootloader is given below.
|
||||
|
||||
### FMUv2 Bootloader Update
|
||||
## FMUv2 Bootloader Update
|
||||
|
||||
If _QGroundControl_ installs the FMUv2 target (see console during installation), and you have a newer board, you may need to update the bootloader in order to access all the memory on your flight controller.
|
||||
This example explains how you can use [QGC Bootloader Update](qgc-bootloader-update-sys-bl-update) to update the bootloader.
|
||||
|
||||
::: info
|
||||
Early FMUv2 [Pixhawk-series](../flight_controller/pixhawk_series.md#fmu_versions) flight controllers had a [hardware issue](../flight_controller/silicon_errata.md#fmuv2-pixhawk-silicon-errata) that restricted them to using 1MB of flash memory.
|
||||
@@ -168,17 +171,17 @@ The problem is fixed on newer boards, but you may need to update the factory-pro
|
||||
To update the bootloader:
|
||||
|
||||
1. Insert an SD card (enables boot logging to debug any problems).
|
||||
1. [Update the Firmware](../config/firmware.md) to PX4 _master_ version (when updating the firmware, check **Advanced settings** and then select **Developer Build (master)** from the dropdown list).
|
||||
2. [Update the Firmware](../config/firmware.md) to PX4 _master_ version (when updating the firmware, check **Advanced settings** and then select **Developer Build (master)** from the dropdown list).
|
||||
_QGroundControl_ will automatically detect that the hardware supports FMUv2 and install the appropriate Firmware.
|
||||
|
||||

|
||||
|
||||
Wait for the vehicle to reboot.
|
||||
|
||||
1. [Find and enable](../advanced_config/parameters.md) the parameter [SYS_BL_UPDATE](../advanced_config/parameter_reference.md#SYS_BL_UPDATE).
|
||||
1. Reboot (disconnect/reconnect the board).
|
||||
3. [Find and enable](../advanced_config/parameters.md) the parameter [SYS_BL_UPDATE](../advanced_config/parameter_reference.md#SYS_BL_UPDATE).
|
||||
4. Reboot (disconnect/reconnect the board).
|
||||
The bootloader update will only take a few seconds.
|
||||
1. Then [Update the Firmware](../config/firmware.md) again.
|
||||
5. Then [Update the Firmware](../config/firmware.md) again.
|
||||
This time _QGroundControl_ should autodetect the hardware as FMUv3 and update the Firmware appropriately.
|
||||
|
||||

|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# Complete Vehicles (Rover)
|
||||
|
||||
This section contains information about fully assembled vehicles that use PX4:
|
||||
|
||||
1. [Aion Robotics R1 UGV (Differential Rover)](../complete_vehicles_rover/aion_r1.md)
|
||||
@@ -3,7 +3,7 @@
|
||||
_Collision Prevention_ may be used to automatically slow and stop a vehicle before it can crash into an obstacle.
|
||||
It can be enabled for multicopter vehicles when using acceleration-based [Position mode](../flight_modes_mc/position.md) (or VTOL vehicles in MC mode).
|
||||
|
||||
It can be enabled for multicopter vehicles in [Position mode](../flight_modes_mc/position.md), and can use sensor data from an offboard companion computer, offboard rangefinders over MAVLink, a rangefinder attached to the flight controller, or any combination of the above.
|
||||
It can be enabled for multicopter vehicles in [Position mode](../flight_modes_mc/position.md) (with [MPC_POS_MODE](#MPC_POS_MODE) set to `Acceleration based`), and can use sensor data from an offboard companion computer, offboard rangefinders over MAVLink, a rangefinder attached to the flight controller, or any combination of the above.
|
||||
|
||||
Collision prevention may restrict vehicle maximum speed if the sensor range isn't large enough!
|
||||
It also prevents motion in directions where no sensor data is available (i.e. if you have no rear-sensor data, you will not be able to fly backwards).
|
||||
@@ -26,15 +26,14 @@ Users are notified through _QGroundControl_ while _Collision Prevention_ is acti
|
||||
|
||||
PX4 software setup is covered in the next section.
|
||||
If you are using a distance sensor attached to your flight controller for collision prevention, it will need to be attached and configured as described in [PX4 Distance Sensor](#rangefinder).
|
||||
If you are using a companion computer to provide obstacle information see [companion setup](#companion
|
||||
If you are using a companion computer to provide obstacle information see [companion setup](#companion) below.
|
||||
|
||||
## Supported Rangefinders {#rangefinder}
|
||||
## Supported Rangefinders {#rangefinder}
|
||||
|
||||
### Lanbao PSK-CM8JL65-CC5 [Discontinued]
|
||||
|
||||
At time of writing PX4 allows you to use the [Lanbao PSK-CM8JL65-CC5](../sensor/cm8jl65_ir_distance_sensor.md) IR distance sensor for collision prevention “out of the box”, with minimal additional configuration:
|
||||
|
||||
|
||||
- First [attach and configure the sensor](../sensor/cm8jl65_ir_distance_sensor.md), and enable collision prevention (as described above, using [CP_DIST](#CP_DIST)).
|
||||
- Set the sensor orientation using [SENS_CM8JL65_R_0](../advanced_config/parameter_reference.md#SENS_CM8JL65_R_0).
|
||||
|
||||
@@ -51,7 +50,6 @@ Other sensors may be enabled, but this requires modification of driver code to s
|
||||
This should be done by mimicking the `SENS_CM8JL65_R_0` parameter (though you might also hard-code the orientation in the sensor _module.yaml_ file to something like `sf0x start -d ${SERIAL_DEV} -R 25` - where 25 is equivalent to `ROTATION_DOWNWARD_FACING`).
|
||||
- Modify the driver to set the _field of view_ in the distance sensor UORB topic (`distance_sensor_s.h_fov`).
|
||||
|
||||
|
||||
## PX4 (Software) Setup
|
||||
|
||||
Configure collision prevention by [setting the following parameters](../advanced_config/parameters.md) in _QGroundControl_:
|
||||
@@ -62,7 +60,7 @@ Configure collision prevention by [setting the following parameters](../advanced
|
||||
| <a id="CP_DELAY"></a>[CP_DELAY](../advanced_config/parameter_reference.md#CP_DELAY) | Set the sensor and velocity setpoint tracking delay. See [Delay Tuning](#delay_tuning) below. |
|
||||
| <a id="CP_GUIDE_ANG"></a>[CP_GUIDE_ANG](../advanced_config/parameter_reference.md#CP_GUIDE_ANG) | Set the angle (to both sides of the commanded direction) within which the vehicle may deviate if it finds fewer obstacles in that direction. See [Guidance Tuning](#angle_change_tuning) below. |
|
||||
| <a id="CP_GO_NO_DATA"></a>[CP_GO_NO_DATA](../advanced_config/parameter_reference.md#CP_GO_NO_DATA) | Set to 1 to allow the vehicle to move in directions where there is no sensor coverage (default is 0/`False`). |
|
||||
| <a id="MPC_POS_MODE"></a>[MPC_POS_MODE](../advanced_config/parameter_reference.md#MPC_POS_MODE) | Set to `Direct velocity` or `Smoothed velocity` to enable Collision Prevention in Position Mode (default is `Acceleration based`). |
|
||||
| <a id="MPC_POS_MODE"></a>[MPC_POS_MODE](../advanced_config/parameter_reference.md#MPC_POS_MODE) | Must be set to `Acceleration based`. |
|
||||
|
||||
## Algorithm Description
|
||||
|
||||
@@ -131,7 +129,6 @@ The guidance feature will never direct the vehicle in a direction without sensor
|
||||
If the vehicle feels stuck with only a single distance sensor pointing forwards, this is probably because the guidance cannot safely adapt the direction due to lack of information.
|
||||
:::
|
||||
|
||||
|
||||
## Algorithm Description
|
||||
|
||||
The data from all sensors are fused into an internal representation of 72 sectors around the vehicle, each containing either the sensor data and information about when it was last observed, or an indication that no data for the sector was available.
|
||||
@@ -212,7 +209,7 @@ The steps are:
|
||||
type: px4_msgs::msg::ObstacleDistance
|
||||
```
|
||||
|
||||
For more information see [DDS Topics YAML](../middleware/uxrce_dds.md#dds-topics-yaml) in [uXRCE-DDS](../middleware/uxrce_dds.md) (PX4-ROS 2/DDS Bridge)_.
|
||||
For more information see [DDS Topics YAML](../middleware/uxrce_dds.md#dds-topics-yaml) in [uXRCE-DDS](../middleware/uxrce_dds.md) (PX4-ROS 2/DDS Bridge)\_.
|
||||
|
||||
3. Open PlotJuggler and navigate to the **Tools > Reactive Script Editor** section.
|
||||
In the **Script Editor** tab, add following scripts in the appropriate sections:
|
||||
|
||||
@@ -18,8 +18,7 @@ Mode documentation for the PX4 internal modes are listed below:
|
||||
- [Flight Modes (Multicopter)](../flight_modes_mc/index.md)
|
||||
- [Flight Modes (Fixed-Wing)](../flight_modes_fw/index.md)
|
||||
- [Flight Modes (VTOL)](../flight_modes_vtol/index.md)
|
||||
- [Drive Modes (Differential Rover)](../flight_modes_rover/differential.md)
|
||||
- [Drive Modes (Ackermann Rover)](../flight_modes_rover/ackermann.md)
|
||||
- [Drive Modes (Rover)](../flight_modes_rover/index.md)
|
||||
- [Basic Configuration > Flight Modes](../config/flight_mode.md)
|
||||
|
||||
## Internal vs External Modes
|
||||
|
||||
@@ -1,433 +0,0 @@
|
||||
# Configuration/Tuning (Ackermann Rover)
|
||||
|
||||
This topic provides a step-by-step guide for setting up your [Ackermann rover](../frames_rover/ackermann.md).
|
||||
|
||||
Successive steps enable [drive modes](../flight_modes_rover/ackermann.md) with more autopilot support and features.
|
||||
|
||||
::: warning
|
||||
Each step is dependent on the previous steps having been completed.
|
||||
Modes will only work properly if the preceding modes have been configured.
|
||||
:::
|
||||
|
||||
## Basic Setup
|
||||
|
||||
To configure the Ackermann rover frame and outputs:
|
||||
|
||||
1. Enable Rover support by flashing the [PX4 rover build](../frames_rover/index.md#flashing-the-rover-build) onto your flight controller.
|
||||
Note that this is a special build that contains rover-specific modules.
|
||||
|
||||
2. In the [Airframe](../config/airframe.md) configuration select the _Generic Rover Ackermann_:
|
||||
|
||||

|
||||
|
||||
Select the **Apply and Restart** button.
|
||||
|
||||
::: info
|
||||
If this airframe is not displayed and you have checked that you are using rover firmware (not the default), you can alternatively enable this frame by setting the [SYS_AUTOSTART](../advanced_config/parameter_reference.md#SYS_AUTOSTART) parameter to `51000`.
|
||||
:::
|
||||
|
||||
3. Open the [Actuators Configuration & Testing](../config/actuators.md) to map the steering and throttle functions to flight controller outputs.
|
||||
|
||||
## Manual Mode
|
||||
|
||||
::: warning
|
||||
For this mode to work properly the [Basic Setup](#basic-setup) must've already been completed!
|
||||
:::
|
||||
|
||||
The basic setup already covers the minimum setup required to use the rover in [Manual mode](../flight_modes_rover/ackermann.md#manual-mode).
|
||||
|
||||
This mode is also affected by (optional) acceleration/deceleration limits.
|
||||
As configuration of these limits becomes mandatory for subsequent modes, we do this setup here.
|
||||
|
||||
Navigate to [Parameters](../advanced_config/parameters.md) in QGroundControl and set the following parameters:
|
||||
|
||||
1. [RA_WHEEL_BASE](#RA_WHEEL_BASE) [m]: Measure the distance from the back to the front wheels.
|
||||
2. [RA_MAX_STR_ANG](#RA_MAX_STR_ANG) [deg]: Measure the maximum steering angle.
|
||||
|
||||

|
||||
|
||||
3. [RO_MAX_THR_SPEED](#RO_MAX_THR_SPEED) [m/s]: Drive the rover at full throttle and set this parameter to the observed value of the ground speed.
|
||||
|
||||
:::info
|
||||
This parameter is also used for the feed-forward term of the speed control.
|
||||
It will be further tuned in the configuration of [Position mode](#position-mode).
|
||||
:::
|
||||
|
||||
4. (Optional) [RO_ACCEL_LIM](#RO_ACCEL_LIM) [m/s^2]: Maximum acceleration you want to allow for your rover.
|
||||
|
||||
<a id="RO_ACCEL_LIM_CONSIDERATIONS"></a>
|
||||
|
||||
:::tip
|
||||
Your rover has a maximum possible acceleration which is determined by the maximum torque the motor can supply.
|
||||
This may or may not be appropriate for your vehicle and use case.
|
||||
|
||||
One approach to determine an appropriate value is:
|
||||
|
||||
1. From a standstill, give the rover full throttle until it reaches the maximum speed.
|
||||
1. Disarm the rover and plot the `measured_speed_body_x` from [RoverVelocityStatus](../msg_docs/RoverVelocityStatus.md).
|
||||
1. Divide the maximum speed by the time it took to reach it and set this as the value for [RO_ACCEL_LIM](#RO_ACCEL_LIM).
|
||||
|
||||
Some RC rovers have enough torque to lift up if the maximum acceleration is not limited.
|
||||
If that is the case:
|
||||
|
||||
1. Set [RO_ACCEL_LIM](#RO_ACCEL_LIM) to a low value, give the rover full throttle from a standstill and observe its behaviour.
|
||||
1. Increase [RO_ACCEL_LIM](#RO_ACCEL_LIM) until the rover starts to lift up during the acceleration.
|
||||
1. Set [RO_ACCEL_LIM](#RO_ACCEL_LIM) to the highest value that does not cause the rover to lift up.
|
||||
:::
|
||||
|
||||
5. (Optional) [RO_DECEL_LIM](#RO_DECEL_LIM) [m/s^2]: Maximum deceleration you want to allow for your rover.
|
||||
|
||||
:::tip
|
||||
The same [considerations](#RO_ACCEL_LIM_CONSIDERATIONS) as in the configuration of [RO_ACCEL_LIM](#RO_ACCEL_LIM) apply.
|
||||
:::
|
||||
|
||||
:::info
|
||||
This parameter is also used for the calculation of the speed setpoint during [Auto modes](#auto-modes).
|
||||
:::
|
||||
|
||||
6. (Optional) [RA_STR_RATE_LIM](#RA_STR_RATE_LIM) [deg/s]: Maximum steering rate you want to allow for your rover.
|
||||
|
||||
:::tip
|
||||
This value depends on your rover and use case.
|
||||
For bigger rovers there might be a mechanical limit that is easy to identify by steering the rover at a standstill and increasing
|
||||
[RA_STR_RATE_LIM](#RA_STR_RATE_LIM) until you observe the steering rate to no longer be limited by the parameter.
|
||||
For smaller rovers you might observe the steering to be too aggressive. Set [RA_STR_RATE_LIM](#RA_STR_RATE_LIM) to a low value and steer the rover at a standstill.
|
||||
Increase the parameter until you reach the maximum steering rate you are comfortable with.
|
||||
:::
|
||||
|
||||
:::warning
|
||||
A low maximum steering rate makes the rover worse at tracking steering setpoints, which can lead to a poor performance in the subsequent modes.
|
||||
:::
|
||||
|
||||
## Acro Mode
|
||||
|
||||
::: warning
|
||||
For this mode to work properly [Manual mode](#acro-mode) must've already been configured!
|
||||
:::
|
||||
|
||||
To set up [Acro mode](../flight_modes_rover/ackermann.md#acro-mode) configure the following [parameters](../advanced_config/parameters.md) in QGroundControl:
|
||||
|
||||
1. [RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM): Maximum yaw rate you want to allow for your rover.
|
||||
|
||||
:::tip
|
||||
Limiting the yaw rate is necessary if the rover is prone rolling over, loosing traction at high speeds or if passenger comfort is important.
|
||||
Small rovers especially can be prone to rolling over when steering aggressively at high speeds.
|
||||
|
||||
If this is the case:
|
||||
|
||||
1. In [Acro mode](../flight_modes_rover/ackermann.md#acro-mode), set [RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM) to a small value and drive the rover at full throttle and with the right stick all the way to the left or right.
|
||||
1. Increase [RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM) until the wheels of the rover start to lift up.
|
||||
1. Set [RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM) to the highest value that does not cause the rover to lift up.
|
||||
|
||||
If you see no need to limit the yaw rate, set this parameter to the maximum yaw rate the rover can achieve:
|
||||
|
||||
1. In [Manual mode](#manual-mode) drive the rover at full throttle and with the maximum steering angle.
|
||||
2. Plot the `measured_yaw_rate` from [RoverRateStatus](../msg_docs/RoverRateStatus.md) and enter the highest observed value for [RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM).
|
||||
|
||||
:::
|
||||
|
||||
2. [RO_YAW_RATE_P](#RO_YAW_RATE_P) [-]: Proportional gain of the closed loop yaw rate controller.
|
||||
The closed loop acceleration control will compare the yaw rate setpoint with the measured yaw rate and adapt the motor commands based on the error between them.
|
||||
The proportional gain is multiplied with this error and that value is added to the motor command.
|
||||
This compensates for disturbances such as uneven ground and external forces.
|
||||
|
||||
:::tip
|
||||
To tune this parameter:
|
||||
|
||||
1. Put the rover in [Acro mode](../flight_modes_rover/ackermann.md#acro-mode) and hold the throttle stick and the right stick at a few different levels for a couple of seconds each.
|
||||
2. Disarm the rover and from the flight log plot the `adjusted_yaw_rate_setpoint` from [RoverRateStatus](../msg_docs/RoverRateStatus.md) and the `measured_yaw_rate` from [RoverRateStatus](../msg_docs/RoverRateStatus.md) over each other.
|
||||
3. Increase [RO_YAW_RATE_P](#RO_YAW_RATE_P) if the measured value does not track the setpoint fast enough or decrease it if the measurement overshoots the setpoint by too much.
|
||||
4. Repeat until you are satisfied with the behaviour.
|
||||
:::
|
||||
|
||||
3. [RO_YAW_RATE_I](#RO_YAW_RATE_I) [-]: Integral gain of the closed loop yaw rate controller.
|
||||
The integral gain accumulates the error between the desired and actual yaw rate scaled by the integral gain over time and that value is added to the motor command.
|
||||
|
||||
::: tip
|
||||
An integrator might not be necessary at this stage, but it will become important for subsequent modes.
|
||||
:::
|
||||
|
||||
The rover is now ready to drive in [Acro mode](../flight_modes_rover/ackermann.md#acro-mode).
|
||||
|
||||
## Stabilized Mode
|
||||
|
||||
::: warning
|
||||
For this mode to work properly [Acro mode](#acro-mode) must've already been configured!
|
||||
:::
|
||||
|
||||
For [Stabilized mode](../flight_modes_rover/differential.md#stabilized-mode) the controller utilizes a closed loop yaw controller, which creates a yaw rate setpoint to control the yaw when it is active:
|
||||
|
||||

|
||||
|
||||
Unlike the closed loop yaw rate, this controller has no feed-forward term.
|
||||
Therefore you only need to tune the closed loop gains:
|
||||
|
||||
1. [RO_YAW_P](#RO_YAW_P) [-]: Proportional gain for the closed loop yaw controller.
|
||||
|
||||
::: tip
|
||||
In stabilized mode the closed loop yaw control is only active when driving a straight line (no yaw rate input).
|
||||
To tune it start with a value of 1 for [RO_YAW_P](#RO_YAW_P).
|
||||
Put the rover into stabilized mode and move the left stick of your controller up to drive forwards.
|
||||
Disarm the rover and from the flight log plot the `measured_yaw` and the `adjusted_yaw_setpoint` from the [RoverAttitudeStatus](../msg_docs/RoverAttitudeStatus.md) message over each other.
|
||||
Increase/Decrease the parameter until you are satisfied with the setpoint tracking.
|
||||
:::
|
||||
|
||||
::: info
|
||||
For the closed loop yaw control an integrator gain is useful because this setpoint is often constant for a while and an integrator eliminates steady state errors that can cause the rover to never reach the setpoint.
|
||||
Since the yaw and yaw rate controllers are cascaded, there only needs to be one integrator which is in the yaw rate controller. If you observe a steady state error in the yaw setpoint increase the [RO_YAW_RATE_I](#RO_YAW_RATE_I) parameter.
|
||||
:::
|
||||
|
||||
The rover is now ready to drive in [Stabilized mode](../flight_modes_rover/ackermann.md#stabilized-mode).
|
||||
|
||||
## Position Mode
|
||||
|
||||
:::warning
|
||||
For this mode to work properly [Stabilized mode](#stabilized-mode) must already be configured!
|
||||
:::
|
||||
|
||||
[Position mode](../flight_modes_rover/ackermann.md#position-mode) is the most advanced manual mode, utilizing closed loop yaw rate and speed control and leveraging position estimates.
|
||||
|
||||
To configure set the following parameters:
|
||||
|
||||
1. [RO_SPEED_LIM](#RO_SPEED_LIM) [m/s]: This is the maximum speed you want to allow for your rover.
|
||||
This will define the stick-to-speed mapping for position mode and set an upper limit for the speed setpoint for all [auto modes](#auto-modes).
|
||||
2. [RO_MAX_THR_SPEED](#RO_MAX_THR_SPEED) [m/s]: This parameter is used to calculate the feed-forward term of the closed loop speed control which linearly maps desired speeds to normalized motor commands.
|
||||
As mentioned in the [Manual mode](../flight_modes_rover/ackermann.md#manual-mode) configuration , a good starting point is the observed ground speed when the rover drives at maximum throttle in [Manual mode](../flight_modes_rover/ackermann.md#manual-mode).
|
||||
|
||||
<a id="RA_SPEED_TUNING"></a>
|
||||
|
||||
::: tip
|
||||
To further tune this parameter:
|
||||
|
||||
1. Set [RO_SPEED_P](#RO_SPEED_P) and [RO_SPEED_I](#RO_SPEED_I) to zero.
|
||||
This way the speed is only controlled by the feed-forward term, which makes it easier to tune.
|
||||
1. Put the rover in [Position mode](../flight_modes_rover/ackermann.md#position-mode) and then move the left stick of your controller up and/or down and hold it at a few different levels for a couple of seconds each.
|
||||
1. Disarm the rover and from the flight log plot the `adjusted_speed_body_x_setpoint` and the `measured_speed_body_x` from the [RoverVelocityStatus](../msg_docs/RoverVelocityStatus.md) message over each other.
|
||||
1. If the actual speed of the rover is higher than the speed setpoint, increase [RO_MAX_THR_SPEED](#RO_MAX_THR_SPEED).
|
||||
If it is the other way around decrease the parameter and repeat until you are satisfied with the setpoint tracking.
|
||||
|
||||
:::
|
||||
|
||||
::: info
|
||||
If your rover oscillates when driving a straight line in [Position mode](../flight_modes_rover/ackermann.md#position-mode), set this parameter to the observed ground speed at maximum throttle in [Manual mode](../flight_modes_rover/ackermann.md#manual-mode) and complete steps 5-7 first before continuing the tuning of the closed loop speed control (Steps 2-4).
|
||||
:::
|
||||
|
||||
3. [RO_SPEED_P](#RO_SPEED_P) [-]: Proportional gain of the closed loop speed controller.
|
||||
|
||||
::: tip
|
||||
This parameter can be tuned the same way as [RO_MAX_THR_SPEED](#RA_SPEED_TUNING).
|
||||
If you tuned [RO_MAX_THR_SPEED](#RO_MAX_THR_SPEED) well, you might only need a very small value.
|
||||
:::
|
||||
|
||||
4. [RO_SPEED_I](#RO_SPEED_I) [-]: Integral gain for the closed loop speed controller.
|
||||
|
||||
::: tip
|
||||
For the closed loop speed control an integrator gain is useful because this setpoint is often constant for a while and an integrator eliminates steady state errors that can cause the rover to never reach the setpoint.
|
||||
:::
|
||||
|
||||
5. [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN): When driving in a straight line (right stick centered) position mode leverages the same path following algorithm used in [auto modes](#auto-modes) called [pure pursuit](#pure-pursuit-guidance-logic) to achieve the best possible straight line driving behaviour ([Illustration of control architecture](#pure_pursuit_controller)).
|
||||
This parameter determines how aggressive the controller will steer towards the path.
|
||||
|
||||
::: tip
|
||||
Decreasing the parameter makes it more aggressive but can lead to oscillations.
|
||||
|
||||
To tune this:
|
||||
|
||||
1. Start with a value of 1 for [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN)
|
||||
2. Put the rover in [Position mode](../flight_modes_rover/ackermann.md#position-mode) and while driving a straight line at approximately half the maximum speed observe its behaviour.
|
||||
3. If the rover does not drive in a straight line, reduce the value of the parameter, if it oscillates around the path increase the value.
|
||||
4. Repeat until you are satisfied with the behaviour.
|
||||
|
||||
:::
|
||||
|
||||
6. [PP_LOOKAHD_MIN](#PP_LOOKAHD_MIN): Minimum threshold for the lookahead distance used by the [pure pursuit algorithm](#pure-pursuit-guidance-logic).
|
||||
|
||||
::: tip
|
||||
Put the rover in [Position mode](../flight_modes_rover/ackermann.md#position-mode) and drive at very low speeds, if the rover starts to oscillate even though the tuning of [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN) was good for medium speeds, then increase the value of [PP_LOOKAHD_MIN](#PP_LOOKAHD_MIN).
|
||||
:::
|
||||
|
||||
7. [PP_LOOKAHD_MAX](#PP_LOOKAHD_MAX): Maximum threshold for the lookahead distance used by [pure pursuit](#pure-pursuit-guidance-logic).
|
||||
|
||||
::: tip
|
||||
Put the rover in [Position mode](../flight_modes_rover/ackermann.md#position-mode) and drive at very high speeds, if the rover does not drive in a straight line even though the tuning of [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN) was good for medium speeds, then decrease the value of [PP_LOOKAHD_MAX](#PP_LOOKAHD_MAX).
|
||||
:::
|
||||
|
||||
The rover is now ready to drive in [Position mode](../flight_modes_rover/ackermann.md#position-mode).
|
||||
|
||||
## Auto Modes
|
||||
|
||||
::: warning
|
||||
For auto modes to work properly [Manual Mode](#manual-mode), [Acro mode](#acro-mode)and [Position mode](#position-mode) must already be configured!
|
||||
:::
|
||||
|
||||
<a id="pure_pursuit_controller"></a>
|
||||
|
||||
In [auto modes](../flight_modes_rover/ackermann.md#auto-modes) the autopilot takes over navigation tasks using the following control architecture:
|
||||
|
||||

|
||||
|
||||
The required parameter configuration is discussed in the following sections.
|
||||
|
||||
### Speed
|
||||
|
||||
1. [RO_DECEL_LIM](#RO_DECEL_LIM) [m/s^2] and [RO_JERK_LIM](#RO_JERK_LIM) [m/s^3] are used to calculate a speed trajectory such that the rover reaches the next waypoint with the correct [cornering speed](#cornering-speed).
|
||||
|
||||
::: tip
|
||||
Plan a mission for the rover to drive a square and observe how it slows down when approaching a waypoint:
|
||||
|
||||
- If the rover decelerates too quickly decrease the [RO_DECEL_LIM](#RO_DECEL_LIM) parameter, if it starts slowing down too early increase the parameter.
|
||||
- If you observe a jerking motion as the rover slows down, decrease the [RO_JERK_LIM](#RO_JERK_LIM) parameter otherwise increase it as much as possible as it can interfere with the tuning of [RO_DECEL_LIM](#RO_DECEL_LIM).
|
||||
|
||||
These two parameters have to be tuned as a pair, repeat until you are satisfied with the behaviour.
|
||||
:::
|
||||
|
||||
2. Plot the `adjusted_speed_body_x_setpoint` and `measured_speed_body_x` from the [RoverVelocityStatus](../msg_docs/RoverVelocityStatus.md) message over each other.
|
||||
If the tracking of these setpoints is not satisfactory adjust the values for [RO_SPEED_P](#RO_SPEED_P) and [RO_SPEED_I](#RO_SPEED_I).
|
||||
|
||||
### Corner Cutting
|
||||
|
||||
The module employs a special cornering logic causing the rover to "cut corners" to achieve a smooth trajectory.
|
||||
This is done by scaling the acceptance radius based on the corner the rover has to drive (for geometric explanation see [Cornering logic](#mission-cornering-logic-info-only)).
|
||||
|
||||

|
||||
|
||||
The degree to which corner cutting is allowed can be tuned, or disabled, with the following parameters:
|
||||
|
||||
::: info
|
||||
The corner cutting effect is a tradeoff between how close you get to the waypoint and the smoothness of the trajectory.
|
||||
:::
|
||||
|
||||
1. [NAV_ACC_RAD](#NAV_ACC_RAD) [m]: Default acceptance radius
|
||||
This is also used as a lower bound for the acceptance radius scaling.
|
||||
2. [RA_ACC_RAD_MAX](#RA_ACC_RAD_MAX) [m]: The maximum the acceptance radius can be scaled to.
|
||||
Set equal to [NAV_ACC_RAD](#NAV_ACC_RAD) to disable the corner cutting effect.
|
||||
3. [RA_ACC_RAD_GAIN](#RA_ACC_RAD_GAIN) [-]: This tuning parameter is a multiplicand on the [calculated ideal acceptance radius](#corner-cutting-logic) to account for dynamic effects.
|
||||
|
||||
:::tip
|
||||
Initially set this parameter to `1`.
|
||||
If you observe the rover overshooting the corner, increase this parameter until you are satisfied with the behaviour.
|
||||
Note that the scaling of the acceptance radius is limited by [RA_ACC_RAD_MAX](#RA_ACC_RAD_MAX).
|
||||
:::
|
||||
|
||||
### Path Following
|
||||
|
||||
The [pure pursuit](#pure-pursuit-guidance-logic) algorithm is used to calculate a yaw rate setpoint for the vehicle that is then close loop controlled.
|
||||
The close loop yaw rate was tuned in the configuration of the [Acro mode](#acro-mode), and the pure pursuit was tuned when setting up the [Position mode](#position-mode).
|
||||
During any auto navigation task observe the behaviour of the rover.
|
||||
|
||||
If you are unsatisfied with the path following, there are 2 steps to take:
|
||||
|
||||
1. Plot the `adjusted_yaw_rate_setpoint` and the `measured_yaw_rate` from the [RoverRateStatus](../msg_docs/RoverRateStatus.md) over each other.
|
||||
If the tracking of these setpoints is not satisfactory adjust the values for [RO_YAW_RATE_P](#RO_YAW_RATE_P) and [RO_YAW_RATE_I](#RO_YAW_RATE_I).
|
||||
2. Plot the `adjusted_yaw_setpoint` and the `measured_yaw` from the [RoverAttitudeStatus](../msg_docs/RoverAttitudeStatus.md) over each other.
|
||||
If the tracking of these setpoints is not satisfactory adjust the value for [RO_YAW_P](#RO_YAW_RATE_P) and potentially further tune [RO_YAW_RATE_I](#RO_YAW_RATE_I).
|
||||
3. Steps 1 and 2 ensures accurate setpoint tracking, if the path following is still unsatisfactory you need to further tune the [pure pursuit](#pure-pursuit-guidance-logic) parameters.
|
||||
|
||||
## Pure Pursuit Guidance Logic
|
||||
|
||||
The desired yaw setpoints are generated using a pure pursuit algorithm.
|
||||
|
||||
The controller takes the intersection point between a circle around the vehicle and a line segment.
|
||||
In mission mode this line is usually constructed by connecting the previous and current waypoint.
|
||||
|
||||

|
||||
|
||||
The radius of the circle around the vehicle is used to tune the controller and is often referred to as look-ahead distance.
|
||||
|
||||
The look-ahead distance sets how aggressive the controller behaves and is defined as $l_d = v \cdot k$.
|
||||
It depends on the velocity $v$ of the rover and a tuning parameter $k$ that can be set with the parameter [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN).
|
||||
|
||||
::: info
|
||||
A lower value of [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN) makes the controller more aggressive but can lead to oscillations!
|
||||
:::
|
||||
|
||||
The lookahead is constrained between [PP_LOOKAHD_MAX](#PP_LOOKAHD_MAX) and [PP_LOOKAHD_MIN](#PP_LOOKAHD_MIN).
|
||||
|
||||
If the distance from the path to the rover is bigger than the lookahead distance, the rover will target the point on the path that is closest to the rover.
|
||||
|
||||
To summarize, the following parameters can be used to tune the controller:
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| -------------------------------------------------------------------------------------------------------- | --------------------------------------- | ---- |
|
||||
| <a id="PP_LOOKAHD_GAIN"></a>[PP_LOOKAHD_GAIN](../advanced_config/parameter_reference.md#PP_LOOKAHD_GAIN) | Main tuning parameter | - |
|
||||
| <a id="PP_LOOKAHD_MAX"></a>[PP_LOOKAHD_MAX](../advanced_config/parameter_reference.md#PP_LOOKAHD_MAX) | Maximum value for the look ahead radius | m |
|
||||
| <a id="PP_LOOKAHD_MIN"></a>[PP_LOOKAHD_MIN](../advanced_config/parameter_reference.md#PP_LOOKAHD_MIN) | Minimum value for the look ahead radius | m |
|
||||
|
||||
## Mission Cornering Logic (Info only)
|
||||
|
||||
### Corner Cutting Logic
|
||||
|
||||
To enable a smooth trajectory, the acceptance radius of waypoints is scaled based on the angle between a line segment from the current-to-previous and current-to-next waypoints.
|
||||
The ideal trajectory would be to arrive at the next line segment with the heading pointing towards the next waypoint.
|
||||
For this purpose the minimum turning circle of the rover is inscribed tangentially to both line segments.
|
||||
|
||||

|
||||
|
||||
The acceptance radius of the waypoint is set to the distance from the waypoint to the tangential points between the circle and the line segments:
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
r_{min} &= \frac{L}{\sin\left( \delta_{max}\right) } \\
|
||||
\theta &= \frac{1}{2}\arccos\left( \frac{\vec{a}*\vec{b}}{|\vec{a}||\vec{b}|}\right) \\
|
||||
r_{acc} &= \frac{r_{min}}{\tan\left( \theta\right) }
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
| Symbol | Description | Unit |
|
||||
| -------------- | ---------------------------------- | ---- |
|
||||
| $\vec{a}$ | Vector from current to previous WP | m |
|
||||
| $\vec{b}$ | Vector from current to next WP | m |
|
||||
| $r_{min}$ | Minimum turn radius | m |
|
||||
| $\delta_{max}$ | Maximum steer angle | m |
|
||||
| $r_{acc}$ | Acceptance radius | m |
|
||||
|
||||
### Cornering Speed
|
||||
|
||||
To smoothen the trajectory further and reduce the risk of the rover rolling over, the rover speed is regulated as follows:
|
||||
|
||||
1. During cornering the rover drives at the following speed:
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
$$ v_{cor, max} = \dot{\psi}_{max} \cdot r $$
|
||||
|
||||
with $r:$ Turning radius for the upcoming corner and $\dot{\psi}_{max}:$ Maximum yaw rate ([RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM)).
|
||||
|
||||
2. In between waypoints (straight line) the rover speed is regulated such that it will arrive at the acceptance radius of the waypoint with the desired cornering speed.
|
||||
|
||||
The rover is constrained between the maximum speed [RO_SPEED_LIM](#RO_SPEED_LIM) and the speed where the maximum steering angle does not cause the rover to exceed the yaw rate limit:
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
$$ v_{min} = \frac{w_b \cdot \dot{\psi}_{max}}{tan(\delta_{max})} $$
|
||||
|
||||
with $w_b:$ Wheel base ([RA_WHEEL_BASE](#RA_WHEEL_BASE)), $\dot{\psi}_{max}:$ Maximum yaw rate ([RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM)) and $\delta_{max}:$ Maximum steering angle ([RA_MAX_STR_ANG](#RA_MAX_STR_ANG)).
|
||||
|
||||
## Parameter Overview
|
||||
|
||||
List of all parameters of the ackermann rover module:
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ------- |
|
||||
| <a id="RA_WHEEL_BASE"></a>[RA_WHEEL_BASE](../advanced_config/parameter_reference.md#RA_WHEEL_BASE) | Wheel base | m |
|
||||
| <a id="RA_MAX_STR_ANG"></a>[RA_MAX_STR_ANG](../advanced_config/parameter_reference.md#RA_MAX_STR_ANG) | Maximum steering angle | deg |
|
||||
| <a id="RO_MAX_THR_SPEED"></a>[RO_MAX_THR_SPEED](../advanced_config/parameter_reference.md#RO_MAX_THR_SPEED) | Speed the rover drives at maximum throttle | m/s |
|
||||
| <a id="RO_YAW_RATE_LIM"></a>[RO_YAW_RATE_LIM](../advanced_config/parameter_reference.md#RO_YAW_RATE_LIM) | Maximum allowed yaw rate | m/s^2 |
|
||||
| <a id="RO_YAW_RATE_P"></a>[RO_YAW_RATE_P](../advanced_config/parameter_reference.md#RO_YAW_RATE_P) | Proportional gain for yaw rate controller | - |
|
||||
| <a id="RO_YAW_RATE_I"></a>[RO_YAW_RATE_I](../advanced_config/parameter_reference.md#RO_YAW_RATE_I) | Integral gain for yaw rate controller | - |
|
||||
| <a id="RO_YAW_P"></a>[RO_YAW_P](../advanced_config/parameter_reference.md#RO_YAW_P) | Proportional gain for yaw controller | - |
|
||||
| <a id="RO_SPEED_LIM"></a>[RO_SPEED_LIM](../advanced_config/parameter_reference.md#RO_SPEED_LIM) | Maximum allowed speed | m/s |
|
||||
| <a id="RO_SPEED_P"></a>[RO_SPEED_P](../advanced_config/parameter_reference.md#RO_SPEED_P) | Proportional gain for speed controller | - |
|
||||
| <a id="RO_SPEED_I"></a>[RO_SPEED_I](../advanced_config/parameter_reference.md#RO_SPEED_I) | Integral gain for speed controller | - |
|
||||
| <a id="PP_LOOKAHD_GAIN"></a>[PP_LOOKAHD_GAIN](../advanced_config/parameter_reference.md#PP_LOOKAHD_GAIN) | Main tuning parameter for pure pursuit | - |
|
||||
| <a id="PP_LOOKAHD_MAX"></a>[PP_LOOKAHD_MAX](../advanced_config/parameter_reference.md#PP_LOOKAHD_MAX) | Maximum value for the look ahead radius of the pure pursuit algorithm | m |
|
||||
| <a id="PP_LOOKAHD_MIN"></a>[PP_LOOKAHD_MIN](../advanced_config/parameter_reference.md#PP_LOOKAHD_MIN) | Minimum value for the look ahead radius of the pure pursuit algorithm | m |
|
||||
| <a id="NAV_ACC_RAD"></a>[NAV_ACC_RAD](../advanced_config/parameter_reference.md#NAV_ACC_RAD) | Default acceptance radius | m |
|
||||
| <a id="RA_STR_RATE_LIM"></a>[RA_STR_RATE_LIM](../advanced_config/parameter_reference.md#RA_STR_RATE_LIM) | (Optional) Maximum allowed steering rate | deg/s |
|
||||
| <a id="RO_ACCEL_LIM"></a>[RO_ACCEL_LIM](../advanced_config/parameter_reference.md#RO_ACCEL_LIM) | (Optional) Maximum allowed acceleration | m/s^2 |
|
||||
| <a id="RO_DECEL_LIM"></a>[RO_DECEL_LIM](../advanced_config/parameter_reference.md#RO_DECEL_LIM) | (Optional) Maximum allowed deceleration | m/s^2 |
|
||||
| <a id="RO_JERK_LIM"></a>[RO_JERK_LIM](../advanced_config/parameter_reference.md#RO_JERK_LIM) | (Optional) Maximum allowed jerk | $m/s^3$ |
|
||||
| <a id="RA_ACC_RAD_MAX"></a>[RA_ACC_RAD_MAX](../advanced_config/parameter_reference.md#RA_ACC_RAD_MAX) | (Optional) Maximum radius the acceptance radius can be scaled to | m |
|
||||
| <a id="RA_ACC_RAD_GAIN"></a>[RA_ACC_RAD_GAIN](../advanced_config/parameter_reference.md#RA_ACC_RAD_GAIN) | (Optional) Tuning parameter for the acceptance radius scaling | - |
|
||||
|
||||
## See Also
|
||||
|
||||
- [Drive Modes (Ackermann Rover)](../flight_modes_rover/ackermann.md).
|
||||
@@ -0,0 +1,39 @@
|
||||
# Attitude Tuning
|
||||
|
||||
Attitude tuning is required to use [Stabilized mode](../flight_modes_rover/manual.md#stabilized-mode) and all later modes.
|
||||
|
||||
::: warning
|
||||
The [rate tuning](rate_tuning.md) must've already been completed before this step!
|
||||
:::
|
||||
|
||||
Configure the following [parameters](../advanced_config/parameters.md) in QGroundControl:
|
||||
|
||||
1. [RO_YAW_P](#RO_YAW_P) [-]: Proportional gain for the closed loop yaw controller.
|
||||
|
||||
::: tip
|
||||
In stabilized mode the closed loop yaw control is only active when driving a straight line (no yaw rate input).
|
||||
To tune it start with a value of 1 for [RO_YAW_P](#RO_YAW_P).
|
||||
Put the rover into stabilized mode and move the left stick of your controller up to drive forwards.
|
||||
Disarm the rover and from the flight log plot the `measured_yaw` and the `adjusted_yaw_setpoint` from the [RoverAttitudeStatus](../msg_docs/RoverAttitudeStatus.md) message over each other.
|
||||
Increase/Decrease the parameter until you are satisfied with the setpoint tracking.
|
||||
If you observe a steady state error in the yaw setpoint increase the the integrator of the rate controller: [RO_YAW_RATE_I](../advanced_config/parameter_reference.md#RO_YAW_RATE_I) .
|
||||
:::
|
||||
|
||||
The rover is now ready to drive in [Stabilized mode](../flight_modes_rover/manual.md#stabilized-mode) and the configuration can be continued with [velocity tuning](velocity_tuning.md).
|
||||
|
||||
## Attitude Controller Structure (Info Only)
|
||||
|
||||
This section provides additional information for developers and people with experience in control system design.
|
||||
|
||||
The attitude controller uses the following structure:
|
||||
|
||||

|
||||
|
||||
The rate and attitude controllers are cascaded, therefor we only require one integrator in the structure to eliminate steady state errors.
|
||||
We placed the integrator in the rate controller since it can run without the attitude controller but not the other way around.
|
||||
|
||||
## Parameter Overview
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| ----------------------------------------------------------------------------------- | ------------------------------------ | ---- |
|
||||
| <a id="RO_YAW_P"></a>[RO_YAW_P](../advanced_config/parameter_reference.md#RO_YAW_P) | Proportional gain for yaw controller | - |
|
||||
@@ -0,0 +1,133 @@
|
||||
# Basic Setup
|
||||
|
||||
## Configure the rover frame and outputs
|
||||
|
||||
1. Enable Rover support by flashing the [PX4 rover build](../config_rover/index.md#flashing-the-rover-build) onto your flight controller.
|
||||
Note that this is a special build that contains rover-specific modules.
|
||||
|
||||
2. In the [Airframe](../config/airframe.md) configuration select the your rover type: _Generic Rover Ackermann_/_Generic Rover Differential_/_Generic Rover Mecanum_:
|
||||
|
||||

|
||||
|
||||
Select the **Apply and Restart** button.
|
||||
|
||||
::: info
|
||||
If this airframe is not displayed and you have checked that you are using rover firmware (not the default), you can alternatively enable this frame by setting the [SYS_AUTOSTART](../advanced_config/parameter_reference.md#SYS_AUTOSTART) parameter directly to the following value:
|
||||
|
||||
| Rover Type | Value |
|
||||
| ------------ | ------- |
|
||||
| Ackermann | `51000` |
|
||||
| Differential | `50000` |
|
||||
| Mecanum | `52000` |
|
||||
|
||||
:::
|
||||
|
||||
3. Open the [Actuators Configuration & Testing](../config/actuators.md) to map the motor/servo functions to flight controller outputs.
|
||||
|
||||
That is the minimum setup to use the rover in [Manual mode](../flight_modes_rover/manual.md#manual-mode).
|
||||
|
||||
## Geometric Parameters
|
||||
|
||||
Manual mode is also affected by (optional) acceleration/deceleration limits set using the geometric described below.
|
||||
These limits are mandatory for all other modes.
|
||||
|
||||

|
||||
|
||||
Navigate to [Parameters](../advanced_config/parameters.md) in QGroundControl and set the parameters in the group for your frame type.
|
||||
|
||||
### Ackermann
|
||||
|
||||
1. [RA_WHEEL_BASE](#RA_WHEEL_BASE) [m]: Measure the distance from the back to the front wheels.
|
||||
2. [RA_MAX_STR_ANG](#RA_MAX_STR_ANG) [deg]: Measure the maximum steering angle.
|
||||
3. (Optional) [RA_STR_RATE_LIM](#RA_STR_RATE_LIM) [deg/s]: Maximum steering rate you want to allow for your rover.
|
||||
|
||||
:::tip
|
||||
This value depends on your rover and use case.
|
||||
For bigger rovers there might be a mechanical limit that is easy to identify by steering the rover at a standstill and increasing
|
||||
[RA_STR_RATE_LIM](#RA_STR_RATE_LIM) until you observe the steering rate to no longer be limited by the parameter.
|
||||
For smaller rovers you might observe the steering to be too aggressive. Set [RA_STR_RATE_LIM](#RA_STR_RATE_LIM) to a low value and steer the rover at a standstill.
|
||||
Increase the parameter until you reach the maximum steering rate you are comfortable with.
|
||||
:::
|
||||
|
||||
:::warning
|
||||
A low maximum steering rate makes the rover worse at tracking steering setpoints, which can lead to a poor performance in the subsequent modes.
|
||||
:::
|
||||
|
||||
### Differential
|
||||
|
||||
1. [RD_WHEEL_TRACK](#RD_WHEEL_TRACK) [m]: Measure the distance from the centre of the right wheel to the centre of the left wheel.
|
||||
|
||||
### Mecanum
|
||||
|
||||
1. [RM_WHEEL_TRACK](#RM_WHEEL_TRACK) [m]: Measure the distance from the centre of the right wheel to the centre of the left wheel.
|
||||
|
||||
## Speed Parameters
|
||||
|
||||
1. [RO_MAX_THR_SPEED](#RO_MAX_THR_SPEED) [m/s]: Drive the rover at full throttle and set this parameter to the observed value of the ground speed.
|
||||
|
||||
:::info
|
||||
This parameter is also used for the feed-forward term of the closed loop speed control.
|
||||
It will be further adjusted in the [velocity tuning](velocity_tuning.md) step.
|
||||
:::
|
||||
|
||||
2. (Optional) [RO_ACCEL_LIM](#RO_ACCEL_LIM) [m/s^2]: Maximum acceleration you want to allow for your rover.
|
||||
|
||||
<a id="RO_ACCEL_LIM_CONSIDERATIONS"></a>
|
||||
|
||||
:::tip
|
||||
Your rover has a maximum possible acceleration which is determined by the maximum torque the motor can supply.
|
||||
This may or may not be appropriate for your vehicle and use case.
|
||||
|
||||
One approach to determine an appropriate value is:
|
||||
|
||||
1. From a standstill, give the rover full throttle until it reaches the maximum speed.
|
||||
2. Disarm the rover and plot the `measured_speed_body_x` from [RoverVelocityStatus](../msg_docs/RoverVelocityStatus.md).
|
||||
3. Divide the maximum speed by the time it took to reach it and set this as the value for [RO_ACCEL_LIM](#RO_ACCEL_LIM).
|
||||
|
||||
Some RC rovers have enough torque to lift up if the maximum acceleration is not limited.
|
||||
If that is the case:
|
||||
|
||||
1. Set [RO_ACCEL_LIM](#RO_ACCEL_LIM) to a low value, give the rover full throttle from a standstill and observe its behaviour.
|
||||
2. Increase [RO_ACCEL_LIM](#RO_ACCEL_LIM) until the rover starts to lift up during the acceleration.
|
||||
3. Set [RO_ACCEL_LIM](#RO_ACCEL_LIM) to the highest value that does not cause the rover to lift up.
|
||||
:::
|
||||
|
||||
3. (Optional) [RO_DECEL_LIM](#RO_DECEL_LIM) [m/s^2]: Maximum deceleration you want to allow for your rover.
|
||||
|
||||
:::tip
|
||||
The same [considerations](#RO_ACCEL_LIM_CONSIDERATIONS) as in the configuration of [RO_ACCEL_LIM](#RO_ACCEL_LIM) apply.
|
||||
:::
|
||||
|
||||
:::info
|
||||
This parameter is also used for the calculation of the speed setpoint in modes that are [position controlled](position_tuning.md).
|
||||
:::
|
||||
|
||||
You can now continue the configuration process with [rate tuning](rate_tuning.md).
|
||||
|
||||
## Parameter Overview
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------ | ------- |
|
||||
| <a id="RO_MAX_THR_SPEED"></a>[RO_MAX_THR_SPEED](../advanced_config/parameter_reference.md#RO_MAX_THR_SPEED) | Speed the rover drives at maximum throttle | $m/s$ |
|
||||
| <a id="RO_ACCEL_LIM"></a>[RO_ACCEL_LIM](../advanced_config/parameter_reference.md#RO_ACCEL_LIM) | (Optional) Maximum allowed acceleration | $m/s^2$ |
|
||||
| <a id="RO_DECEL_LIM"></a>[RO_DECEL_LIM](../advanced_config/parameter_reference.md#RO_DECEL_LIM) | (Optional) Maximum allowed deceleration | $m/s^2$ |
|
||||
|
||||
### Ackermann Specific
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| -------------------------------------------------------------------------------------------------------- | ---------------------------------------- | ----- |
|
||||
| <a id="RA_WHEEL_BASE"></a>[RA_WHEEL_BASE](../advanced_config/parameter_reference.md#RA_WHEEL_BASE) | Wheel base | $m$ |
|
||||
| <a id="RA_MAX_STR_ANG"></a>[RA_MAX_STR_ANG](../advanced_config/parameter_reference.md#RA_MAX_STR_ANG) | Maximum steering angle | $deg$ |
|
||||
| <a id="RA_STR_RATE_LIM"></a>[RA_STR_RATE_LIM](../advanced_config/parameter_reference.md#RA_STR_RATE_LIM) | (Optional) Maximum allowed steering rate | deg/s |
|
||||
|
||||
### Differential Specific
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| ----------------------------------------------------------------------------------------------------- | ----------- | ---- |
|
||||
| <a id="RD_WHEEL_TRACK"></a>[RD_WHEEL_TRACK](../advanced_config/parameter_reference.md#RD_WHEEL_TRACK) | Wheel track | m |
|
||||
|
||||
### Mecanum Specific
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| ----------------------------------------------------------------------------------------------------- | ----------- | ---- |
|
||||
| <a id="RM_WHEEL_TRACK"></a>[RM_WHEEL_TRACK](../advanced_config/parameter_reference.md#RM_WHEEL_TRACK) | Wheel track | m |
|
||||
@@ -1,376 +0,0 @@
|
||||
# Configuration/Tuning (Differential Rover)
|
||||
|
||||
This topic provides a step-by-step guide for setting up your [Differential rover](../frames_rover/differential.md).
|
||||
Successive steps enable [drive modes](../flight_modes_rover/differential.md) with more autopilot support and features.
|
||||
|
||||
::: warning
|
||||
Each step is dependent on the previous steps having been completed.
|
||||
Modes will only work properly if the preceding modes have been configured.
|
||||
:::
|
||||
|
||||
## Basic Setup
|
||||
|
||||
To configure the differential rover frame and outputs:
|
||||
|
||||
1. Enable Rover support by flashing the [PX4 rover build](../frames_rover/index.md#flashing-the-rover-build) onto your flight controller.
|
||||
Note that this is a special build that contains rover-specific modules.
|
||||
|
||||
2. In the [Airframe](../config/airframe.md) configuration select _Generic Rover Differential_ frame:
|
||||
|
||||

|
||||
|
||||
Select the **Apply and Restart** button.
|
||||
|
||||
::: info
|
||||
If this airframe is not displayed and you have checked that you are using rover firmware (not the default), you can alternatively enable this frame by setting the [SYS_AUTOSTART](../advanced_config/parameter_reference.md#SYS_AUTOSTART) parameter to `50000`.
|
||||
:::
|
||||
|
||||
3. Use [Actuators Configuration & Testing](../config/actuators.md) to map the motor functions to flight controller outputs.
|
||||
|
||||
## Manual Mode
|
||||
|
||||
::: warning
|
||||
For this mode to work properly the [Basic Setup](#basic-setup) must've already been completed!
|
||||
:::
|
||||
|
||||
The basic setup already covers the minimum setup required to use the rover in [Manual mode](../flight_modes_rover/differential.md#manual-mode).
|
||||
|
||||
This mode is also affected by (optional) acceleration/deceleration limits.
|
||||
As configuration of these limits becomes mandatory for subsequent modes, we do this setup here.
|
||||
|
||||
Navigate to [Parameters](../advanced_config/parameters.md) in QGroundControl and set the following parameters:
|
||||
|
||||
1. [RD_WHEEL_TRACK](#RD_WHEEL_TRACK) [m]: Measure the distance from the centre of the right wheel to the centre of the left wheel.
|
||||
|
||||

|
||||
|
||||
2. [RO_MAX_THR_SPEED](#RO_MAX_THR_SPEED) [m/s]: Drive the rover at full throttle and set this parameter to the observed value of the ground speed.
|
||||
|
||||
:::info
|
||||
This parameter is also used for the feed-forward term of the speed control.
|
||||
It will be further tuned in the configuration of [Position mode](#position-mode).
|
||||
:::
|
||||
|
||||
3. (Optional) [RO_ACCEL_LIM](#RO_ACCEL_LIM) [m/s^2]: Maximum acceleration you want to allow for your rover.
|
||||
|
||||
<a id="RO_ACCEL_LIM_CONSIDERATIONS"></a>
|
||||
|
||||
:::tip
|
||||
Your rover has a maximum possible acceleration which is determined by the maximum torque the motor can supply.
|
||||
This may or may not be appropriate for your vehicle and use case.
|
||||
|
||||
One approach to determine an appropriate value is:
|
||||
|
||||
1. From a standstill, give the rover full throttle until it reaches the maximum speed.
|
||||
2. Disarm the rover and plot the `measured_speed_body_x` from [RoverVelocityStatus](../msg_docs/RoverVelocityStatus.md).
|
||||
3. Divide the maximum speed by the time it took to reach it and set this as the value for [RO_ACCEL_LIM](#RO_ACCEL_LIM).
|
||||
|
||||
Some RC rovers have enough torque to lift up if the maximum acceleration is not limited.
|
||||
If that is the case:
|
||||
|
||||
4. Set [RO_ACCEL_LIM](#RO_ACCEL_LIM) to a low value, give the rover full throttle from a standstill and observe its behaviour.
|
||||
5. Increase [RO_ACCEL_LIM](#RO_ACCEL_LIM) until the rover starts to lift up during the acceleration.
|
||||
6. Set [RO_ACCEL_LIM](#RO_ACCEL_LIM) to the highest value that does not cause the rover to lift up.
|
||||
|
||||
:::
|
||||
|
||||
4. (Optional) [RO_DECEL_LIM](#RO_DECEL_LIM) [m/s^2]: Maximum deceleration you want to allow for your rover.
|
||||
|
||||
:::tip
|
||||
The same [considerations](#RO_ACCEL_LIM_CONSIDERATIONS) as in the configuration of [RO_ACCEL_LIM](#RO_ACCEL_LIM) apply.
|
||||
:::
|
||||
|
||||
:::info
|
||||
This parameter is also used for the calculation of the speed setpoint during [Auto modes](#auto-modes).
|
||||
:::
|
||||
|
||||
## Acro Mode
|
||||
|
||||
::: warning
|
||||
For this mode to work properly [Manual mode](#manual-mode) must've already been configured!
|
||||
:::
|
||||
|
||||
To set up [Acro mode](../flight_modes_rover/differential.md#acro-mode), navigate to [Parameters](../advanced_config/parameters.md) in QGroundControl and set the following parameters:
|
||||
|
||||
1. [RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM) [deg/s]: This is the maximum yaw rate you want to allow for your rover.
|
||||
This will define the stick-to-yaw-rate mapping for all manual modes using closed loop yaw control and set an upper limit for the yaw rate setpoint for all [auto modes](#auto-modes).
|
||||
1. [RD_MAX_THR_YAW_R](#RD_MAX_THR_YAW_R) [m/s]: This parameter is used to calculate the feed-forward term of the closed loop yaw rate control.
|
||||
The controller calculates the required speed difference between the left and right motor to achieve the desired yaw rate.
|
||||
This desired speed difference is then linearly mapped to normalized motor commands.
|
||||
To get a good starting value for this parameter drive the rover in manual mode forwards at full throttle and note the ground speed of the vehicle.
|
||||
Then enter _half_ this value for the parameter.
|
||||
<a id="RD_YAW_RATE_P_TUNING"></a>
|
||||
|
||||
::: tip
|
||||
To further tune this parameter, first make sure you set [RO_YAW_RATE_P](#RO_YAW_RATE_P) and [RO_YAW_RATE_I](#RO_YAW_RATE_I) to zero.
|
||||
This way the yaw rate is only controlled by the feed-forward term, which makes it easier to tune.
|
||||
Now put the rover in [Acro mode](../flight_modes_rover/differential.md#acro-mode) and then move the right-stick of your controller to the right and/or left and hold it at a few different levels for a couple of seconds each.
|
||||
Disarm the rover and from the flight log plot the `adjusted_yaw_rate_setpoint` from [RoverRateStatus](../msg_docs/RoverRateStatus.md) and the `measured_yaw_rate` from [RoverRateStatus](../msg_docs/RoverRateStatus.md) over each other.
|
||||
If the actual yaw rate of the rover is higher than the yaw rate setpoint, increase [RD_MAX_THR_YAW_R](#RD_MAX_THR_YAW_R).
|
||||
If it is the other way around decrease the parameter and repeat until you are satisfied with the setpoint tracking.
|
||||
:::
|
||||
|
||||
1. [RO_YAW_RATE_P](#RO_YAW_RATE_P) [-]: Proportional gain of the closed loop yaw rate controller.
|
||||
Unlike the feed-forward part of the controller, the closed loop yaw rate control will compare the yaw rate setpoint with the measured yaw rate and adapt to motor commands based on the error between them.
|
||||
The proportional gain is multiplied with this error and that value is added to the motor command.
|
||||
This compensates for disturbances such as uneven ground and external forces.
|
||||
|
||||
::: tip
|
||||
This parameter can be tuned the same way as [RD_MAX_THR_YAW_R](#RD_YAW_RATE_P_TUNING).
|
||||
If you tuned [RD_MAX_THR_YAW_R](#RD_MAX_THR_YAW_R) well, you might only need a very small value.
|
||||
:::
|
||||
|
||||
1. [RO_YAW_RATE_I](#RO_YAW_RATE_I) [-]: Integral gain of the closed loop yaw controller.
|
||||
The integral gain accumulates the error between the desired and actual yaw rate scaled by the integral gain over time and that value is added to the motor command.
|
||||
|
||||
::: tip
|
||||
An integrator might not be neccessary at this stage, but it will become important for subsequent modes.
|
||||
:::
|
||||
|
||||
1. (Optional) [RO_YAW_ACCEL_LIM](#RO_YAW_ACCEL_LIM) and [RO_YAW_DECEL_LIM](#RO_YAW_DECEL_LIM) [deg/s^2]:
|
||||
This is the maximum yaw acceleration and deceleration you want to allow for your rover.
|
||||
This can be used to smooth the `yaw_rate` setpoints and make their trajectory feasible based on the physical limitations of the rover.
|
||||
It also improves tracking and avoid integrator build up.
|
||||
|
||||
::: tip
|
||||
Your rover has a maximum possible yaw acceleration/deceleration which is determined by the maximum torque the motor can supply.
|
||||
This may or may not be appropriate for your vehicle and use case.
|
||||
|
||||
One approach to determine an appropriate value is:
|
||||
|
||||
1. Put the rover into [Manual mode](../flight_modes_rover/differential.md#manual-mode).
|
||||
2. From a standstill, move the right stick all the way to the right or left until the rover reaches the maximum yaw rate then return the right stick to the middle.
|
||||
3. Disarm the rover and plot the `measured_yaw_rate` from [RoverRateStatus](../msg_docs/RoverRateStatus.md).
|
||||
4. Divide the maximum yaw rate by the time it took to reach it and set this as the value for [RO_YAW_ACCEL_LIM](#RO_YAW_ACCEL_LIM).
|
||||
5. Divide the maximum yaw rate by the time it took to return to a standstill and set this as the value for [RO_YAW_ACCEL_LIM](#RO_YAW_ACCEL_LIM).
|
||||
|
||||
:::
|
||||
|
||||
The rover is now ready to drive in [Acro mode](../flight_modes_rover/differential.md#acro-mode).
|
||||
|
||||
## Stabilized Mode
|
||||
|
||||
::: warning
|
||||
For this mode to work properly [Acro mode](#acro-mode) must've already been configured!
|
||||
:::
|
||||
|
||||
For [Stabilized mode](../flight_modes_rover/differential.md#stabilized-mode) the controller utilizes a closed loop yaw controller, which creates a yaw rate setpoint to control the yaw when it is active:
|
||||
|
||||

|
||||
|
||||
Unlike the closed loop yaw rate, this controller has no feed-forward term.
|
||||
Therefore you only need to tune the closed loop gains:
|
||||
|
||||
1. [RO_YAW_P](#RO_YAW_P) [-]: Proportional gain for the closed loop yaw controller.
|
||||
|
||||
::: tip
|
||||
In stabilized mode the closed loop yaw control is only active when driving a straight line (no yaw rate input).
|
||||
|
||||
1. Start with a value of 1 for [RO_YAW_P](#RO_YAW_P).
|
||||
2. Put the rover into stabilized mode and move the left stick of your controller up and/or down to drive forwards/backwards.
|
||||
3. Disarm the rover and from the flight log plot the `measured_yaw` and the `adjusted_yaw_setpoint` from the [RoverAttitudeStatus](../msg_docs/RoverAttitudeStatus.md) message over each other.
|
||||
4. Increase/Decrease the parameter until you are satisfied with the setpoint tracking.
|
||||
:::
|
||||
|
||||
::: info
|
||||
For the closed loop yaw control an integrator gain is useful because this setpoint is often constant for a while and an integrator eliminates steady state errors that can cause the rover to never reach the setpoint.
|
||||
Since the yaw and yaw rate controllers are cascaded, there only needs to be one integrator which is in the yaw rate controller.
|
||||
If you observe a steady state error in the yaw setpoint increase the [RO_YAW_RATE_I](#RO_YAW_RATE_I) parameter.
|
||||
:::
|
||||
|
||||
The rover is now ready to drive in [Stabilized mode](../flight_modes_rover/differential.md#stabilized-mode).
|
||||
|
||||
## Position Mode
|
||||
|
||||
:::warning
|
||||
For this mode to work properly [Stabilized mode](#stabilized-mode) must already be configured!
|
||||
:::
|
||||
|
||||
[Position mode](../flight_modes_rover/differential.md#position-mode) is the most advanced manual mode, utilizing closed loop yaw rate, yaw and speed control and leveraging position estimates.
|
||||
|
||||
To configure set the following parameters:
|
||||
|
||||
1. [RO_SPEED_LIM](#RO_SPEED_LIM) [m/s]: This is the maximum speed you want to allow for your rover.
|
||||
This will define the stick-to-speed mapping for position mode and set an upper limit for the speed setpoint for all [auto modes](#auto-modes).
|
||||
2. [RO_MAX_THR_SPEED](#RO_MAX_THR_SPEED) [m/s]: This parameter is used to calculate the feed-forward term of the closed loop speed control which linearly maps desired speeds to normalized motor commands.
|
||||
A good starting point is the observed ground speed when the rover drives at maximum throttle in [Manual mode](../flight_modes_rover/differential.md#manual-mode).
|
||||
|
||||
<a id="RD_SPEED_P_TUNING"></a>
|
||||
|
||||
::: tip
|
||||
To further tune this parameter:
|
||||
|
||||
1. Set [RO_SPEED_P](#RO_SPEED_P) and [RO_SPEED_I](#RO_SPEED_I) to zero.
|
||||
This way the speed is only controlled by the feed-forward term, which makes it easier to tune.
|
||||
2. Put the rover in [Position mode](../flight_modes_rover/differential.md#position-mode) and then move the left stick of your controller up and/or down and hold it at a few different levels for a couple of seconds each.
|
||||
3. Disarm the rover and from the flight log plot the `adjusted_speed_body_x_setpoint` and the `measured_speed_body_x` from the [RoverVelocityStatus](../msg_docs/RoverVelocityStatus.md) message over each other.
|
||||
4. If the actual speed of the rover is higher than the speed setpoint, increase [RO_MAX_THR_SPEED](#RO_MAX_THR_SPEED).
|
||||
If it is the other way around decrease the parameter and repeat until you are satisfied with the setpoint tracking.
|
||||
|
||||
:::
|
||||
|
||||
::: info
|
||||
If your rover oscillates when driving a straight line in [Position mode](../flight_modes_rover/differential.md#position-mode) just set this parameter to the observed ground speed at maximum throttle in [Manual mode](../flight_modes_rover/differential.md#manual-mode) and complete steps 5-7 first before continuing the tuning of the closed loop speed control (Steps 2-4).
|
||||
:::
|
||||
|
||||
3. [RO_SPEED_P](#RO_SPEED_P) [-]: Proportional gain of the closed loop speed controller.
|
||||
|
||||
::: tip
|
||||
This parameter can be tuned the same way as [RO_MAX_THR_SPEED](#RD_SPEED_P_TUNING).
|
||||
If you tuned [RO_MAX_THR_SPEED](#RO_MAX_THR_SPEED) well, you might only need a very small value.
|
||||
:::
|
||||
|
||||
4. [RO_SPEED_I](#RO_SPEED_I) [-]: Integral gain for the closed loop speed controller.
|
||||
|
||||
::: tip
|
||||
For the closed loop speed control an integrator gain is useful because this setpoint is often constant for a while and an integrator eliminates steady state errors that can cause the rover to never reach the setpoint.
|
||||
:::
|
||||
|
||||
5. [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN): When driving in a straight line (no yaw rate input) position mode leverages the same path following algorithm used in [auto modes](#auto-modes) called [pure pursuit](#pure-pursuit-guidance-logic) to achieve the best possible straight line driving behaviour ([Illustration of control architecture](#pure_pursuit_controller)).
|
||||
This parameter determines how aggressive the controller will steer towards the path.
|
||||
|
||||
::: tip
|
||||
Decreasing the parameter makes it more aggressive but can lead to oscillations.
|
||||
|
||||
To tune this:
|
||||
|
||||
1. Start with a value of 1 for [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN)
|
||||
2. Put the rover in [Position mode](../flight_modes_rover/differential.md#position-mode) and while driving a straight line at approximately half the maximum speed observe its behaviour.
|
||||
3. If the rover does not drive in a straight line, reduce the value of the parameter, if it oscillates around the path increase the value.
|
||||
4. Repeat until you are satisfied with the behaviour.
|
||||
|
||||
:::
|
||||
|
||||
6. [PP_LOOKAHD_MIN](#PP_LOOKAHD_MIN): Minimum threshold for the lookahead distance used by the [pure pursuit algorithm](#pure-pursuit-guidance-logic).
|
||||
|
||||
::: tip
|
||||
Put the rover in [Position mode](../flight_modes_rover/differential.md#position-mode) and drive at very low speeds, if the rover starts to oscillate even though the tuning of [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN) was good for medium speeds, then increase the value of [PP_LOOKAHD_MIN](#PP_LOOKAHD_MIN).
|
||||
:::
|
||||
|
||||
7. [PP_LOOKAHD_MAX](#PP_LOOKAHD_MAX): Maximum threshold for the lookahead distance used by [pure pursuit](#pure-pursuit-guidance-logic).
|
||||
|
||||
::: tip
|
||||
Put the rover in [Position mode](../flight_modes_rover/differential.md#position-mode) and drive at very high speeds, if the rover does not drive in a straight line even though the tuning of [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN) was good for medium speeds, then decrease the value of [PP_LOOKAHD_MAX](#PP_LOOKAHD_MAX).
|
||||
:::
|
||||
|
||||
The rover is now ready to drive in [Position mode](../flight_modes_rover/differential.md#position-mode).
|
||||
|
||||
## Auto Modes
|
||||
|
||||
::: warning
|
||||
For this mode to work properly [Position mode](#position-mode) must already be configured!
|
||||
:::
|
||||
|
||||
<a id="pure_pursuit_controller"></a>
|
||||
In [auto modes](../flight_modes_rover/differential.md#auto-modes) the autopilot takes over navigation tasks using the following control architecture:
|
||||
|
||||

|
||||
|
||||
The required parameters are separated into the following sections:
|
||||
|
||||
### Speed
|
||||
|
||||
These parameters are used to calculate the speed setpoint in auto modes:
|
||||
|
||||
1. [RO_DECEL_LIM](#RO_DECEL_LIM) ($m/s^2$) and [RO_JERK_LIM](#RO_JERK_LIM) ($m/s^3$) are used to calculate a velocity trajectory such that the rover comes to a smooth stop as it reaches a waypoint.
|
||||
|
||||
::: tip
|
||||
Plan a mission for the rover to drive a square and observe how it slows down when approaching a waypoint:
|
||||
|
||||
- If the rover decelerates too quickly decrease the [RO_DECEL_LIM](#RO_DECEL_LIM) parameter, if it starts slowing down too early increase the parameter.
|
||||
- If you observe a jerking motion as the rover slows down, decrease the [RO_JERK_LIM](#RO_JERK_LIM) parameter otherwise increase it as much as possible as it can interfere with the tuning of [RO_DECEL_LIM](#RO_DECEL_LIM).
|
||||
|
||||
These two parameters have to be tuned as a pair, repeat until you are satisfied with the behaviour.
|
||||
:::
|
||||
|
||||
2. Plot the `adjusted_speed_body_x_setpoint` and `measured_speed_body_x` from the [RoverVelocityStatus](../msg_docs/RoverVelocityStatus.md) message over each other.
|
||||
If the tracking of these setpoints is not satisfactory adjust the values for [RO_SPEED_P](#RO_SPEED_P) and [RO_SPEED_I](#RO_SPEED_I).
|
||||
|
||||
The rover only slows down when approaching the waypoint if the angle between the line segment between the previous/current waypoint and current/next waypoint is smaller than 180° - [RD_TRANS_DRV_TRN](#RD_TRANS_DRV_TRN).
|
||||
In other words: The rover slows down only if the expected heading error towards the next waypoint when arriving at the current waypoint is below [RD_TRANS_DRV_TRN](#RD_TRANS_DRV_TRN).
|
||||
|
||||

|
||||
|
||||
For more information on the [RD_TRANS_DRV_TRN](#RD_TRANS_DRV_TRN) parameter see [State Machine](#state-machine).
|
||||
|
||||
### State Machine
|
||||
|
||||
The module employs the following state machine to make full use of a differential rovers ability to turn on the spot:
|
||||
|
||||

|
||||
|
||||
These transition thresholds can be set with [RD_TRANS_DRV_TRN](#RD_TRANS_DRV_TRN) and [RD_TRANS_TRN_DRV](#RD_TRANS_TRN_DRV).
|
||||
|
||||
### Path Following
|
||||
|
||||
The [pure pursuit](#pure-pursuit-guidance-logic) algorithm is used to calculate a desired yaw for the vehicle that is then close loop controlled.
|
||||
The close loop yaw rate was tuned in the configuration of the [Stabilized mode](#stabilized-mode) and the pure pursuit was tuned when setting up the [Position mode](#position-mode).
|
||||
During any auto navigation task observe the behaviour of the rover.
|
||||
If you are unsatisfied with the path following, there are 3 steps to take:
|
||||
|
||||
1. Plot the `adjusted_yaw_rate_setpoint` and the `measured_yaw_rate` from the [RoverRateStatus](../msg_docs/RoverRateStatus.md) over each other.
|
||||
If the tracking of these setpoints is not satisfactory adjust the values for [RO_YAW_RATE_P](#RO_YAW_RATE_P) and [RO_YAW_RATE_I](#RO_YAW_RATE_I).
|
||||
2. Plot the `adjusted_yaw_setpoint` and the `measured_yaw` from the [RoverAttitudeStatus](../msg_docs/RoverAttitudeStatus.md) over each other.
|
||||
If the tracking of these setpoints is not satisfactory adjust the value for [RO_YAW_P](#RO_YAW_RATE_P) and potentially further tune [RO_YAW_RATE_I](#RO_YAW_RATE_I).
|
||||
3. Steps 1 and 2 ensures accurate setpoint tracking, if the path following is still unsatisfactory you need to further tune the [pure pursuit](#pure-pursuit-guidance-logic) parameters.
|
||||
|
||||
## Pure Pursuit Guidance Logic
|
||||
|
||||
The desired yaw setpoints are generated using a pure pursuit algorithm:
|
||||
The controller takes the intersection point between a circle around the vehicle and a line segment.
|
||||
In mission mode this line is usually constructed by connecting the previous and current waypoint:
|
||||
|
||||

|
||||
|
||||
The radius of the circle around the vehicle is used to tune the controller and is often referred to as look-ahead distance.
|
||||
|
||||
The look ahead distance sets how aggressive the controller behaves and is defined as $l_d = v \cdot k$.
|
||||
It depends on the velocity $v$ of the rover and a tuning parameter $k$ that can be set with the parameter [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN).
|
||||
|
||||
::: info
|
||||
A lower value of [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN) makes the controller more aggressive but can lead to oscillations!
|
||||
:::
|
||||
|
||||
The lookahead is constrained between [PP_LOOKAHD_MAX](#PP_LOOKAHD_MAX) and [PP_LOOKAHD_MIN](#PP_LOOKAHD_MIN).
|
||||
|
||||
If the distance from the path to the rover is bigger than the lookahead distance, the rover will target the point on the path that is closest to the rover.
|
||||
|
||||
To summarize, the following parameters can be used to tune the controller:
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| -------------------------------------------------------------------------------------------------------- | --------------------------------------- | ---- |
|
||||
| <a id="PP_LOOKAHD_GAIN"></a>[PP_LOOKAHD_GAIN](../advanced_config/parameter_reference.md#PP_LOOKAHD_GAIN) | Main tuning parameter | - |
|
||||
| <a id="PP_LOOKAHD_MAX"></a>[PP_LOOKAHD_MAX](../advanced_config/parameter_reference.md#PP_LOOKAHD_MAX) | Maximum value for the look ahead radius | m |
|
||||
| <a id="PP_LOOKAHD_MIN"></a>[PP_LOOKAHD_MIN](../advanced_config/parameter_reference.md#PP_LOOKAHD_MIN) | Minimum value for the look ahead radius | m |
|
||||
|
||||
## Parameter Overview
|
||||
|
||||
List of all parameters of the differential rover module:
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ------- |
|
||||
| <a id="RD_WHEEL_TRACK"></a>[RD_WHEEL_TRACK](../advanced_config/parameter_reference.md#RD_WHEEL_TRACK) | Wheel track | m |
|
||||
| <a id="RD_MAX_THR_YAW_R"></a>[RD_MAX_THR_YAW_R](../advanced_config/parameter_reference.md#RD_MAX_THR_YAW_R) | Yaw rate turning left/right wheels at max speed in opposite directions | m/s |
|
||||
| <a id="RD_TRANS_DRV_TRN"></a>[RD_TRANS_DRV_TRN](../advanced_config/parameter_reference.md#RD_TRANS_DRV_TRN) | Heading error threshold to switch from driving to spot turning | deg |
|
||||
| <a id="RD_TRANS_TRN_DRV"></a>[RD_TRANS_TRN_DRV](../advanced_config/parameter_reference.md#RD_TRANS_TRN_DRV) | Heading error threshold to switch from spot turning to driving | deg |
|
||||
| <a id="RD_MISS_SPD_GAIN"></a>[RD_MISS_SPD_GAIN](../advanced_config/parameter_reference.md#RD_MISS_SPD_GAIN) | Tuning parameter for the speed reduction during waypoint transition | m/s |
|
||||
| <a id="RO_YAW_RATE_LIM"></a>[RO_YAW_RATE_LIM](../advanced_config/parameter_reference.md#RO_YAW_RATE_LIM) | Maximum allowed yaw rate for the rover | deg/s |
|
||||
| <a id="RO_YAW_RATE_P"></a>[RO_YAW_RATE_P](../advanced_config/parameter_reference.md#RO_YAW_RATE_P) | Proportional gain for yaw rate controller | - |
|
||||
| <a id="RO_YAW_RATE_I"></a>[RO_YAW_RATE_I](../advanced_config/parameter_reference.md#RO_YAW_RATE_I) | Integral gain for yaw rate controller | - |
|
||||
| <a id="RO_YAW_P"></a>[RO_YAW_P](../advanced_config/parameter_reference.md#RO_YAW_P) | Proportional gain for yaw controller | - |
|
||||
| <a id="RO_MAX_THR_SPEED"></a>[RO_MAX_THR_SPEED](../advanced_config/parameter_reference.md#RO_MAX_THR_SPEED) | Speed the rover drives at maximum throttle | m/s |
|
||||
| <a id="RO_SPEED_P"></a>[RO_SPEED_P](../advanced_config/parameter_reference.md#RO_SPEED_P) | Proportional gain for speed controller | - |
|
||||
| <a id="RO_SPEED_I"></a>[RO_SPEED_I](../advanced_config/parameter_reference.md#RO_SPEED_I) | Integral gain for speed controller | - |
|
||||
| <a id="RO_SPEED_LIM"></a>[RO_SPEED_LIM](../advanced_config/parameter_reference.md#RO_SPEED_LIM) | Maximum allowed speed for the rover (and default mission speed). | m/s |
|
||||
| <a id="PP_LOOKAHD_GAIN"></a>[PP_LOOKAHD_GAIN](../advanced_config/parameter_reference.md#PP_LOOKAHD_GAIN) | Main tuning parameter for pure pursuit | - |
|
||||
| <a id="PP_LOOKAHD_MAX"></a>[PP_LOOKAHD_MAX](../advanced_config/parameter_reference.md#PP_LOOKAHD_MAX) | Maximum value for the look ahead radius of the pure pursuit algorithm | m |
|
||||
| <a id="PP_LOOKAHD_MIN"></a>[PP_LOOKAHD_MIN](../advanced_config/parameter_reference.md#PP_LOOKAHD_MIN) | Minimum value for the look ahead radius of the pure pursuit algorithm | m |
|
||||
| <a id="RO_ACCEL_LIM"></a>[RO_ACCEL_LIM](../advanced_config/parameter_reference.md#RO_ACCEL_LIM) | (Optional) Maximum allowed acceleration | m/s^2 |
|
||||
| <a id="RO_DECEL_LIM"></a>[RO_DECEL_LIM](../advanced_config/parameter_reference.md#RO_DECEL_LIM) | (Optional) Maximum allowed deceleration | m/s^2 |
|
||||
| <a id="RO_JERK_LIM"></a>[RO_JERK_LIM](../advanced_config/parameter_reference.md#RO_JERK_LIM) | (Optional) Maximum allowed jerk | $m/s^3$ |
|
||||
| <a id="RO_YAW_ACCEL_LIM"></a>[RO_YAW_ACCEL_LIM](../advanced_config/parameter_reference.md#RO_YAW_ACCEL_LIM) | (Optional) Maximum allowed yaw acceleration | m/s^2 |
|
||||
| <a id="RO_YAW_DECEL_LIM"></a>[RO_YAW_DECEL_LIM](../advanced_config/parameter_reference.md#RO_YAW_DECEL_LIM) | (Optional) Maximum allowed yaw deceleration | m/s^2 |
|
||||
|
||||
## See Also
|
||||
|
||||
- [Drive Modes (Differential Rover)](../flight_modes_rover/differential.md).
|
||||
@@ -0,0 +1,44 @@
|
||||
# Rover Configuration/Tuning
|
||||
|
||||
This topic provides a step-by-step guide for setting up your rover.
|
||||
|
||||
Successive steps enable [drive modes](../flight_modes_rover/index.md) with more autopilot support and features:
|
||||
|
||||
| Step | Configuration | Unlocked PX4 Drive Mode |
|
||||
| ---- | ------------------------------------- | ------------------------------------------------------------------------- |
|
||||
| 1 | [Basic Setup](basic_setup.md) | [Full manual mode](../flight_modes_rover/manual.md#manual-mode) |
|
||||
| 2 | [Rate Tuning](rate_tuning.md) | [Manual acro mode](../flight_modes_rover/manual.md#acro-mode) |
|
||||
| 3 | [Attitude Tuning](attitude_tuning.md) | [Manual stabilized mode](../flight_modes_rover/manual.md#stabilized-mode) |
|
||||
| 4 | [Velocity Tuning](velocity_tuning.md) | [Manual position mode](../flight_modes_rover/manual.md#manual-mode) |
|
||||
| 5 | [Position Tuning](position_tuning.md) | [Auto modes](../flight_modes_rover/auto.md) |
|
||||
|
||||
::: warning
|
||||
A drive mode will only work properly if all the configuration for the preceding modes has been completed.
|
||||
:::
|
||||
|
||||
## Flashing the Rover Build
|
||||
|
||||
Rovers use a custom build that must be flashed onto your flight controller instead of the default PX4 build:
|
||||
|
||||
1. First build the rover firmware for your flight controller from the `main` branch (there is no release build, so you can't just select this build from QGroundControl).
|
||||
|
||||
To build for rover with the `make` command, replace the `_default` suffix with `_rover`.
|
||||
For example, to build rover for px4_fmu-v6x boards, you would use the command:
|
||||
|
||||
```sh
|
||||
make px4_fmu-v6x_rover
|
||||
```
|
||||
|
||||
::: info
|
||||
You can also enable the modules in default builds by adding these lines to your [board configuration](../hardware/porting_guide_config.md) (e.g. for fmu-v6x you might add them to [`main/boards/px4/fmu-v6x/default.px4board`](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v6x/default.px4board)):
|
||||
|
||||
```sh
|
||||
CONFIG_MODULES_ROVER_ACKERMANN=y
|
||||
CONFIG_MODULES_ROVER_DIFFERENTIAL=y
|
||||
CONFIG_MODULES_ROVER_MECANUM=y
|
||||
```
|
||||
|
||||
Note that adding the rover modules may lead to flash overflow, in which case you will need to disable modules that you do not plan to use (such as those related to multicopter or fixed wing).
|
||||
:::
|
||||
|
||||
2. Load the **custom firmware** that you just built onto your flight controller (see [Loading Firmware > Installing PX4 Main, Beta or Custom Firmware](../config/firmware.md#installing-px4-main-beta-or-custom-firmware)).
|
||||
@@ -1,376 +0,0 @@
|
||||
# Configuration/Tuning (Mecanum Rover)
|
||||
|
||||
This topic provides a step-by-step guide for setting up your [Mecanum rover](../frames_rover/mecanum.md).
|
||||
Successive steps enable [drive modes](../flight_modes_rover/mecanum.md) with more autopilot support and features.
|
||||
|
||||
::: warning
|
||||
Each step is dependent on the previous steps having been completed.
|
||||
Modes will only work properly if the preceding modes have been configured.
|
||||
:::
|
||||
|
||||
## Basic Setup
|
||||
|
||||
To start using the mecanum rover:
|
||||
|
||||
1. Enable Rover support by flashing the [PX4 rover build](../frames_rover/index.md#flashing-the-rover-build) onto your flight controller.
|
||||
Note that this is a special build that contains rover-specific modules.
|
||||
|
||||
2. In the [Airframe](../config/airframe.md) configuration select _Generic Rover Mecanum_ frame:
|
||||
|
||||

|
||||
|
||||
Select the **Apply and Restart** button.
|
||||
|
||||
::: info
|
||||
If this airframe does not show up in the UI, it can alternatively be selected by setting the [SYS_AUTOSTART](../advanced_config/parameter_reference.md#SYS_AUTOSTART) parameter to `52000`.
|
||||
:::
|
||||
|
||||
3. Use [Actuators Configuration & Testing](../config/actuators.md) to map the motor functions to flight controller outputs.
|
||||
|
||||
## Manual Mode
|
||||
|
||||
::: warning
|
||||
For this mode to work properly the [Basic Setup](#basic-setup) must've already been completed!
|
||||
:::
|
||||
|
||||
The basic setup already covers the minimum setup required to use the rover in [Manual mode](../flight_modes_rover/mecanum.md#manual-mode).
|
||||
|
||||
This mode is also affected by (optional) acceleration/deceleration limits.
|
||||
As configuration of these limits becomes mandatory for subsequent modes, we do this setup here.
|
||||
|
||||
Navigate to [Parameters](../advanced_config/parameters.md) in QGroundControl and set the following parameters:
|
||||
|
||||
1. [RM_WHEEL_TRACK](#RM_WHEEL_TRACK) [m]: Measure the distance from the centre of the right wheel to the centre of the left wheel.
|
||||
|
||||

|
||||
|
||||
2. [RO_MAX_THR_SPEED](#RO_MAX_THR_SPEED) [m/s]: Drive the rover at full throttle and set this parameter to the observed value of the ground speed.
|
||||
|
||||
:::info
|
||||
This parameter is also used for the feed-forward term of the speed control.
|
||||
It will be further tuned in the configuration of [Position mode](#position-mode).
|
||||
:::
|
||||
|
||||
3. (Optional) [RO_ACCEL_LIM](#RO_ACCEL_LIM) [m/s^2]: Maximum acceleration you want to allow for your rover.
|
||||
|
||||
<a id="RO_ACCEL_LIM_CONSIDERATIONS"></a>
|
||||
|
||||
:::tip
|
||||
Your rover has a maximum possible acceleration which is determined by the maximum torque the motor can supply.
|
||||
This may or may not be appropriate for your vehicle and use case.
|
||||
|
||||
One approach to determine an appropriate value is:
|
||||
|
||||
1. From a standstill, give the rover full throttle until it reaches the maximum speed.
|
||||
2. Disarm the rover and plot the `measured_speed_body_x` from [RoverVelocityStatus](../msg_docs/RoverVelocityStatus.md).
|
||||
3. Divide the maximum speed by the time it took to reach it and set this as the value for [RO_ACCEL_LIM](#RO_ACCEL_LIM).
|
||||
|
||||
Some RC rovers have enough torque to lift up if the maximum acceleration is not limited.
|
||||
If that is the case:
|
||||
|
||||
4. Set [RO_ACCEL_LIM](#RO_ACCEL_LIM) to a low value, give the rover full throttle from a standstill and observe its behaviour.
|
||||
5. Increase [RO_ACCEL_LIM](#RO_ACCEL_LIM) until the rover starts to lift up during the acceleration.
|
||||
6. Set [RO_ACCEL_LIM](#RO_ACCEL_LIM) to the highest value that does not cause the rover to lift up.
|
||||
|
||||
:::
|
||||
|
||||
4. (Optional) [RO_DECEL_LIM](#RO_DECEL_LIM) [m/s^2]: Maximum deceleration you want to allow for your rover.
|
||||
|
||||
:::tip
|
||||
The same [considerations](#RO_ACCEL_LIM_CONSIDERATIONS) as in the configuration of [RO_ACCEL_LIM](#RO_ACCEL_LIM) apply.
|
||||
:::
|
||||
|
||||
:::info
|
||||
This parameter is also used for the calculation of the speed setpoint during [Auto modes](#auto-modes).
|
||||
:::
|
||||
|
||||
## Acro Mode
|
||||
|
||||
::: warning
|
||||
For this mode to work properly [Manual mode](#manual-mode) must've already been configured!
|
||||
:::
|
||||
|
||||
To set up [Acro mode](../flight_modes_rover/mecanum.md#acro-mode) navigate to [Parameters](../advanced_config/parameters.md) in QGroundControl and set the following parameters:
|
||||
|
||||
1. [RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM) [deg/s]: This is the maximum yaw rate you want to allow for your rover.
|
||||
This will define the stick-to-yaw-rate mapping for all manual modes using closed loop yaw control and set an upper limit for the yaw rate setpoint for all [auto modes](#auto-modes).
|
||||
1. [RM_MAX_THR_YAW_R](#RM_MAX_THR_YAW_R) [m/s]: This parameter is used to calculate the feed-forward term of the closed loop yaw rate control.
|
||||
The controller calculates the required speed difference between the left and right motor to achieve the desired yaw rate.
|
||||
This desired speed difference is then linearly mapped to normalized motor commands.
|
||||
To get a good starting value for this parameter drive the rover in manual mode forwards at full throttle and note the ground speed of the vehicle.
|
||||
Then enter _half_ this value for the parameter.
|
||||
<a id="RM_YAW_RATE_P_TUNING"></a>
|
||||
|
||||
::: tip
|
||||
To further tune this parameter, first make sure you set [RO_YAW_RATE_P](#RO_YAW_RATE_P) and [RO_YAW_RATE_I](#RO_YAW_RATE_I) to zero.
|
||||
This way the yaw rate is only controlled by the feed-forward term, which makes it easier to tune.
|
||||
Now put the rover in [Acro mode](../flight_modes_rover/mecanum.md#acro-mode) and then move the right-stick of your controller to the right and/or left and hold it at a few different levels for a couple of seconds each.
|
||||
Disarm the rover and from the flight log plot the `adjusted_yaw_rate_setpoint` from [RoverRateStatus](../msg_docs/RoverRateStatus.md) and the `measured_yaw_rate` from [RoverRateStatus](../msg_docs/RoverRateStatus.md) over each other.
|
||||
If the actual yaw rate of the rover is higher than the yaw rate setpoint, increase [RM_MAX_THR_YAW_R](#RM_MAX_THR_YAW_R).
|
||||
If it is the other way around decrease the parameter and repeat until you are satisfied with the setpoint tracking.
|
||||
:::
|
||||
|
||||
1. [RO_YAW_RATE_P](#RO_YAW_RATE_P) [-]: Proportional gain of the closed loop yaw rate controller.
|
||||
Unlike the feed-forward part of the controller, the closed loop yaw rate control will compare the yaw rate setpoint with the measured yaw rate and adapt to motor commands based on the error between them.
|
||||
The proportional gain is multiplied with this error and that value is added to the motor command.
|
||||
This compensates for disturbances such as uneven ground and external forces.
|
||||
|
||||
::: tip
|
||||
This parameter can be tuned the same way as [RM_MAX_THR_YAW_R](#RM_YAW_RATE_P_TUNING).
|
||||
If you tuned [RM_MAX_THR_YAW_R](#RM_MAX_THR_YAW_R) well, you might only need a very small value.
|
||||
:::
|
||||
|
||||
1. [RO_YAW_RATE_I](#RO_YAW_RATE_I) [-]: Integral gain of the closed loop yaw controller.
|
||||
The integral gain accumulates the error between the desired and actual yaw rate scaled by the integral gain over time and that value is added to the motor command.
|
||||
|
||||
::: tip
|
||||
An integrator might not be neccessary at this stage, but it will become important for subsequent modes.
|
||||
:::
|
||||
|
||||
1. (Optional) [RO_YAW_ACCEL_LIM](#RO_YAW_ACCEL_LIM) and [RO_YAW_DECEL_LIM](#RO_YAW_DECEL_LIM) [deg/s^2]: This is the maximum yaw acceleration and deceleration you want to allow for your rover.
|
||||
This can be used to smooth the `yaw_rate` setpoints and make their trajectory feasible based on the physical limitation on the rover to improve tracking and avoid integrator build up.
|
||||
|
||||
::: tip
|
||||
Your rover has a maximum possible yaw acceleration/deceleration which is determined by the maximum torque the motor can supply.
|
||||
This may or may not be appropriate for your vehicle and use case.
|
||||
|
||||
One approach to determine an appropriate value is:
|
||||
|
||||
1. Put the rover into [Manual mode](../flight_modes_rover/mecanum.md#manual-mode).
|
||||
2. From a standstill, move the right stick all the way to the right or left until the rover reaches the maximum yaw rate then return the right stick to the middle.
|
||||
3. Disarm the rover and plot the `measured_yaw_rate` from [RoverRateStatus](../msg_docs/RoverRateStatus.md).
|
||||
4. Divide the maximum yaw rate by the time it took to reach it and set this as the value for [RO_YAW_ACCEL_LIM](#RO_YAW_ACCEL_LIM).
|
||||
5. Divide the maximum yaw rate by the time it took to return to a standstill and set this as the value for [RO_YAW_ACCEL_LIM](#RO_YAW_ACCEL_LIM).
|
||||
|
||||
:::
|
||||
|
||||
The rover is now ready to drive in [Acro mode](../flight_modes_rover/mecanum.md#acro-mode).
|
||||
|
||||
## Stabilized Mode
|
||||
|
||||
::: warning
|
||||
For this mode to work properly [Acro mode](#acro-mode) must've already been configured!
|
||||
:::
|
||||
|
||||
For [Stabilized mode](../flight_modes_rover/mecanum.md#stabilized-mode) the controller utilizes a closed loop yaw controller, which creates a yaw rate setpoint to control the yaw when it is active:
|
||||
|
||||

|
||||
|
||||
Unlike the closed loop yaw rate, this controller has no feed-forward term.
|
||||
Therefore you only need to tune the closed loop gains:
|
||||
|
||||
1. [RO_YAW_P](#RO_YAW_P) [-]: Proportional gain for the closed loop yaw controller.
|
||||
|
||||
::: tip
|
||||
In stabilized mode the closed loop yaw control is only active when driving a straight line (no yaw rate input).
|
||||
Start with a value of 1 for [RO_YAW_P](#RO_YAW_P).
|
||||
Put the rover into stabilized mode and move the left stick of your controller up and/or down to drive forwards/backwards.
|
||||
Disarm the rover and from the flight log plot the `measured_yaw` and the `adjusted_yaw_setpoint` from the [RoverAttitudeStatus](../msg_docs/RoverAttitudeStatus.md) message over each other.
|
||||
Increase/Decrease the parameter until you are satisfied with the setpoint tracking.
|
||||
:::
|
||||
|
||||
::: info
|
||||
For the closed loop yaw control an integrator gain is useful because this setpoint is often constant for a while and an integrator eliminates steady state errors that can cause the rover to never reach the setpoint.
|
||||
Since the yaw and yaw rate controllers are cascaded, there only needs to be one integrator which is in the yaw rate controller.
|
||||
If you observe a steady state error in the yaw setpoint increase the [RO_YAW_RATE_I](#RO_YAW_RATE_I) parameter.
|
||||
:::
|
||||
|
||||
The rover is now ready to drive in [Stabilized mode](../flight_modes_rover/mecanum.md#stabilized-mode).
|
||||
|
||||
## Position Mode
|
||||
|
||||
:::warning
|
||||
For this mode to work properly [Stabilized mode](#stabilized-mode) must already be configured!
|
||||
:::
|
||||
|
||||
[Position mode](../flight_modes_rover/mecanum.md#position-mode) is the most advanced manual mode, utilizing closed loop yaw rate, yaw and speed control and leveraging position estimates.
|
||||
|
||||
To configure set the following parameters:
|
||||
|
||||
::: info
|
||||
The speed control in longitudinal and lateral direction use the same tuning parameters.
|
||||
:::
|
||||
|
||||
1. [RO_SPEED_LIM](#RO_SPEED_LIM) [m/s]: This is the maximum speed you want to allow for your rover.
|
||||
This will define the stick-to-speed mapping for position mode and set an upper limit for the speed setpoint for all [auto modes](#auto-modes).
|
||||
For mecanum rovers the speed is defined in the direction of travel (magnitude of the velocity vector consisting of the longitudinal and lateral speed).
|
||||
2. [RO_MAX_THR_SPEED](#RO_MAX_THR_SPEED) [m/s]: This parameter is used to calculate the feed-forward term of the closed loop speed control which linearly maps desired speeds to normalized motor commands.
|
||||
A good starting point is the observed ground speed when the rover drives at maximum throttle in [Manual mode](../flight_modes_rover/mecanum.md#manual-mode).
|
||||
|
||||
<a id="RD_SPEED_P_TUNING"></a>
|
||||
|
||||
::: tip
|
||||
To further tune this parameter:
|
||||
|
||||
1. Set [RO_SPEED_P](#RO_SPEED_P) and [RO_SPEED_I](#RO_SPEED_I) to zero.
|
||||
This way the speed is only controlled by the feed-forward term, which makes it easier to tune.
|
||||
2. Put the rover in [Position mode](../flight_modes_rover/mecanum.md#position-mode) and then move the left stick of your controller up and/or down and hold it at a few different levels for a couple of seconds each.
|
||||
3. Disarm the rover and from the flight log plot the `adjusted_speed_body_x_setpoint` and the `measured_speed_body_x` from the [RoverVelocityStatus](../msg_docs/RoverVelocityStatus.md) message over each other.
|
||||
4. If the actual speed of the rover is higher than the speed setpoint, increase [RO_MAX_THR_SPEED](#RO_MAX_THR_SPEED).
|
||||
If it is the other way around decrease the parameter and repeat until you are satisfied with the setpoint tracking.
|
||||
|
||||
:::
|
||||
|
||||
::: info
|
||||
If your rover oscillates when driving a straight line in [Position mode](../flight_modes_rover/mecanum.md#position-mode) just set this parameter to the observed ground speed at maximum throttle in [Manual mode](../flight_modes_rover/mecanum.md#manual-mode) and complete steps 5-7 first before continuing the tuning of the closed loop speed control (Steps 2-4).
|
||||
:::
|
||||
|
||||
3. [RO_SPEED_P](#RO_SPEED_P) [-]: Proportional gain of the closed loop speed controller.
|
||||
|
||||
::: tip
|
||||
This parameter can be tuned the same way as [RO_MAX_THR_SPEED](#RD_SPEED_P_TUNING).
|
||||
If you tuned [RO_MAX_THR_SPEED](#RO_MAX_THR_SPEED) well, you might only need a very small value.
|
||||
:::
|
||||
|
||||
4. [RO_SPEED_I](#RO_SPEED_I) [-]: Integral gain for the closed loop speed controller.
|
||||
|
||||
::: tip
|
||||
For the closed loop speed control an integrator gain is useful because this setpoint is often constant for a while and an integrator eliminates steady state errors that can cause the rover to never reach the setpoint.
|
||||
:::
|
||||
|
||||
5. [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN): When driving in a straight line (no yaw rate input) position mode leverages the same path following algorithm used in [auto modes](#auto-modes) called [pure pursuit](#pure-pursuit-guidance-logic) to achieve the best possible straight line driving behaviour ([Illustration of control architecture](#pure_pursuit_controller)).
|
||||
This parameter determines how aggressive the controller will steer towards the path.
|
||||
|
||||
::: tip
|
||||
Decreasing the parameter makes it more aggressive but can lead to oscillations.
|
||||
|
||||
To tune this:
|
||||
|
||||
1. Start with a value of 1 for [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN)
|
||||
2. Put the rover in [Position mode](../flight_modes_rover/mecanum.md#position-mode) and while driving a straight line at approximately half the maximum speed observe its behaviour.
|
||||
3. If the rover does not drive in a straight line, reduce the value of the parameter, if it oscillates around the path increase the value.
|
||||
4. Repeat until you are satisfied with the behaviour.
|
||||
|
||||
:::
|
||||
|
||||
6. [PP_LOOKAHD_MIN](#PP_LOOKAHD_MIN): Minimum threshold for the lookahead distance used by the [pure pursuit algorithm](#pure-pursuit-guidance-logic).
|
||||
|
||||
::: tip
|
||||
Put the rover in [Position mode](../flight_modes_rover/mecanum.md#position-mode) and drive at very low speeds, if the rover starts to oscillate even though the tuning of [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN) was good for medium speeds, then increase the value of [PP_LOOKAHD_MIN](#PP_LOOKAHD_MIN).
|
||||
:::
|
||||
|
||||
7. [PP_LOOKAHD_MAX](#PP_LOOKAHD_MAX): Maximum threshold for the lookahead distance used by [pure pursuit](#pure-pursuit-guidance-logic).
|
||||
|
||||
::: tip
|
||||
Put the rover in [Position mode](../flight_modes_rover/mecanum.md#position-mode) and drive at very high speeds, if the rover does not drive in a straight line even though the tuning of [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN) was good for medium speeds, then decrease the value of [PP_LOOKAHD_MAX](#PP_LOOKAHD_MAX).
|
||||
:::
|
||||
|
||||
The rover is now ready to drive in [Position mode](../flight_modes_rover/mecanum.md#position-mode).
|
||||
|
||||
## Auto Modes
|
||||
|
||||
::: warning
|
||||
For this mode to work properly [Position mode](#position-mode) must already be configured!
|
||||
:::
|
||||
|
||||
<a id="pure_pursuit_controller"></a>
|
||||
In [auto modes](../flight_modes_rover/mecanum.md#auto-modes) the autopilot takes over navigation tasks using the following control architecture:
|
||||
|
||||

|
||||
|
||||
The mecanum module fully leverages the omnidirectionality of this type of rover by maintaining the initial heading of the rover during the entire mission (see [Pure Pursuit Guidance Logic](#pure-pursuit-guidance-logic)).
|
||||
|
||||
The required parameters are separated into the following sections:
|
||||
|
||||
### Speed
|
||||
|
||||
These parameters are used to calculate the velocity setpoint in auto modes:
|
||||
|
||||
1. [RO_SPEED_LIM](#RO_SPEED_LIM): Sets the default speed ($m/s$) for the rover during the mission (as well as the maximum speed).
|
||||
For mecanum rovers the speed is defined in the direction of travel (magnitude of the velocity vector consisting of the longitudinal and lateral speed).
|
||||
2. [RO_DECEL_LIM](#RO_DECEL_LIM) ($m/s^2$) and [RO_JERK_LIM](#RO_JERK_LIM) ($m/s^3$) are used to calculate a velocity trajectory such that the rover comes to a smooth stop as it reaches a waypoint.
|
||||
|
||||
::: tip
|
||||
Plan a mission for the rover to drive a square and observe how it slows down when approaching a waypoint:
|
||||
|
||||
- If the rover decelerates too quickly decrease the [RO_DECEL_LIM](#RO_DECEL_LIM) parameter, if it starts slowing down too early increase the parameter.
|
||||
- If you observe a jerking motion as the rover slows down, decrease the [RO_JERK_LIM](#RO_JERK_LIM) parameter otherwise increase it as much as possible as it can interfere with the tuning of [RO_DECEL_LIM](#RO_DECEL_LIM).
|
||||
|
||||
These two parameters have to be tuned as a pair, repeat until you are satisfied with the behaviour.
|
||||
:::
|
||||
|
||||
3. [RM_MISS_SPD_GAIN](#RM_MISS_SPD_GAIN): The rover slows down when approaching a waypoint based on the angle between the line segment from the previous to current waypoint and current to next waypoint.
|
||||
How much the rover slows down can be tuned with this parameter:
|
||||
|
||||
$$
|
||||
v_{transition} = v_{max} \cdot (1 - \theta_{normalized} * k)
|
||||
$$
|
||||
|
||||
with:
|
||||
|
||||
- $v_{transition}:$ Transition speed
|
||||
- $v_{max}:$ Maximum speed ([RO_SPEED_LIM](#RO_SPEED_LIM))
|
||||
- $\theta_{normalized}:$ Angle between the line segment of the prev-current and current-next waypoints, normalized from $[0\degree, 180\degree]$ to $[0, 1]$
|
||||
- $k:$ Tuning parameter ([RM_MISS_SPD_GAIN](#RM_MISS_SPD_GAIN)).
|
||||
|
||||
4. Plot the `adjusted_speed_body_x_setpoint` and `measured_speed_body_x` from the [RoverVelocityStatus](../msg_docs/RoverVelocityStatus.md) message over each other.
|
||||
If the tracking of these setpoints is not satisfactory adjust the values for [RO_SPEED_P](#RO_SPEED_P) and [RO_SPEED_I](#RO_SPEED_I).
|
||||
|
||||
### Path Following
|
||||
|
||||
The [pure pursuit](#pure-pursuit-guidance-logic) algorithm is used to calculate a desired bearing for the vehicle that is then close loop controlled.
|
||||
For mecanum rovers the path following is achieved by directly controlling the velocity of the rover in direction of the desired bearing.
|
||||
During any auto navigation task observe the behaviour of the rover:
|
||||
|
||||
1. If you are unsatisfied with the path following you need to further tune the [pure pursuit](#pure-pursuit-guidance-logic) parameters.
|
||||
2. If the rover does not maintain its initial heading well enough, adjust the value for [RO_YAW_P](#RO_YAW_RATE_P) and potentially further tune [RO_YAW_RATE_I](#RO_YAW_RATE_I).
|
||||
|
||||
## Pure Pursuit Guidance Logic
|
||||
|
||||
The desired bearing setpoints are generated using a pure pursuit algorithm:
|
||||
The controller takes the intersection point between a circle around the vehicle and a line segment.
|
||||
In mission mode this line is usually constructed by connecting the previous and current waypoint:
|
||||
|
||||

|
||||
|
||||
The radius of the circle around the vehicle is used to tune the controller and is often referred to as look-ahead distance.
|
||||
|
||||
The look ahead distance sets how aggressive the controller behaves and is defined as $l_d = v \cdot k$.
|
||||
It depends on the velocity $v$ of the rover and a tuning parameter $k$ that can be set with the parameter [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN).
|
||||
|
||||
::: info
|
||||
A lower value of [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN) makes the controller more aggressive but can lead to oscillations!
|
||||
:::
|
||||
|
||||
The lookahead is constrained between [PP_LOOKAHD_MAX](#PP_LOOKAHD_MAX) and [PP_LOOKAHD_MIN](#PP_LOOKAHD_MIN).
|
||||
|
||||
If the distance from the path to the rover is bigger than the lookahead distance, the rover will target the point on the path that is closest to the rover.
|
||||
|
||||
To summarize, the following parameters can be used to tune the controller:
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| -------------------------------------------------------------------------------------------------------- | --------------------------------------- | ---- |
|
||||
| <a id="PP_LOOKAHD_GAIN"></a>[PP_LOOKAHD_GAIN](../advanced_config/parameter_reference.md#PP_LOOKAHD_GAIN) | Main tuning parameter | - |
|
||||
| <a id="PP_LOOKAHD_MAX"></a>[PP_LOOKAHD_MAX](../advanced_config/parameter_reference.md#PP_LOOKAHD_MAX) | Maximum value for the look ahead radius | m |
|
||||
| <a id="PP_LOOKAHD_MIN"></a>[PP_LOOKAHD_MIN](../advanced_config/parameter_reference.md#PP_LOOKAHD_MIN) | Minimum value for the look ahead radius | m |
|
||||
|
||||
## Parameter Overview
|
||||
|
||||
List of all parameters of the mecanum rover module:
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ------- |
|
||||
| <a id="RM_WHEEL_TRACK"></a>[RM_WHEEL_TRACK](../advanced_config/parameter_reference.md#RM_WHEEL_TRACK) | Wheel track | m |
|
||||
| <a id="RM_MAX_THR_YAW_R"></a>[RM_MAX_THR_YAW_R](../advanced_config/parameter_reference.md#RM_MAX_THR_YAW_R) | Yaw rate turning left/right wheels at max speed in opposite directions | m/s |
|
||||
| <a id="RM_MISS_SPD_GAIN"></a>[RM_MISS_SPD_GAIN](../advanced_config/parameter_reference.md#RM_MISS_SPD_GAIN) | Tuning parameter for the velocity reduction during waypoint transition | - |
|
||||
| <a id="RM_COURSE_CTL_TH"></a>[RM_COURSE_CTL_TH](../advanced_config/parameter_reference.md#RM_COURSE_CTL_TH) | Threshold to update course control in manual position mode | rad |
|
||||
| <a id="RO_YAW_RATE_LIM"></a>[RO_YAW_RATE_LIM](../advanced_config/parameter_reference.md#RO_YAW_RATE_LIM) | Maximum allowed yaw rate for the rover | deg/s |
|
||||
| <a id="RO_YAW_RATE_P"></a>[RO_YAW_RATE_P](../advanced_config/parameter_reference.md#RO_YAW_RATE_P) | Proportional gain for yaw rate controller | - |
|
||||
| <a id="RO_YAW_RATE_I"></a>[RO_YAW_RATE_I](../advanced_config/parameter_reference.md#RO_YAW_RATE_I) | Integral gain for yaw rate controller | - |
|
||||
| <a id="RO_YAW_P"></a>[RO_YAW_P](../advanced_config/parameter_reference.md#RO_YAW_P) | Proportional gain for yaw controller | - |
|
||||
| <a id="RO_SPEED_LIM"></a>[RO_SPEED_LIM](../advanced_config/parameter_reference.md#RO_SPEED_LIM) | Maximum allowed speed for the rover (and default mission speed). | m/s |
|
||||
| <a id="RO_MAX_THR_SPEED"></a>[RO_MAX_THR_SPEED](../advanced_config/parameter_reference.md#RO_MAX_THR_SPEED) | Speed the rover drives at maximum throttle | m/s |
|
||||
| <a id="RO_SPEED_P"></a>[RO_SPEED_P](../advanced_config/parameter_reference.md#RO_SPEED_P) | Proportional gain for speed controller | - |
|
||||
| <a id="RO_SPEED_I"></a>[RO_SPEED_I](../advanced_config/parameter_reference.md#RO_SPEED_I) | Integral gain for speed controller | - |
|
||||
| <a id="PP_LOOKAHD_GAIN"></a>[PP_LOOKAHD_GAIN](../advanced_config/parameter_reference.md#PP_LOOKAHD_GAIN) | Main tuning parameter for pure pursuit | - |
|
||||
| <a id="PP_LOOKAHD_MAX"></a>[PP_LOOKAHD_MAX](../advanced_config/parameter_reference.md#PP_LOOKAHD_MAX) | Maximum value for the look ahead radius of the pure pursuit algorithm | m |
|
||||
| <a id="PP_LOOKAHD_MIN"></a>[PP_LOOKAHD_MIN](../advanced_config/parameter_reference.md#PP_LOOKAHD_MIN) | Minimum value for the look ahead radius of the pure pursuit algorithm | m |
|
||||
| <a id="RO_ACCEL_LIM"></a>[RO_ACCEL_LIM](../advanced_config/parameter_reference.md#RO_ACCEL_LIM) | (Optional) Maximum allowed acceleration | m/s^2 |
|
||||
| <a id="RO_DECEL_LIM"></a>[RO_DECEL_LIM](../advanced_config/parameter_reference.md#RO_DECEL_LIM) | (Optional) Maximum allowed deceleration | m/s^2 |
|
||||
| <a id="RO_JERK_LIM"></a>[RO_JERK_LIM](../advanced_config/parameter_reference.md#RO_JERK_LIM) | (Optional) Maximum allowed jerk | $m/s^3$ |
|
||||
| <a id="RO_YAW_ACCEL_LIM"></a>[RO_YAW_ACCEL_LIM](../advanced_config/parameter_reference.md#RO_YAW_ACCEL_LIM) | (Optional) Maximum allowed yaw acceleration | m/s^2 |
|
||||
| <a id="RO_YAW_DECEL_LIM"></a>[RO_YAW_DECEL_LIM](../advanced_config/parameter_reference.md#RO_YAW_DECEL_LIM) | (Optional) Maximum allowed yaw deceleration | m/s^2 |
|
||||
|
||||
## See Also
|
||||
|
||||
- [Drive Modes (Mecanum Rover)](../flight_modes_rover/mecanum.md).
|
||||
@@ -0,0 +1,199 @@
|
||||
# Position Tuning
|
||||
|
||||
Position tuning is required in order to use [Auto modes](../flight_modes_rover/auto.md).
|
||||
|
||||
:::warning
|
||||
The [velocity tuning](velocity_tuning.md) must've already been completed before this step!
|
||||
:::
|
||||
|
||||
The position controller is responsible for autonomously guiding the vehicle to a position setpoint.
|
||||
These position setpoints are automatically generated by the internal PX4 auto modes (Mission, Return, GoTo, ...) or can directly be sent to the rover through the `RoverPositionSetpoint.msg` (External Modes).
|
||||
A path is generated for the rover to reach its destination, which tracked through a path following algorithm called [pure pursuit](#pure-pursuit-guidance-logic-info-only).
|
||||
|
||||
To tune the position controller configure the [parameters](../advanced_config/parameters.md) in the following sections (using QGroundControl).
|
||||
|
||||
## Speed
|
||||
|
||||
1. (Optional) [RO_SPEED_RED](#RO_SPEED_RED): Tuning parameter for the speed reduction based on the course error.
|
||||
This can be used to limit the maximum allowed speed based on the difference between the current course and the bearing setpoint:
|
||||
$v*{max} = v*{full throttle} \cdot (1 - \theta\_{normalized} \cdot k) $
|
||||
|
||||
with
|
||||
|
||||
- $v_{max}:$ Maximum speed
|
||||
- $v_{full throttle}:$ Speed at maximum throttle [RO_MAX_THR_SPEED](../advanced_config/parameter_reference.md#RO_MAX_THR_SPEED).
|
||||
- $\theta_{normalized}:$ Course error (Course - bearing setpoint) normalized from $[0\degree, 180\degree]$ to $[0, 1]$
|
||||
- $k:$ Tuning parameter [RO_SPEED_RED](#RO_SPEED_RED)
|
||||
|
||||
::: info
|
||||
This parameter is used to calculate the speed at which the vehicle arrives at a waypoint based on the upcoming corner.
|
||||
Set to -1 to disable course error based speed reduction.
|
||||
:::
|
||||
|
||||
2. (Optional) [RO_DECEL_LIM](../advanced_config/parameter_reference.md#RO_DECEL_LIM) [m/s^2] and [RO_JERK_LIM](../advanced_config/parameter_reference.md#RO_JERK_LIM) [m/s^3] are used to calculate a speed trajectory such that the rover reaches the next waypoint with the calculated cornering speed.
|
||||
|
||||
::: tip
|
||||
Plan a mission for the rover to drive a square and observe how it slows down when approaching a waypoint:
|
||||
|
||||
- If the rover decelerates too quickly decrease the [RO_DECEL_LIM](../advanced_config/parameter_reference.md#RO_DECEL_LIM) parameter, if it starts slowing down too early increase the parameter.
|
||||
- If you observe a jerking motion as the rover slows down, decrease the [RO_JERK_LIM](../advanced_config/parameter_reference.md#RO_JERK_LIM) parameter otherwise increase it as much as possible as it can interfere with the tuning of [RO_DECEL_LIM](../advanced_config/parameter_reference.md#RO_DECEL_LIM).
|
||||
|
||||
These two parameters have to be tuned as a pair, repeat until you are satisfied with the behaviour.
|
||||
:::
|
||||
|
||||
3. Plot the `adjusted_speed_body_x_setpoint` and `measured_speed_body_x` from the [RoverVelocityStatus](../msg_docs/RoverVelocityStatus.md) message over each other.
|
||||
If the tracking of these setpoints is not satisfactory adjust the values for [RO_SPEED_P](../advanced_config/parameter_reference.md#RO_SPEED_P) and [RO_SPEED_I](../advanced_config/parameter_reference.md#RO_SPEED_I).
|
||||
|
||||
## Path Following
|
||||
|
||||
The [pure pursuit](#pure-pursuit-guidance-logic-info-only) algorithm is used to calculate a bearing setpoint for the vehicle that is then close loop controlled.
|
||||
|
||||
The following parameters are used to tune the algorithm:
|
||||
|
||||
1. [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN): When driving in a straight line (right stick centered) position mode leverages the same path following algorithm used in [auto modes](../flight_modes_rover/auto.md) called [pure pursuit](#pure-pursuit-guidance-logic-info-only) to achieve the best possible straight line driving behaviour.
|
||||
This parameter determines how aggressive the controller will steer towards the path.
|
||||
|
||||
::: tip
|
||||
Decreasing the parameter makes it more aggressive but can lead to oscillations.
|
||||
|
||||
To tune this:
|
||||
|
||||
1. Start with a value of 1 for [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN)
|
||||
2. Put the rover in [Position mode](../flight_modes_rover/manual.md#position-mode) and while driving a straight line at approximately half the maximum speed observe its behaviour.
|
||||
3. If the rover does not drive in a straight line, reduce the value of the parameter, if it oscillates around the path increase the value.
|
||||
4. Repeat until you are satisfied with the behaviour.
|
||||
|
||||
:::
|
||||
|
||||
2. [PP_LOOKAHD_MIN](#PP_LOOKAHD_MIN): Minimum threshold for the lookahead distance used by the [pure pursuit algorithm](#pure-pursuit-guidance-logic-info-only).
|
||||
|
||||
::: tip
|
||||
Put the rover in [Position mode](../flight_modes_rover/manual.md#position-mode) and drive at very low speeds, if the rover starts to oscillate even though the tuning of [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN) was good for medium speeds, then increase the value of [PP_LOOKAHD_MIN](#PP_LOOKAHD_MIN).
|
||||
:::
|
||||
|
||||
3. [PP_LOOKAHD_MAX](#PP_LOOKAHD_MAX): Maximum threshold for the lookahead distance used by [pure pursuit](#pure-pursuit-guidance-logic-info-only).
|
||||
|
||||
::: tip
|
||||
Put the rover in [Position mode](../flight_modes_rover/manual.md#position-mode) and drive at very high speeds, if the rover does not drive in a straight line even though the tuning of [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN) was good for medium speeds, then decrease the value of [PP_LOOKAHD_MAX](#PP_LOOKAHD_MAX).
|
||||
:::
|
||||
|
||||
During any auto navigation task observe the behaviour of the rover and if you are unsatisfied with the path following, there are 2 steps to take:
|
||||
|
||||
1. Check if all the setpoints ([rate](rate_tuning.md), [attitude](attitude_tuning.md) and [velocity](velocity_tuning.md)) are properly tracked.
|
||||
2. Further tune the [path following algorithm](#path-following).
|
||||
|
||||
## Ackermann Rover Only
|
||||
|
||||
Ackermann rovers employ a special cornering logic causing the rover to "cut corners" to achieve a smooth trajectory.
|
||||
This is done by scaling the acceptance radius based on the corner the rover has to drive (for geometric explanation see [Cornering logic](#corner-cutting-logic-info-only)).
|
||||
|
||||

|
||||
|
||||
The degree to which corner cutting is allowed can be tuned, or disabled, with the following parameters:
|
||||
|
||||
::: info
|
||||
The corner cutting effect is a tradeoff between how close you get to the waypoint and the smoothness of the trajectory.
|
||||
:::
|
||||
|
||||
1. [NAV_ACC_RAD](../advanced_config/parameter_reference.md#NAV_ACC_RAD) [m]: Default acceptance radius
|
||||
This is also used as a lower bound for the acceptance radius scaling.
|
||||
2. [RA_ACC_RAD_MAX](#RA_ACC_RAD_MAX) [m]: The maximum the acceptance radius can be scaled to.
|
||||
Set equal to [NAV_ACC_RAD](../advanced_config/parameter_reference.md#NAV_ACC_RAD) to disable the corner cutting effect.
|
||||
3. [RA_ACC_RAD_GAIN](#RA_ACC_RAD_GAIN) [-]: This tuning parameter is a multiplicand on the [calculated ideal acceptance radius](#corner-cutting-logic-info-only) to account for dynamic effects.
|
||||
|
||||
:::tip
|
||||
Initially set this parameter to `1`.
|
||||
If you observe the rover overshooting the corner, increase this parameter until you are satisfied with the behaviour.
|
||||
Note that the scaling of the acceptance radius is limited by [RA_ACC_RAD_MAX](#RA_ACC_RAD_MAX).
|
||||
:::
|
||||
|
||||
### Corner Cutting Logic (Info only)
|
||||
|
||||
To enable a smooth trajectory, the acceptance radius of waypoints is scaled based on the angle between a line segment from the current-to-previous and current-to-next waypoints.
|
||||
The ideal trajectory would be to arrive at the next line segment with the heading pointing towards the next waypoint.
|
||||
For this purpose the minimum turning circle of the rover is inscribed tangentially to both line segments.
|
||||
|
||||

|
||||
|
||||
The acceptance radius of the waypoint is set to the distance from the waypoint to the tangential points between the circle and the line segments:
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
r_{min} &= \frac{L}{\sin\left( \delta_{max}\right) } \\
|
||||
\theta &= \frac{1}{2}\arccos\left( \frac{\vec{a}*\vec{b}}{|\vec{a}||\vec{b}|}\right) \\
|
||||
r_{acc} &= \frac{r_{min}}{\tan\left( \theta\right) }
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
| Symbol | Description | Unit |
|
||||
| -------------- | ---------------------------------- | ---- |
|
||||
| $\vec{a}$ | Vector from current to previous WP | m |
|
||||
| $\vec{b}$ | Vector from current to next WP | m |
|
||||
| $r_{min}$ | Minimum turn radius | m |
|
||||
| $\delta_{max}$ | Maximum steer angle | m |
|
||||
| $r_{acc}$ | Acceptance radius | m |
|
||||
|
||||
## Differential Rover Only
|
||||
|
||||
Differential rovers employ the following state machine to make full use of a differential rovers ability to turn on the spot:
|
||||
|
||||

|
||||
|
||||
These transition thresholds can be set with [RD_TRANS_DRV_TRN](#RD_TRANS_DRV_TRN) and [RD_TRANS_TRN_DRV](#RD_TRANS_TRN_DRV).
|
||||
|
||||
In mission modes [RD_TRANS_DRV_TRN](#RD_TRANS_DRV_TRN) is also used to slow down the rover to a standstill, if the transition angle between the waypoints exceeds this threshold:
|
||||
|
||||

|
||||
|
||||
## Pure Pursuit Guidance Logic (Info Only)
|
||||
|
||||
The desired bearing setpoints are generated using the pure pursuit algorithm.
|
||||
|
||||
The controller takes the intersection point between a circle around the vehicle and a line segment.
|
||||
When targeting a position setpoint this line is constructed from the current position to the destination or when executing a mission it is usually constructed by connecting the previous and current waypoint.
|
||||
|
||||

|
||||
|
||||
The radius of the circle around the vehicle is used to tune the controller and is often referred to as look-ahead distance.
|
||||
|
||||
The look-ahead distance sets how aggressive the controller behaves and is defined as $l_d = v \cdot k$.
|
||||
It depends on the velocity $v$ of the rover and a tuning parameter $k$ that can be set with the parameter [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN).
|
||||
|
||||
::: info
|
||||
A lower value of [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN) makes the controller more aggressive but can lead to oscillations!
|
||||
:::
|
||||
|
||||
The lookahead is constrained between [PP_LOOKAHD_MAX](#PP_LOOKAHD_MAX) and [PP_LOOKAHD_MIN](#PP_LOOKAHD_MIN).
|
||||
|
||||
If the distance from the path to the rover is bigger than the lookahead distance, the rover will target the point on the path that is closest to the rover.
|
||||
|
||||
## Position Controller Structure (Info Only)
|
||||
|
||||
This section provides additional information for developers and people with experience in control system design.
|
||||
|
||||
The position controller uses the following structure:
|
||||
|
||||

|
||||
|
||||
## Parameter Overview
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ---- |
|
||||
| <a id="RO_SPEED_RED"></a>[RO_SPEED_RED](../advanced_config/parameter_reference.md#RO_SPEED_RED) | (Optional) Tuning parameter for the speed reduction based on the course error | - |
|
||||
| <a id="PP_LOOKAHD_GAIN"></a>[PP_LOOKAHD_GAIN](../advanced_config/parameter_reference.md#PP_LOOKAHD_GAIN) | Pure pursuit: Main tuning parameter | - |
|
||||
| <a id="PP_LOOKAHD_MAX"></a>[PP_LOOKAHD_MAX](../advanced_config/parameter_reference.md#PP_LOOKAHD_MAX) | Pure pursuit: Maximum value for the look ahead radius | m |
|
||||
| <a id="PP_LOOKAHD_MIN"></a>[PP_LOOKAHD_MIN](../advanced_config/parameter_reference.md#PP_LOOKAHD_MIN) | Pure pursuit: Minimum value for the look ahead radius | m |
|
||||
|
||||
## Ackermann Specific
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ---- |
|
||||
| <a id="RA_ACC_RAD_MAX"></a>[RA_ACC_RAD_MAX](../advanced_config/parameter_reference.md#RA_ACC_RAD_MAX) | (Optional) Maximum radius the acceptance radius can be scaled to | m |
|
||||
| <a id="RA_ACC_RAD_GAIN"></a>[RA_ACC_RAD_GAIN](../advanced_config/parameter_reference.md#RA_ACC_RAD_GAIN) | (Optional) Tuning parameter for the acceptance radius scaling | - |
|
||||
|
||||
## Differential Specific
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | ---- |
|
||||
| <a id="RD_TRANS_DRV_TRN"></a>[RD_TRANS_DRV_TRN](../advanced_config/parameter_reference.md#RD_TRANS_DRV_TRN) | Heading error threshold to switch from driving to spot turning | deg |
|
||||
| <a id="RD_TRANS_TRN_DRV"></a>[RD_TRANS_TRN_DRV](../advanced_config/parameter_reference.md#RD_TRANS_TRN_DRV) | Heading error threshold to switch from spot turning to driving | deg |
|
||||
@@ -0,0 +1,140 @@
|
||||
# Rate Tuning
|
||||
|
||||
Rate tuning is required to use [Acro mode](../flight_modes_rover/manual.md#acro-mode) and all later modes.
|
||||
|
||||
::: warning
|
||||
The [Basic Setup](basic_setup.md) must've already been completed before this step!
|
||||
:::
|
||||
|
||||
Configure the following [parameters](../advanced_config/parameters.md) in QGroundControl:
|
||||
|
||||
1. [RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM): Maximum yaw rate you want to allow for your rover.
|
||||
|
||||
:::tip
|
||||
Limiting the yaw rate is necessary if the rover is prone rolling over, loosing traction at high speeds or if passenger comfort is important.
|
||||
Small rovers especially can be prone to rolling over when steering aggressively at high speeds.
|
||||
|
||||
If this is the case:
|
||||
|
||||
1. In [Acro mode](../flight_modes_rover/manual.md#acro-mode), set [RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM) to a small value, drive the rover at full throttle and steer all the way to the left or right.
|
||||
2. Increase [RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM) until the wheels of the rover start to lift up.
|
||||
3. Set [RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM) to the highest value that does not cause the rover to lift up.
|
||||
|
||||
If you see no need to limit the yaw rate, set this parameter to the maximum yaw rate the rover can achieve:
|
||||
|
||||
1. In [Manual mode](../flight_modes_rover/manual.md#manual-mode) drive the rover at full throttle and with the maximum steering angle.
|
||||
2. Plot the `measured_yaw_rate` from [RoverRateStatus](../msg_docs/RoverRateStatus.md) and enter the highest observed value for [RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM).
|
||||
|
||||
:::
|
||||
|
||||
2. (Optional) [RO_YAW_RATE_CORR](#RO_YAW_RATE_CORR) [-]: Yaw rate correction factor.
|
||||
|
||||
This can be used to scale the mapping from the yaw rate setpoint to the steering effort if it is offset from the [idealized mapping](#kinematic-models) (This could be due to wheel misalignments, excessive friction etc.).
|
||||
|
||||
::: info
|
||||
Skid/tank-steered and mecanum rovers will most likely require this adjustment.
|
||||
:::
|
||||
|
||||
:::tip
|
||||
To tune this parameter, first make sure you set [RO_YAW_RATE_P](#RO_YAW_RATE_P) and [RO_YAW_RATE_I](#RO_YAW_RATE_I) to zero.
|
||||
This way the yaw rate is only controlled by the feed-forward term, which makes it easier to tune.
|
||||
Now put the rover in [Acro mode](../flight_modes_rover/manual.md#acro-mode) and then move the right-stick of your controller to the right and/or left and hold it at a few different levels for a couple of seconds each while driving with a constant throttle (for differential/mecanum rovers this can also be done while standing still).
|
||||
Disarm the rover and from the flight log plot the `adjusted_yaw_rate_setpoint` from [RoverRateStatus](../msg_docs/RoverRateStatus.md) and the `measured_yaw_rate` from [RoverRateStatus](../msg_docs/RoverRateStatus.md) over each other.
|
||||
If the actual yaw rate of the rover is higher than the yaw rate setpoint, decrease [RO_YAW_RATE_CORR](#RO_YAW_RATE_CORR) (between [0, 1]).
|
||||
If it is the other way around increase the parameter [1, inf] and repeat until you are satisfied with the setpoint tracking.
|
||||
:::
|
||||
|
||||
3. [RO_YAW_RATE_P](#RO_YAW_RATE_P) [-]: Proportional gain of the closed loop yaw rate controller.
|
||||
The closed loop acceleration control will compare the yaw rate setpoint with the measured yaw rate and adapt the motor commands based on the error between them.
|
||||
The proportional gain is multiplied with this error and that value is added to the motor command.
|
||||
This compensates for disturbances such as uneven ground and external forces.
|
||||
|
||||
:::tip
|
||||
To tune this parameter:
|
||||
|
||||
1. Put the rover in [Acro mode](../flight_modes_rover/manual.md#acro-mode) and hold the throttle stick and the right stick at a few different levels for a couple of seconds each.
|
||||
1. Disarm the rover and from the flight log plot the `adjusted_yaw_rate_setpoint` and the `measured_yaw_rate` from [RoverRateStatus](../msg_docs/RoverRateStatus.md) over each other.
|
||||
1. Increase [RO_YAW_RATE_P](#RO_YAW_RATE_P) if the measured value does not track the setpoint fast enough or decrease it if the measurement overshoots the setpoint by too much.
|
||||
1. Repeat until you are satisfied with the behaviour.
|
||||
:::
|
||||
|
||||
4. [RO_YAW_RATE_I](#RO_YAW_RATE_I) [-]: Integral gain of the closed loop yaw rate controller.
|
||||
The integral gain accumulates the error between the desired and actual yaw rate scaled by the integral gain over time and that value is added to the motor command.
|
||||
|
||||
::: tip
|
||||
An integrator might not be necessary at this stage, but it will become important for subsequent modes.
|
||||
:::
|
||||
|
||||
5. (Optional) [RO_YAW_ACCEL_LIM](#RO_YAW_ACCEL_LIM)/[RO_YAW_DECEL_LIM](#RO_YAW_DECEL_LIM) [deg/s^2]: Used to limit the yaw acceleration/deceleration.
|
||||
This can be used to smoothen the yaw rate setpoint trajectory.
|
||||
|
||||
6. (Optional) [RO_YAW_STICK_DZ](#RO_YAW_STICK_DZ) [-]: Percentage of yaw stick input range that will be interpreted as zero around the stick centered value.
|
||||
|
||||
7. (Advanced) [RO_YAW_RATE_TH](#RO_YAW_RATE_TH) [deg/s]: The minimum threshold for the yaw rate measurement not to be interpreted as zero.
|
||||
This can be used to cut off measurement noise when the rover is standing still.
|
||||
|
||||
The rover is now ready to drive in [Acro mode](../flight_modes_rover/manual.md#acro-mode) and the configuration can be continued with [attitude tuning](attitude_tuning.md).
|
||||
|
||||
## Rate Controller Structure (Info Only)
|
||||
|
||||
This section provides additional information for developers and people with experience in control system design.
|
||||
|
||||
The rate controller uses the following structure:
|
||||
|
||||

|
||||
|
||||
::: info
|
||||
For ackermann rovers the yaw rate is only close loop controlled when driving forwards.
|
||||
When driving backwards the yaw rate setpoint is directly mapped to a steering angle using the equation above.
|
||||
This is due to the fact that rear wheel steering (driving a car with front-wheel steering backwards) is non-minimum-phase w.r.t to the yaw rate which leads to instabilities when doing closed loop control.
|
||||
:::
|
||||
|
||||
The feed forward mapping is done using the kinematic model of the rover to translate the yaw rate setpoint to a normalized steering setpoint.
|
||||
|
||||
### Kinematic Models
|
||||
|
||||
#### Ackermann
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
$$ \delta = \arctan(\frac{w_b \cdot \dot{\psi}}{v}) $$
|
||||
|
||||
with
|
||||
|
||||
- $w_b:$ Wheel base,
|
||||
- $\delta:$ Steering angle,
|
||||
- $\dot{\psi}:$ Yaw rate
|
||||
- $v:$ Forward speed.
|
||||
|
||||
The steering setpoint is equal to $\delta$ interpolated from [-[RA_MAX_STR_ANG](../advanced_config/parameter_reference.md#RA_MAX_STR_ANG), [RA_MAX_STR_ANG](../advanced_config/parameter_reference.md#RA_MAX_STR_ANG)] to [-1, 1].
|
||||
|
||||
For driving this means that the same right hand stick input will cause a different steering angle based on how fast you are driving.
|
||||
By limiting the maximum yaw rate, we can restrict the steering angle based on the speed, which can prevent the rover from rolling over.
|
||||
This mode will feel more like "driving a car" than [Manual mode](../flight_modes_rover/manual.md#manual-mode).
|
||||
|
||||
#### Differential/Mecanum
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
$$ v_{diff} = \frac{w_t \cdot \dot{\psi}}{2} $$
|
||||
|
||||
with
|
||||
|
||||
- $v_{diff}:$ Speed difference between the right/left wheels,
|
||||
- $w_t:$ Wheel track ([RD_WHEEL_TRACK](../advanced_config/parameter_reference.md#RD_WHEEL_TRACK)),
|
||||
- $\dot{\psi}:$ Yaw rate setpoint
|
||||
|
||||
The steering setpoint is equal to $v_{diff}$ interpolated from [-[RO_MAX_THR_SPEED](../advanced_config/parameter_reference.md#RO_MAX_THR_SPEED), [RO_MAX_THR_SPEED](../advanced_config/parameter_reference.md#RO_MAX_THR_SPEED)] to [-1, 1].
|
||||
|
||||
These mappings based on the idealized kinematic models can be adjusted with the multiplicative factor [RO_YAW_RATE_CORR](../advanced_config/parameter_reference.md#RO_YAW_RATE_CORR) to tune the feed forward part of the yaw rate controller to account for wheel misalignments, high friction etc.
|
||||
|
||||
## Parameter Overview
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------- | --------- |
|
||||
| <a id="RO_YAW_RATE_LIM"></a>[RO_YAW_RATE_LIM](../advanced_config/parameter_reference.md#RO_YAW_RATE_LIM) | Maximum allowed yaw rate | $m/s^2$ |
|
||||
| <a id="RO_YAW_RATE_P"></a>[RO_YAW_RATE_P](../advanced_config/parameter_reference.md#RO_YAW_RATE_P) | Proportional gain for yaw rate controller | - |
|
||||
| <a id="RO_YAW_RATE_I"></a>[RO_YAW_RATE_I](../advanced_config/parameter_reference.md#RO_YAW_RATE_I) | Integral gain for yaw rate controller | - |
|
||||
| <a id="RO_YAW_STICK_DZ"></a>[RO_YAW_STICK_DZ](../advanced_config/parameter_reference.md#RO_YAW_STICK_DZ) | Yaw stick deadzone | - |
|
||||
| <a id="RO_YAW_ACCEL_LIM"></a>[RO_YAW_ACCEL_LIM](../advanced_config/parameter_reference.md#RO_YAW_ACCEL_LIM) | (Optional) Yaw acceleration limit | $deg/s^2$ |
|
||||
| <a id="RO_YAW_DECEL_LIM"></a>[RO_YAW_DECEL_LIM](../advanced_config/parameter_reference.md#RO_YAW_DECEL_LIM) | (Optional) Yaw deceleration limit | $deg/s^2$ |
|
||||
| <a id="RO_YAW_RATE_CORR"></a>[RO_YAW_RATE_CORR](../advanced_config/parameter_reference.md#RO_YAW_RATE_CORR) | (Optional) Yaw rate correction factor | - |
|
||||
| <a id="RO_YAW_RATE_TH"></a>[RO_YAW_RATE_TH](../advanced_config/parameter_reference.md#RO_YAW_RATE_TH) | (Advanced) Yaw rate measurement threshold | $deg/s$ |
|
||||
@@ -0,0 +1,125 @@
|
||||
# Velocity Tuning
|
||||
|
||||
:::warning
|
||||
The [attitude tuning](attitude_tuning.md) must've already been completed before this step!
|
||||
:::
|
||||
|
||||
::: info
|
||||
To tune we will be using the manual [Position mode](../flight_modes_rover/manual.md#position-mode).
|
||||
This mode requires a global position estimate (GPS) and tuning of some parameters that go beyond the velocity controller.
|
||||
If you use a custom external flight mode that controls velocity but does not require a global position estimate you can ignore the [manual position mode parameters](#manual-position-mode-parameters).
|
||||
:::
|
||||
|
||||
## Speed Parameters
|
||||
|
||||
To tune the velocity controller configure the following [parameters](../advanced_config/parameters.md) in QGroundControl:
|
||||
|
||||
1. [RO_SPEED_LIM](#RO_SPEED_LIM) [m/s]: This is the maximum speed you want to allow for your rover.
|
||||
This will define the stick-to-speed mapping for [Position mode](../flight_modes_rover/manual.md#position-mode) and set an upper limit for the speed setpoint.
|
||||
2. [RO_MAX_THR_SPEED](#RO_MAX_THR_SPEED) [m/s]: This parameter is used to calculate the feed-forward term of the closed loop speed control which linearly maps desired speeds to normalized motor commands.
|
||||
As mentioned in the [Manual mode](../flight_modes_rover/manual.md#manual-mode) configuration , a good starting point is the observed ground speed when the rover drives at maximum throttle in [Manual mode](../flight_modes_rover/manual.md#manual-mode).
|
||||
|
||||
<a id="RA_SPEED_TUNING"></a>
|
||||
|
||||
::: tip
|
||||
To further tune this parameter:
|
||||
|
||||
1. Set [RO_SPEED_P](#RO_SPEED_P) and [RO_SPEED_I](#RO_SPEED_I) to zero.
|
||||
This way the speed is only controlled by the feed-forward term, which makes it easier to tune.
|
||||
2. Put the rover in [Position mode](../flight_modes_rover/manual.md#position-mode) and then move the left stick of your controller up and/or down and hold it at a few different levels for a couple of seconds each.
|
||||
3. Disarm the rover and from the flight log plot the `adjusted_speed_body_x_setpoint` and the `measured_speed_body_x` from the [RoverVelocityStatus](../msg_docs/RoverVelocityStatus.md) message over each other.
|
||||
4. If the actual speed of the rover is higher than the speed setpoint, increase [RO_MAX_THR_SPEED](#RO_MAX_THR_SPEED).
|
||||
If it is the other way around decrease the parameter and repeat until you are satisfied with the setpoint tracking.
|
||||
|
||||
:::
|
||||
|
||||
::: info
|
||||
If your rover oscillates when driving a straight line in [Position mode](../flight_modes_rover/manual.md#position-mode), set this parameter to the observed ground speed at maximum throttle in [Manual mode](../flight_modes_rover/manual.md#manual-mode) and complete the tuning of the [manual position mode parameters](#manual-position-mode-parameters) first before continuing the tuning of the closed loop speed control.
|
||||
:::
|
||||
|
||||
3. [RO_SPEED_P](#RO_SPEED_P) [-]: Proportional gain of the closed loop speed controller.
|
||||
|
||||
::: tip
|
||||
This parameter can be tuned the same way as [RO_MAX_THR_SPEED](#RA_SPEED_TUNING).
|
||||
If you tuned [RO_MAX_THR_SPEED](#RO_MAX_THR_SPEED) well, you might only need a very small value.
|
||||
:::
|
||||
|
||||
4. [RO_SPEED_I](#RO_SPEED_I) [-]: Integral gain for the closed loop speed controller.
|
||||
|
||||
::: tip
|
||||
For the closed loop speed control an integrator gain is useful because this setpoint is often constant for a while and an integrator eliminates steady state errors that can cause the rover to never reach the setpoint.
|
||||
:::
|
||||
|
||||
5. (Advanced) [RO_SPEED_TH](#RO_SPEED_TH) [m/s]: The minimum threshold for the speed measurement not to be interpreted as zero.
|
||||
This can be used to cut off measurement noise when the rover is standing still.
|
||||
|
||||
## Manual Position Mode Parameters
|
||||
|
||||
These steps are only necessary if you are tuning/want to unlock the manual [Position mode](../flight_modes_rover/manual.md#position-mode). Othwerwise, you can continue with [position tuning](position_tuning.md) where these same parameters will also be configured.
|
||||
|
||||
1. [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN): When driving in a straight line (right stick centered) position mode leverages the same path following algorithm used in [auto modes](../flight_modes_rover/auto.md) called [pure pursuit](position_tuning.md#pure-pursuit-guidance-logic-info-only) to achieve the best possible straight line driving behaviour.
|
||||
This parameter determines how aggressive the controller will steer towards the path.
|
||||
|
||||
::: tip
|
||||
Decreasing the parameter makes it more aggressive but can lead to oscillations.
|
||||
|
||||
To tune this:
|
||||
|
||||
1. Start with a value of 1 for [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN)
|
||||
2. Put the rover in [Position mode](../flight_modes_rover/manual.md#position-mode) and while driving a straight line at approximately half the maximum speed observe its behaviour.
|
||||
3. If the rover does not drive in a straight line, reduce the value of the parameter, if it oscillates around the path increase the value.
|
||||
4. Repeat until you are satisfied with the behaviour.
|
||||
|
||||
:::
|
||||
|
||||
2. [PP_LOOKAHD_MIN](#PP_LOOKAHD_MIN): Minimum threshold for the lookahead distance used by the [pure pursuit algorithm](position_tuning.md#pure-pursuit-guidance-logic-info-only).
|
||||
|
||||
::: tip
|
||||
Put the rover in [Position mode](../flight_modes_rover/manual.md#position-mode) and drive at very low speeds, if the rover starts to oscillate even though the tuning of [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN) was good for medium speeds, then increase the value of [PP_LOOKAHD_MIN](#PP_LOOKAHD_MIN).
|
||||
:::
|
||||
|
||||
3. [PP_LOOKAHD_MAX](#PP_LOOKAHD_MAX): Maximum threshold for the lookahead distance used by [pure pursuit](position_tuning.md#pure-pursuit-guidance-logic-info-only).
|
||||
|
||||
::: tip
|
||||
Put the rover in [Position mode](../flight_modes_rover/manual.md#position-mode) and drive at very high speeds, if the rover does not drive in a straight line even though the tuning of [PP_LOOKAHD_GAIN](#PP_LOOKAHD_GAIN) was good for medium speeds, then decrease the value of [PP_LOOKAHD_MAX](#PP_LOOKAHD_MAX).
|
||||
:::
|
||||
|
||||
The rover is now ready to drive in [Position mode](../flight_modes_rover/manual.md#position-mode) and the configuration can be continued with [position tuning](position_tuning.md).
|
||||
|
||||
## Attitude Controller Structure (Info Only)
|
||||
|
||||
This section provides additional information for developers and people with experience in control system design.
|
||||
|
||||
The velocity vector is defined by the following two values:
|
||||
|
||||
1. The absolute speed [$m/s$]
|
||||
2. The direction (bearing) [$rad$]
|
||||
|
||||
The speed controller uses the following structure:
|
||||
|
||||

|
||||
|
||||
The feed forward mapping is done by interpolating the speed setpoint from [-[RO_MAX_THR_SPEED](../advanced_config/parameter_reference.md#RO_MAX_THR_SPEED), [RO_MAX_THR_SPEED](../advanced_config/parameter_reference.md#RO_MAX_THR_SPEED)] to [-1, 1].
|
||||
|
||||
For ackermann and differential rovers the bearing is aligned with the vehicle yaw. Therefor the bearing is simply sent as a yaw setpoint to the [yaw controller](attitude_tuning.md#attitude-controller-structure-info-only) and the speed setpoint is always defined in body x direction.
|
||||
|
||||
For mecanum vehicles, the bearing and yaw are decoupled. The direction is controlled by splitting the velocity vector into one speed component in body x direction and one in body y direction.
|
||||
Both these setpoint are then sent to their own closed loop speed controllers.
|
||||
|
||||
## Parameter Overview
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------ | ----- |
|
||||
| <a id="RO_MAX_THR_SPEED"></a>[RO_MAX_THR_SPEED](../advanced_config/parameter_reference.md#RO_MAX_THR_SPEED) | Speed the rover drives at maximum throttle | $m/s$ |
|
||||
| <a id="RO_SPEED_LIM"></a>[RO_SPEED_LIM](../advanced_config/parameter_reference.md#RO_SPEED_LIM) | Maximum allowed speed | $m/s$ |
|
||||
| <a id="RO_SPEED_P"></a>[RO_SPEED_P](../advanced_config/parameter_reference.md#RO_SPEED_P) | Proportional gain for speed controller | - |
|
||||
| <a id="RO_SPEED_I"></a>[RO_SPEED_I](../advanced_config/parameter_reference.md#RO_SPEED_I) | Integral gain for speed controller | - |
|
||||
| <a id="RO_SPEED_TH"></a>[RO_SPEED_TH](../advanced_config/parameter_reference.md#RO_SPEED_TH) | (Advanced) Speed measurement threshold | $m/s$ |
|
||||
|
||||
### Pure Pursuit
|
||||
|
||||
| Parameter | Description | Unit |
|
||||
| -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | ---- |
|
||||
| <a id="PP_LOOKAHD_GAIN"></a>[PP_LOOKAHD_GAIN](../advanced_config/parameter_reference.md#PP_LOOKAHD_GAIN) | Pure pursuit: Main tuning parameter | - |
|
||||
| <a id="PP_LOOKAHD_MAX"></a>[PP_LOOKAHD_MAX](../advanced_config/parameter_reference.md#PP_LOOKAHD_MAX) | Pure pursuit: Maximum value for the look ahead radius | m |
|
||||
| <a id="PP_LOOKAHD_MIN"></a>[PP_LOOKAHD_MIN](../advanced_config/parameter_reference.md#PP_LOOKAHD_MIN) | Pure pursuit: Minimum value for the look ahead radius | m |
|
||||
@@ -7,8 +7,7 @@ For information about flight modes available to specific frames see the followin
|
||||
- [Flight Modes (Multicopter)](../flight_modes_mc/index.md)
|
||||
- [Flight Modes (Fixed-Wing)](../flight_modes_fw/index.md)
|
||||
- [Flight Modes (VTOL)](../flight_modes_vtol/index.md)
|
||||
- [Drive Modes (Differential Rover)](../flight_modes_rover/differential.md)
|
||||
- [Drive Modes (Ackermann Rover)](../flight_modes_rover/ackermann.md)
|
||||
- [Drive Modes (Rover)](../flight_modes_rover/index.md)
|
||||
|
||||
::: info
|
||||
The mode sub-topics in this section contain information that is common to all vehicles, but may not be relevant to the normal/default setup.
|
||||
|
||||
@@ -55,5 +55,4 @@ Select the mode-specific sidebar topics for detailed technical information.
|
||||
- [Basic Configuration > Flight Modes](../config/flight_mode.md) - How to map RC control switches to specific flight modes
|
||||
- [Flight Modes (Multicopter)](../flight_modes_mc/index.md)
|
||||
- [Flight Modes (VTOL)](../flight_modes_vtol/index.md)
|
||||
- [Drive Modes (Differential Rover)](../flight_modes_rover/differential.md)
|
||||
- [Drive Modes (Ackermann Rover)](../flight_modes_rover/ackermann.md)
|
||||
- [Drive Modes (Rover)](../flight_modes_rover/index.md)
|
||||
@@ -53,5 +53,5 @@ Select the mode-specific sidebar topics for more detailed technical information.
|
||||
- [Basic Configuration > Flight Modes](../config/flight_mode.md) - How to map RC control switches to specific flight modes
|
||||
- [Flight Modes (Fixed-Wing)](../flight_modes_fw/index.md)
|
||||
- [Flight Modes (VTOL)](../flight_modes_vtol/index.md)
|
||||
- [Drive Modes (Differential Rover)](../flight_modes_rover/differential.md)
|
||||
- [Drive Modes (Ackermann Rover)](../flight_modes_rover/ackermann.md)
|
||||
- [Drive Modes (Rover)](../flight_modes_rover/index.md)
|
||||
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
# Drive Modes (Ackermann Rover)
|
||||
|
||||
Flight modes (or more accurately "Drive modes" for ground vehicles) provide autopilot support to make it easier to manually drive the vehicle or to execute autonomous missions.
|
||||
|
||||
This section outlines all supported drive modes for [Ackermann rovers](../frames_rover/ackermann.md).
|
||||
|
||||
For information on mapping RC control switches to specific modes see: [Basic Configuration > Flight Modes](../config/flight_mode.md).
|
||||
|
||||
::: warning
|
||||
Selecting any other mode than those listed below will either stop the rover or can lead to undefined behaviour.
|
||||
:::
|
||||
|
||||
## Manual Modes
|
||||
|
||||
Manual modes require stick inputs from the user to drive the vehicle.
|
||||
|
||||

|
||||
|
||||
The sticks provide the same "high level" control effects over direction and rate of movement in all manual modes:
|
||||
|
||||
- `Left stick up/down`: Drive the rover forwards/backwards (controlling speed)
|
||||
- `Right stick left/right`: Make a left/right turn (controlling steering angle ([Manual mode](#manual-mode)) or yaw rate ([Acro](#acro-mode) and [Position](#position-mode))).
|
||||
|
||||
The manual modes provide progressively increasing levels of autopilot support for maintaining a course, speed, and rate of turn, compensating for external factors such as slopes or uneven terrain.
|
||||
|
||||
| Mode | Features |
|
||||
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Manual](#manual-mode) | No autopilot support. User is responsible for keeping the rover on the desired course and maintaining speed and rate of turn. |
|
||||
| [Acro](#acro-mode) | + Maintains the yaw rate (This makes it feel more like driving a car than manual mode). <br>+ Allows maximum yaw rate to be limited (Protects against roll over). |
|
||||
| [Position](#position-mode) | + Maintains the course (Best mode for driving a straight line).<br>+ Maintains speed against disturbances, e.g. when driving up a hill.<br>+ Allows maximum speed to be limited. |
|
||||
|
||||
::: details Overview mode mapping to control effect
|
||||
|
||||
| Mode | Forward/backwards speed | Steering angle/yaw rate | Required measurements |
|
||||
| -------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
|
||||
| [Manual](#manual-mode) | Directly map stick input to motor command. | Directly map stick input to steering angle. | None. |
|
||||
| [Acro](#acro-mode) | Directly map stick input to motor command. | Stick input creates a yaw rate setpoint for the control system to regulate. | yaw rate. |
|
||||
| [Position](#position-mode) | Stick input creates a speed setpoint for the control system to regulate. | Stick input creates a yaw rate setpoint for the control system to regulate. If this setpoint is zero (stick is centered) the control system will keep the rover driving in a straight line. | yaw rate, yaw, speed and global position (GPS). |
|
||||
|
||||
:::
|
||||
|
||||
### Manual Mode
|
||||
|
||||
In this mode the stick inputs are directly mapped to motor commands.
|
||||
The rover does not attempt to maintain a specific orientation or compensate for external factors like slopes or uneven terrain!
|
||||
The user is responsible for making the necessary adjustments to the stick inputs to keep the rover on the desired course.
|
||||
|
||||
| Stick | Effect |
|
||||
| ---------------------- | ------------------------------------------ |
|
||||
| Left stick up/down | Drive the rover forwards/backwards. |
|
||||
| Right stick left/right | Move the steering angle to the left/right. |
|
||||
|
||||
For the configuration/tuning of this mode see [Manual mode](../config_rover/ackermann.md#manual-mode).
|
||||
|
||||
### Acro Mode
|
||||
|
||||
::: info
|
||||
This mode requires a yaw rate measurement.
|
||||
:::
|
||||
|
||||
In this mode the vehicle regulates its yaw rate to a setpoint (but does not stabilize heading or regulate speed).
|
||||
|
||||
Yaw rate can be directly mapped to a steering input based on the forward speed of the rover:
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
$$ \delta = \arctan(\frac{w_b \cdot \dot{\psi}}{v}) $$
|
||||
|
||||
with
|
||||
|
||||
- $w_b:$ Wheel base,
|
||||
- $\delta:$ Steering angle,
|
||||
- $\dot{\psi}:$ Yaw rate
|
||||
- $v:$ Forward speed.
|
||||
|
||||
For driving this means that the same right hand stick input will cause a different steering angle based on how fast you are driving.
|
||||
By limiting the maximum yaw rate, we can restrict the steering angle based on the speed, which can prevent the rover from rolling over.
|
||||
This mode will feel more like "driving a car" than [Manual mode](#manual-mode).
|
||||
|
||||
::: info
|
||||
The yaw rate is only close loop controlled when driving forwards.
|
||||
When driving backwards the yaw rate setpoint is directly mapped to a steering angle using the equation above.
|
||||
This is due to the fact that rear wheel steering (driving a car with front-wheel steering backwards) is non-minimum-phase w.r.t to the yaw rate which leads to instabilities when doing closed loop control.
|
||||
:::
|
||||
|
||||
| Stick | Effect |
|
||||
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Left stick up/down | Drive the rover forwards/backwards. |
|
||||
| Right stick left/right | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will attempt to maintain a zero yaw rate (minimal disturbance rejection) |
|
||||
|
||||
For the configuration/tuning of this mode see [Acro mode](../config_rover/ackermann.md#acro-mode).
|
||||
|
||||
### Stabilized Mode
|
||||
|
||||
::: info
|
||||
This mode requires a yaw rate and yaw estimate.
|
||||
:::
|
||||
|
||||
In this mode the vehicle regulates its yaw rate to a setpoint and will maintain its heading if this setpoint is zero (but does not regulate speed).
|
||||
Compared to [Acro mode](#acro-mode), this mode is much better at driving in a straight line as it can more effectively reject disturbances.
|
||||
|
||||
| Stick | Effect |
|
||||
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Left stick up/down | Drive the rover forwards/backwards. |
|
||||
| Right stick left/right | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will maintain the current yaw. |
|
||||
|
||||
For the configuration/tuning of this mode see [Stabilized mode](../config_rover/ackermann.md#stabilized-mode).
|
||||
|
||||
### Position Mode
|
||||
|
||||
::: info
|
||||
This mode requires a yaw rate, yaw, speed and global position estimate.
|
||||
:::
|
||||
|
||||
This is the manual mode with the most autopilot support.
|
||||
The vehicle regulates its yaw rate and speed to a setpoint.
|
||||
If the yaw rate setpoint is zero, the controller will remember the GPS coordinates and yaw (heading) of the vehicle and use those to construct a line that the rover will then follow (course control).
|
||||
This offers the highest amount of disturbance rejection, which leads to the best straight line driving behavior.
|
||||
|
||||
| Stick | Effect |
|
||||
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Left stick up/down | Stick position sets a forward/back speed setpoint. The vehicle attempts to maintain this speed on slopes etc. |
|
||||
| Right stick left/right | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will maintain the course of the rover. |
|
||||
|
||||
For the configuration/tuning of this mode see [Position mode](../config_rover/ackermann.md#position-mode).
|
||||
|
||||
## Auto Modes
|
||||
|
||||
In auto modes the autopilot takes over control of the vehicle to run missions, return to launch, or perform other autonomous navigation tasks.
|
||||
For the tuning process see the configuration for [Auto modes](../config_rover/ackermann.md#auto-modes).
|
||||
|
||||
### Mission Mode
|
||||
|
||||
_Mission mode_ is an automatic mode that causes the vehicle to execute a predefined autonomous [mission plan](../flying/missions.md) that has been uploaded to the flight controller.
|
||||
The mission is typically created and uploaded with a Ground Control Station (GCS) application, such as [QGroundControl](https://docs.qgroundcontrol.com/master/en/).
|
||||
|
||||
#### Mission commands
|
||||
|
||||
The following commands can be used in missions at time of writing (PX4 v1.16):
|
||||
|
||||
| QGC mission item | Command | Description |
|
||||
| ------------------- | ------------------------------------------------------------ | ------------------------------------------------- |
|
||||
| Mission start | [MAV_CMD_MISSION_START](MAV_CMD_MISSION_START) | Starts the mission. |
|
||||
| Waypoint | [MAV_CMD_NAV_WAYPOINT](MAV_CMD_NAV_WAYPOINT) | Navigate to waypoint. |
|
||||
| Return to launch | [MAV_CMD_NAV_RETURN_TO_LAUNCH][MAV_CMD_NAV_RETURN_TO_LAUNCH] | Return to the launch location. |
|
||||
| Change speed | [MAV_CMD_DO_CHANGE_SPEED][MAV_CMD_DO_CHANGE_SPEED] | Change the speed setpoint |
|
||||
| Set launch location | [MAV_CMD_DO_SET_HOME](MAV_CMD_DO_SET_HOME) | Changes launch location to specified coordinates. |
|
||||
| Jump to item (all) | [MAV_CMD_DO_JUMP][MAV_CMD_DO_JUMP] (and other jump commands) | Jump to specified mission item. |
|
||||
|
||||
[MAV_CMD_MISSION_START]: https://mavlink.io/en/messages/common.html#MAV_CMD_MISSION_START
|
||||
[MAV_CMD_NAV_WAYPOINT]: https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_WAYPOINT
|
||||
[MAV_CMD_NAV_RETURN_TO_LAUNCH]: https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_RETURN_TO_LAUNCH
|
||||
[MAV_CMD_DO_CHANGE_SPEED]: https://mavlink.io/en/messages/common.html#MAV_CMD_DO_CHANGE_SPEED
|
||||
[MAV_CMD_DO_SET_HOME]: https://mavlink.io/en/messages/common.html#MAV_CMD_DO_SET_HOME
|
||||
[MAV_CMD_DO_JUMP]: https://mavlink.io/en/messages/common.html#MAV_CMD_DO_JUMP
|
||||
|
||||
### Return Mode
|
||||
|
||||
This mode uses the [pure pursuit guidance logic](../config_rover/ackermann.md#pure-pursuit-guidance-logic) with the launch position as goal.
|
||||
Return mode can be activated through the respective [mission command](#mission-commands) or through the ground station UI.
|
||||
@@ -0,0 +1,35 @@
|
||||
# Auto Modes
|
||||
|
||||
In auto modes the autopilot takes over control of the vehicle to run missions, return to launch, or perform other autonomous navigation tasks.
|
||||
|
||||
To use auto modes **all** the configuration/tuning steps in [Rover Configuration/Tuning](../config_rover/index.md) must be followed (from [Basic Setup](../config_rover/basic_setup.md) to [Position tuning](../config_rover/position_tuning.md)).
|
||||
|
||||
## Mission Mode
|
||||
|
||||
_Mission mode_ is an automatic mode that causes the vehicle to execute a predefined autonomous [mission plan](../flying/missions.md) that has been uploaded to the flight controller.
|
||||
The mission is typically created and uploaded with a Ground Control Station (GCS) application, such as [QGroundControl](https://docs.qgroundcontrol.com/master/en/).
|
||||
|
||||
### Mission commands
|
||||
|
||||
The following commands can be used in missions at time of writing (PX4 v1.16):
|
||||
|
||||
| QGC mission item | Command | Description |
|
||||
| ------------------- | ------------------------------------------------------------ | ------------------------------------------------- |
|
||||
| Mission start | [MAV_CMD_MISSION_START](MAV_CMD_MISSION_START) | Starts the mission. |
|
||||
| Waypoint | [MAV_CMD_NAV_WAYPOINT](MAV_CMD_NAV_WAYPOINT) | Navigate to waypoint. |
|
||||
| Return to launch | [MAV_CMD_NAV_RETURN_TO_LAUNCH][MAV_CMD_NAV_RETURN_TO_LAUNCH] | Return to the launch location. |
|
||||
| Change speed | [MAV_CMD_DO_CHANGE_SPEED][MAV_CMD_DO_CHANGE_SPEED] | Change the speed setpoint |
|
||||
| Set launch location | [MAV_CMD_DO_SET_HOME](MAV_CMD_DO_SET_HOME) | Changes launch location to specified coordinates. |
|
||||
| Jump to item (all) | [MAV_CMD_DO_JUMP][MAV_CMD_DO_JUMP] (and other jump commands) | Jump to specified mission item. |
|
||||
|
||||
[MAV_CMD_MISSION_START]: https://mavlink.io/en/messages/common.html#MAV_CMD_MISSION_START
|
||||
[MAV_CMD_NAV_WAYPOINT]: https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_WAYPOINT
|
||||
[MAV_CMD_NAV_RETURN_TO_LAUNCH]: https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_RETURN_TO_LAUNCH
|
||||
[MAV_CMD_DO_CHANGE_SPEED]: https://mavlink.io/en/messages/common.html#MAV_CMD_DO_CHANGE_SPEED
|
||||
[MAV_CMD_DO_SET_HOME]: https://mavlink.io/en/messages/common.html#MAV_CMD_DO_SET_HOME
|
||||
[MAV_CMD_DO_JUMP]: https://mavlink.io/en/messages/common.html#MAV_CMD_DO_JUMP
|
||||
|
||||
## Return Mode
|
||||
|
||||
The vehicle will return to the launch position.
|
||||
Return mode can be activated through the respective [mission command](#mission-commands) or through the ground station UI.
|
||||
@@ -1,142 +0,0 @@
|
||||
# Drive Modes (Differential Rover)
|
||||
|
||||
Flight modes (or more accurately "Drive modes" for ground vehicles) provide autopilot support to make it easier to manually drive the vehicle or to execute autonomous missions.
|
||||
|
||||
This section outlines all supported drive modes for differential rovers.
|
||||
|
||||
For information on mapping RC control switches to specific modes see: [Basic Configuration > Flight Modes](../config/flight_mode.md).
|
||||
|
||||
::: warning
|
||||
Selecting any other mode than those listed below will either stop the rover or can lead to undefined behaviour.
|
||||
:::
|
||||
|
||||
## Manual Modes
|
||||
|
||||
Manual modes require stick inputs from the user to drive the vehicle.
|
||||
|
||||

|
||||
|
||||
The sticks provide the same "high level" control effects over direction and rate of movement in all manual modes:
|
||||
|
||||
- `Left stick up/down`: Drive the rover forwards/backwards (controlling speed)
|
||||
- `Right stick left/right`: Rotate the rover to the left/right (controlling yaw rate).
|
||||
|
||||
The manual modes provide progressively increasing levels of autopilot support for maintaining a course, speed, and rate of turn, compensating for external factors such as slopes or uneven terrain.
|
||||
|
||||
| Mode | Features |
|
||||
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Manual](#manual-mode) | No autopilot support. User is responsible for keeping the rover on the desired course and maintaining speed and rate of turn. |
|
||||
| [Acro](#acro-mode) | + Maintains the yaw rate (This makes it slightly better at holding a straight line in uneven terrain). <br>+ Allows maximum yaw rate to be limited. |
|
||||
| [Stabilized](#stabilized-mode) | + Maintans the yaw (This makes it significantly better at holding a straight line). |
|
||||
| [Position](#position-mode) | + Maintains the course (Best mode for driving a straight line).<br>+ Maintains speed against disturbances, e.g. when driving up a hill.<br>+ Allows maximum speed to be limited. |
|
||||
|
||||
::: details Overview mode mapping to control effect
|
||||
|
||||
| Mode | Forwards/backwards speed | Yaw rate | Required measurements |
|
||||
| ------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
|
||||
| [Manual](#manual-mode) | Directly map stick input to motor commands. | Directly map stick input to motor commands. | None. |
|
||||
| [Acro](#acro-mode) | Directly map stick input to motor commands. | Stick input creates a yaw rate setpoint for the control system to regulate. | Yaw rate. |
|
||||
| [Stabilized](#stabilized-mode) | Directly map stick input to motor commands. | Stick input creates a yaw rate setpoint for the control system to regulate. If this setpoint is zero (stick is centered) the control system will maintain the current yaw (heading) of the rover. | Yaw rate and yaw. |
|
||||
| [Position](#position-mode) | Stick input creates a speed setpoint for the control system to regulate. | Stick input creates a yaw rate setpoint for the control system to regulate. If this setpoint is zero (stick is centered) the control system will keep the rover driving in a straight line. | Yaw rate, yaw, speed and global position (GPS). |
|
||||
|
||||
:::
|
||||
|
||||
### Manual Mode
|
||||
|
||||
In this mode the stick inputs are directly mapped to motor commands. The rover does not attempt to maintain a specific orientation or compensate for external factors like slopes or uneven terrain!
|
||||
The user is responsible for making the necessary adjustments to the stick inputs to keep the rover on the desired course.
|
||||
|
||||
| Stick | Effect |
|
||||
| ---------------------- | ----------------------------------- |
|
||||
| Left stick up/down | Drive the rover forwards/backwards. |
|
||||
| Right stick left/right | Yaw the rover to the left/right. |
|
||||
|
||||
For the configuration/tuning of this mode see [Manual mode](../config_rover/differential.md#manual-mode).
|
||||
|
||||
### Acro Mode
|
||||
|
||||
::: info
|
||||
This mode requires a yaw rate measurement.
|
||||
:::
|
||||
|
||||
In this mode the vehicle regulates its yaw rate to a setpoint (but does not stabilize heading or regulate speed).
|
||||
|
||||
| Stick | Effect |
|
||||
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Left stick up/down | Drive the rover forwards/backwards. |
|
||||
| Right stick left/right | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will attempt to maintain a zero yaw rate (minimal disturbance rejection) |
|
||||
|
||||
For the configuration/tuning of this mode see [Acro mode](../config_rover/differential.md#acro-mode).
|
||||
|
||||
### Stabilized Mode
|
||||
|
||||
::: info
|
||||
This mode requires a yaw rate and yaw estimate.
|
||||
:::
|
||||
|
||||
In this mode the vehicle regulates its yaw rate to a setpoint and will maintain its heading if this setpoint is zero (but does not regulate speed).
|
||||
Compared to [Acro mode](#acro-mode), this mode is much better at driving in a straight line as it can more effectively reject disturbances.
|
||||
|
||||
| Stick | Effect |
|
||||
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Left stick up/down | Drive the rover forwards/backwards. |
|
||||
| Right stick left/right | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will maintain the current yaw. |
|
||||
|
||||
For the configuration/tuning of this mode see [Stabilized mode](../config_rover/differential.md#stabilized-mode).
|
||||
|
||||
### Position Mode
|
||||
|
||||
::: info
|
||||
This mode requires a yaw rate, yaw, speed and global position estimate.
|
||||
:::
|
||||
|
||||
This is the manual mode with the most autopilot support.
|
||||
The vehicle regulates its yaw rate and speed to a setpoint.
|
||||
If the yaw rate setpoint is zero, the controller will remember the GNSS coordinates and yaw (heading) of the vehicle and use those to construct a line that the rover will then follow (course control).
|
||||
This offers the highest amount of disturbance rejection, which leads to the best straight line driving behavior.
|
||||
|
||||
| Stick | Effect |
|
||||
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Left stick up/down | Create a speed setpoint for the control system to regulate. |
|
||||
| Right stick left/right | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will maintain the course of the rover. |
|
||||
|
||||
For the configuration/tuning of this mode see [Position mode](../config_rover/differential.md#position-mode).
|
||||
|
||||
## Auto Modes
|
||||
|
||||
In auto modes the autopilot takes over control of the vehicle to run missions, return to launch, or perform other autonomous navigation tasks.
|
||||
For the configuration/tuning of these modes see [Auto Modes](../config_rover/differential.md#auto-modes).
|
||||
|
||||
### Mission Mode
|
||||
|
||||
_Mission mode_ is an automatic mode in which the vehicle executes a predefined autonomous [mission plan](../flying/missions.md) that has been uploaded to the flight controller.
|
||||
The mission is typically created and uploaded with a Ground Control Station (GCS) application, such as [QGroundControl](https://docs.qgroundcontrol.com/master/en/).
|
||||
|
||||
#### Mission commands
|
||||
|
||||
The following commands can be used in missions at time of writing (PX4 v1.16):
|
||||
|
||||
| QGC mission item | Command | Description |
|
||||
| ------------------- | ------------------------------------------------------------------------------ | ---------------------------------------------------------------- |
|
||||
| Mission start | [MAV_CMD_MISSION_START](MAV_CMD_MISSION_START) | Starts the mission. |
|
||||
| Waypoint | [MAV_CMD_NAV_WAYPOINT](MAV_CMD_NAV_WAYPOINT) | Navigate to waypoint. |
|
||||
| Return to launch | [MAV_CMD_NAV_RETURN_TO_LAUNCH][MAV_CMD_NAV_RETURN_TO_LAUNCH] | Return to the launch location. |
|
||||
| Delay until | [MAV_CMD_NAV_DELAY](MAV_CMD_NAV_DELAY) | The rover will stop for a specified amount of time. |
|
||||
| Change speed | [MAV_CMD_DO_CHANGE_SPEED][MAV_CMD_DO_CHANGE_SPEED] | Change the speed setpoint |
|
||||
| Set launch location | [MAV_CMD_DO_SET_HOME](MAV_CMD_DO_SET_HOME) | Changes launch location to specified coordinates. |
|
||||
| Jump to item (all) | [MAV_CMD_DO_JUMP][MAV_CMD_DO_JUMP] (and other jump commands) | Jump to specified mission item. |
|
||||
| Loiter (all) | [MAV_CMD_NAV_LOITER_TIME][MAV_CMD_NAV_LOITER_TIME] (and other loiter commands) | Stop the rover for given time. Other commands stop indefinitely. |
|
||||
|
||||
[MAV_CMD_MISSION_START]: https://mavlink.io/en/messages/common.html#MAV_CMD_MISSION_START
|
||||
[MAV_CMD_NAV_WAYPOINT]: https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_WAYPOINT
|
||||
[MAV_CMD_NAV_RETURN_TO_LAUNCH]: https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_RETURN_TO_LAUNCH
|
||||
[MAV_CMD_NAV_DELAY]: https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_DELAY
|
||||
[MAV_CMD_DO_CHANGE_SPEED]: https://mavlink.io/en/messages/common.html#MAV_CMD_DO_CHANGE_SPEED
|
||||
[MAV_CMD_DO_SET_HOME]: https://mavlink.io/en/messages/common.html#MAV_CMD_DO_SET_HOME
|
||||
[MAV_CMD_NAV_LOITER_TIME]: https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_LOITER_TIME
|
||||
[MAV_CMD_DO_JUMP]: https://mavlink.io/en/messages/common.html#MAV_CMD_DO_JUMP
|
||||
|
||||
### Return Mode
|
||||
|
||||
This mode uses the [pure pursuit guidance logic](../config_rover/differential.md#pure-pursuit-guidance-logic) with the launch position as goal.
|
||||
Return mode can be activated through the respective [mission command](#mission-commands) or through the ground station UI.
|
||||
@@ -0,0 +1,27 @@
|
||||
# Drive Modes
|
||||
|
||||
Flight modes (or more accurately "Drive modes" for ground vehicles) provide autopilot support to make it easier to manually drive the vehicle or to execute autonomous missions.
|
||||
|
||||
This section outlines all supported drive modes for [Rovers](../frames_rover/index.md).
|
||||
|
||||
For information on mapping RC control switches to specific modes see: [Basic Configuration > Flight Modes](../config/flight_mode.md).
|
||||
|
||||
::: warning
|
||||
Selecting any other mode than those listed below will either stop the rover or can lead to undefined behaviour.
|
||||
:::
|
||||
|
||||
## Manual Modes
|
||||
|
||||
| Mode | Description |
|
||||
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Manual](manual.md#manual-mode) | No autopilot support. User is responsible for keeping the rover on the desired course and maintaining speed and rate of turn. |
|
||||
| [Acro](manual.md#acro-mode) | + Maintains the yaw rate (feels more like driving a car than manual mode). <br>+ Allows maximum yaw rate to be limited (protects against roll over). |
|
||||
| [Stabilized](manual.md#stabilized-mode) | + Maintains the yaw (significantly better at holding a straight line). |
|
||||
| [Position](manual.md#position-mode) | + Maintains the course (best mode for driving a straight line).<br>+ Maintains speed against disturbances, e.g. when driving up a hill.<br>+ Allows maximum speed to be limited. |
|
||||
|
||||
## Auto Modes
|
||||
|
||||
| Mode | Description |
|
||||
| ------------------------------- | ----------------------------------------------------------------------- |
|
||||
| [Mission](auto.md#mission-mode) | Automatic mode that causes the vehicle to execute a predefined mission. |
|
||||
| [Return](auto.md#return-mode) | Automatic mode that returns the vehicle to the launch position. |
|
||||
@@ -0,0 +1,99 @@
|
||||
# Manual Modes
|
||||
|
||||
Manual modes require stick inputs from the user to drive the vehicle.
|
||||
|
||||

|
||||
|
||||
The sticks provide the same "high level" control effects over direction and rate of movement in all manual modes:
|
||||
|
||||
| Rover Type | Left stick up/down | Left stick left/right | Right stick left/right |
|
||||
| ------------ | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Ackermann | Drive the rover forwards/backwards (controlling speed) | - | Make a left/right turn (controlling steering angle in [Manual mode](#manual-mode), and yaw rate in [Acro](#acro-mode), [Stabilized](#stabilized-mode) and [Position](#position-mode) modes). |
|
||||
| Differential | Drive the rover forwards/backwards (controlling speed). | - | Make a left/right turn (controlling speed difference in [Manual mode](#manual-mode), and yaw rate in [Acro](#acro-mode), [Stabilized](#stabilized-mode) and [Position](#position-mode) modes). |
|
||||
| Mecanum | Drive the rover forwards/backwards (controlling speed) | Make a left/right turn (controlling speed difference in [Manual mode](#manual-mode), and yaw rate in [Acro](#acro-mode), [Stabilized](#stabilized-mode) and [Position](#position-mode) modes). | Drive the rover left/right (controlling speed). |
|
||||
|
||||
The manual modes provide progressively increasing levels of autopilot support for maintaining a course, speed, and rate of turn, compensating for external factors such as slopes or uneven terrain.
|
||||
|
||||
| Mode | Description |
|
||||
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Manual](manual.md#manual-mode) | No autopilot support. User is responsible for keeping the rover on the desired course and maintaining speed and rate of turn. |
|
||||
| [Acro](manual.md#acro-mode) | + Maintains the yaw rate (feels more like driving a car than manual mode). <br>+ Allows maximum yaw rate to be limited (protects against roll over). |
|
||||
| [Stabilized](manual.md#stabilized-mode) | + Maintains the yaw (significantly better at holding a straight line). |
|
||||
| [Position](manual.md#position-mode) | + Maintains the course (best mode for driving a straight line).<br>+ Maintains speed against disturbances, e.g. when driving up a hill.<br>+ Allows maximum speed to be limited. |
|
||||
|
||||
::: details Overview mode mapping to control effect
|
||||
|
||||
| Mode | Speed | Turning | Required measurements |
|
||||
| ------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
|
||||
| [Manual](#manual-mode) | Directly map stick input to motor command. | Directly map stick input to steering angle/speed difference. | None. |
|
||||
| [Acro](#acro-mode) | Directly map stick input to motor command. | Stick input creates a yaw rate setpoint for the control system to regulate. | yaw rate. |
|
||||
| [Stabilized](#stabilized-mode) | Directly map stick input to motor commands. | Stick input creates a yaw rate setpoint for the control system to regulate. If this setpoint is zero (stick is centered) the control system will maintain the current yaw (heading) of the rover. | Yaw rate and yaw. |
|
||||
| [Position](#position-mode) | Stick input creates a speed setpoint for the control system to regulate. | Stick input creates a yaw rate setpoint for the control system to regulate. If this setpoint is zero (stick is centered) the control system will keep the rover driving in a straight line. | yaw rate, yaw, speed and global position (GPS). |
|
||||
|
||||
:::
|
||||
|
||||
## Manual Mode
|
||||
|
||||
In this mode the stick inputs are directly mapped to motor commands.
|
||||
The rover does not attempt to maintain a specific orientation or compensate for external factors like slopes or uneven terrain!
|
||||
The user is responsible for making the necessary adjustments to the stick inputs to keep the rover on the desired course.
|
||||
|
||||
| Rover Type | Left stick up/down | Left stick left/right | Right stick left/right |
|
||||
| ------------ | ----------------------------------- | -------------------------------- | ------------------------------------------ |
|
||||
| Ackermann | Drive the rover forwards/backwards. | - | Move the steering angle to the left/right. |
|
||||
| Differential | Drive the rover forwards/backwards. | - | Yaw the rover to the left/right. |
|
||||
| Mecanum | Drive the rover forwards/backwards. | Yaw the rover to the left/right. | Drive the rover left/right |
|
||||
|
||||
For the configuration/tuning of this mode see [Basic Setup](../config_rover/basic_setup.md).
|
||||
|
||||
## Acro Mode
|
||||
|
||||
::: info
|
||||
This mode requires a yaw rate measurement.
|
||||
:::
|
||||
|
||||
In this mode the vehicle regulates its yaw rate to a setpoint (but does not stabilize heading or regulate speed).
|
||||
|
||||
| Rover Type | Left stick up/down | Left stick left/right | Right stick left/right |
|
||||
| ------------ | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Ackermann | Drive the rover forwards/backwards. | - | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will attempt to maintain a zero yaw rate (minimal disturbance rejection). |
|
||||
| Differential | Drive the rover forwards/backwards. | - | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will attempt to maintain a zero yaw rate (minimal disturbance rejection) |
|
||||
| Mecanum | Drive the rover forwards/backwards. | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will attempt to maintain a zero yaw rate (minimal disturbance rejection) | Drive the rover left/right |
|
||||
|
||||
For the configuration/tuning of this mode see [Rate tuning](../config_rover/rate_tuning.md).
|
||||
|
||||
## Stabilized Mode
|
||||
|
||||
::: info
|
||||
This mode requires a yaw rate and yaw estimate.
|
||||
:::
|
||||
|
||||
In this mode the vehicle regulates its yaw rate to a setpoint and will maintain its heading if this setpoint is zero (but does not regulate speed).
|
||||
Compared to [Acro mode](#acro-mode), this mode is much better at driving in a straight line as it can more effectively reject disturbances.
|
||||
|
||||
| Rover Type | Left stick up/down | Left stick left/right | Right stick left/right |
|
||||
| ------------ | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Ackermann | Drive the rover forwards/backwards. | - | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will maintain the current yaw. |
|
||||
| Differential | Drive the rover forwards/backwards. | - | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will maintain the current yaw. |
|
||||
| Mecanum | Drive the rover forwards/backwards. | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will maintain the current yaw. | Drive the rover left/right |
|
||||
|
||||
For the configuration/tuning of this mode see [Attitude tuning](../config_rover/attitude_tuning.md).
|
||||
|
||||
## Position Mode
|
||||
|
||||
::: info
|
||||
This mode requires a yaw rate, yaw, speed and global position estimate.
|
||||
:::
|
||||
|
||||
This is the manual mode with the most autopilot support.
|
||||
The vehicle regulates its yaw rate and speed to a setpoint.
|
||||
If the yaw rate setpoint is zero, the controller will remember the GPS coordinates and yaw (heading) of the vehicle and use those to construct a line that the rover will then follow (course control).
|
||||
This offers the highest amount of disturbance rejection, which leads to the best straight line driving behavior.
|
||||
|
||||
| Rover Type | Left stick up/down | Left stick left/right | Right stick left/right |
|
||||
| ------------ | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Ackermann | Stick position sets a forward/back speed setpoint. The vehicle attempts to maintain this speed on slopes etc. | - | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will maintain the course of the rover. |
|
||||
| Differential | Stick position sets a forward/back speed setpoint. The vehicle attempts to maintain this speed on slopes etc. | - | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will maintain the course of the rover. |
|
||||
| Mecanum | Stick position sets a forward/back speed setpoint. The vehicle attempts to maintain this speed on slopes etc. | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will maintain the course of the rover. | Stick position sets a left/right speed setpoint. The vehicle attempts to maintain this speed on slopes etc. |
|
||||
|
||||
For the configuration/tuning of this mode see [Velocity tuning](../config_rover/velocity_tuning.md).
|
||||
@@ -1,167 +0,0 @@
|
||||
# Drive Modes (Mecanum Rover)
|
||||
|
||||
Flight modes (or more accurately "Drive modes" for ground vehicles) provide autopilot support to make it easier to manually drive the vehicle or to execute autonomous missions.
|
||||
|
||||
This section outlines all supported drive modes for mecanum rovers.
|
||||
|
||||
For information on mapping RC control switches to specific modes see: [Basic Configuration > Flight Modes](../config/flight_mode.md).
|
||||
|
||||
::: warning
|
||||
Selecting any other mode than those listed below will either stop the rover or can lead to undefined behaviour.
|
||||
:::
|
||||
|
||||
## Manual Modes
|
||||
|
||||
Manual modes require stick inputs from the user to drive the vehicle.
|
||||
|
||||

|
||||
|
||||
The sticks provide the same "high level" control effects over direction and rate of movement in all manual modes:
|
||||
|
||||
- `Left stick up/down`: Drive the rover forwards/backwards (controlling speed)
|
||||
- `Left stick left/right`: Yaw the rover to the left/right (controlling yaw rate).
|
||||
- `Right stick left/right`: Drive the rover left/right (controlling speed).
|
||||
|
||||
The manual modes provide progressively increasing levels of autopilot support for maintaining a course, speed, and rate of turn, compensating for external factors such as slopes or uneven terrain.
|
||||
|
||||
| Mode | Features |
|
||||
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Manual](#manual-mode) | No autopilot support. User is responsible for keeping the rover on the desired course and maintaining speed and rate of turn. |
|
||||
| [Acro](#acro-mode) | + Maintains yaw rate (This makes it slightly better at holding a straight line in uneven terrain). <br>+ Allows maximum yaw rate to be limited. |
|
||||
| [Stabilized](#stabilized-mode) | + Maintains yaw (This makes it significantly better at holding a straight line) . |
|
||||
| [Position](#position-mode) | + Best mode for holding a straight line.<br>+ Maintains speed against disturbances, e.g. when driving up a hill<br>+ Allows maximum speed to be limited. |
|
||||
|
||||
::: details Overview mode mapping to control effect
|
||||
|
||||
| Mode | Longitudinal/Lateral speed | Yaw rate | Required measurements |
|
||||
| ------------------------------ | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
|
||||
| [Manual](#manual-mode) | Directly map stick input to motor commands. | Directly map stick input to motor commands. | None. |
|
||||
| [Acro](#acro-mode) | Directly map stick input to motor commands. | Stick input creates a yaw rate setpoint for the control system to regulate. | Yaw rate. |
|
||||
| [Stabilized](#stabilized-mode) | Directly map stick input to motor commands. | Stick input creates a yaw rate setpoint for the control system to regulate. If this setpoint is zero (stick is centered) the control system will maintain the current yaw (heading) of the rover. | Yaw rate and yaw. |
|
||||
| [Position](#position-mode) | Stick input creates a velocity setpoint for the control system to regulate. | Stick input creates a yaw rate setpoint for the control system to regulate. If this setpoint is zero (stick is centered) the control system will keep the rover driving in a straight line. | Yaw rate, yaw, velocity and global position (GPS). |
|
||||
|
||||
:::
|
||||
|
||||
### Manual Mode
|
||||
|
||||
In this mode the stick inputs are directly mapped to motor commands.
|
||||
The rover does not attempt to maintain a specific orientation or compensate for external factors like slopes or uneven terrain!
|
||||
The user is responsible for making the necessary adjustments to the stick inputs to keep the rover on the desired course.
|
||||
|
||||
| Stick | Effect |
|
||||
| ---------------------- | ----------------------------------- |
|
||||
| Left stick up/down | Drive the rover forwards/backwards. |
|
||||
| Left stick left/right | Yaw the rover to the left/right. |
|
||||
| Right stick left/right | Drive the rover left/right. |
|
||||
|
||||
For the configuration/tuning of this mode see [Manual mode](../config_rover/mecanum.md#manual-mode).
|
||||
|
||||
### Acro Mode
|
||||
|
||||
::: info
|
||||
This mode requires a yaw rate measurement.
|
||||
:::
|
||||
|
||||
The vehicle regulates its yaw rate (Left stick left/right) to a setpoint, and a maximum yaw rate can also be specified.
|
||||
Heading and speed are not controlled.
|
||||
|
||||
Compared to [Manual mode](#manual-mode) this introduces the following new features:
|
||||
|
||||
- The yaw rate control ensures that the rover turns at the requested rate even on different surfaces and due to other external forces (such as wind).
|
||||
- Slightly better at driving in a straight line because if the input is zero PX4 will attempt to maintain a zero yaw rate.
|
||||
This is resistant to minor disturbances.
|
||||
- Upper limit for the yaw rate can be used to tune how aggressive the rover turns.
|
||||
|
||||
| Stick | Effect |
|
||||
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Left stick up/down | Drive the rover forwards/backwards. |
|
||||
| Left stick left/right | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will attempt to maintain a zero yaw rate (minimal disturbance rejection) |
|
||||
| Right stick left/right | Drive the rover left/right. |
|
||||
|
||||
For the configuration/tuning of this mode see [Acro mode](../config_rover/mecanum.md#acro-mode).
|
||||
|
||||
### Stabilized Mode
|
||||
|
||||
::: info
|
||||
This mode requires a yaw rate and yaw estimate.
|
||||
:::
|
||||
|
||||
The vehicle regulates its yaw rate to a setpoint, and a maximum yaw rate can also be specified.
|
||||
The vehicle regulates its yaw to a setpoint when the yaw rate setpoint is zero, maintaining the heading.
|
||||
Speed is not controlled.
|
||||
|
||||
Compared to [Acro mode](#acro-mode), this mode is much better at driving in a straight line as it can more effectively reject disturbances.
|
||||
|
||||
| Stick | Effect |
|
||||
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Left stick up/down | Drive the rover forwards/backwards. |
|
||||
| Left stick left/right | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will maintain the current yaw. |
|
||||
| Right stick left/right | Drive the rover left/right. |
|
||||
|
||||
For the configuration/tuning of this mode see [Stabilized mode](../config_rover/mecanum.md#stabilized-mode).
|
||||
|
||||
### Position Mode
|
||||
|
||||
::: info
|
||||
This mode requires a yaw rate, yaw, speed and global position estimate.
|
||||
:::
|
||||
|
||||
This is the mode with the most autopilot support.
|
||||
|
||||
The vehicle regulates its yaw rate to a setpoint, and a maximum yaw rate can also be specified.
|
||||
The path is maintained when the yaw rate setpoint is zero using global position (the controller constructs a line in the direction of the velocity input (forward + lateral speed) that the rover will then follow by tracking the global position).
|
||||
Speed is regulated to a setpoint, and a maximum value can be set.
|
||||
|
||||
Compared to [Stabilized Mode](#stabilized-mode) this introduces the following features:
|
||||
|
||||
- Upper limit for the speed (see [Position Mode](../config_rover/mecanum.md#position-mode)) to tune how fast the rover is allowed to drive.
|
||||
- The speed control ensures that the rover drives the requested speed even under disturbances (i.e. driving up a hill, against wind, with a heavier payload etc.).
|
||||
- The course control leads to the best straight line driving behaviour, as the vehicle will follow the intended path of the vehicle and return to it if forced off-track
|
||||
This is much better than stabilized mode, which can be forced off the intended track by disturbances.
|
||||
|
||||
| Stick | Effect |
|
||||
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Left stick up/down | Create a forward speed setpoint for the control system to regulate. |
|
||||
| Left stick left/right | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will maintain the course of the rover. |
|
||||
| Right stick left/right | Create a lateral speed setpoint for the control system to regulate. |
|
||||
|
||||
For the configuration/tuning of this mode see [Position mode](../config_rover/mecanum.md#position-mode).
|
||||
|
||||
## Auto Modes
|
||||
|
||||
In auto modes the autopilot takes over control of the vehicle to run missions, return to launch, or perform other autonomous navigation tasks.
|
||||
For the configuration/tuning of these modes see [Auto Modes](../config_rover/mecanum.md#auto-modes).
|
||||
|
||||
### Mission Mode
|
||||
|
||||
_Mission mode_ is an automatic mode in which the vehicle executes a predefined autonomous [mission plan](../flying/missions.md) that has been uploaded to the flight controller.
|
||||
The mission is typically created and uploaded with a Ground Control Station (GCS) application, such as [QGroundControl](https://docs.qgroundcontrol.com/master/en/).
|
||||
|
||||
#### Mission commands
|
||||
|
||||
The following commands can be used in missions at time of writing (PX4 v1.16):
|
||||
|
||||
| QGC mission item | Command | Description |
|
||||
| ------------------- | ------------------------------------------------------------------------------ | ---------------------------------------------------------------- |
|
||||
| Mission start | [MAV_CMD_MISSION_START](MAV_CMD_MISSION_START) | Starts the mission. |
|
||||
| Waypoint | [MAV_CMD_NAV_WAYPOINT](MAV_CMD_NAV_WAYPOINT) | Navigate to waypoint. |
|
||||
| Return to launch | [MAV_CMD_NAV_RETURN_TO_LAUNCH][MAV_CMD_NAV_RETURN_TO_LAUNCH] | Return to the launch location. |
|
||||
| Delay until | [MAV_CMD_NAV_DELAY](MAV_CMD_NAV_DELAY) | The rover will stop for a specified amount of time. |
|
||||
| Change speed | [MAV_CMD_DO_CHANGE_SPEED][MAV_CMD_DO_CHANGE_SPEED] | Change the speed setpoint |
|
||||
| Set launch location | [MAV_CMD_DO_SET_HOME](MAV_CMD_DO_SET_HOME) | Changes launch location to specified coordinates. |
|
||||
| Jump to item (all) | [MAV_CMD_DO_JUMP][MAV_CMD_DO_JUMP] (and other jump commands) | Jump to specified mission item. |
|
||||
| Loiter (all) | [MAV_CMD_NAV_LOITER_TIME][MAV_CMD_NAV_LOITER_TIME] (and other loiter commands) | Stop the rover for given time. Other commands stop indefinitely. |
|
||||
|
||||
[MAV_CMD_MISSION_START]: https://mavlink.io/en/messages/common.html#MAV_CMD_MISSION_START
|
||||
[MAV_CMD_NAV_WAYPOINT]: https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_WAYPOINT
|
||||
[MAV_CMD_NAV_RETURN_TO_LAUNCH]: https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_RETURN_TO_LAUNCH
|
||||
[MAV_CMD_NAV_DELAY]: https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_DELAY
|
||||
[MAV_CMD_DO_CHANGE_SPEED]: https://mavlink.io/en/messages/common.html#MAV_CMD_DO_CHANGE_SPEED
|
||||
[MAV_CMD_DO_SET_HOME]: https://mavlink.io/en/messages/common.html#MAV_CMD_DO_SET_HOME
|
||||
[MAV_CMD_NAV_LOITER_TIME]: https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_LOITER_TIME
|
||||
[MAV_CMD_DO_JUMP]: https://mavlink.io/en/messages/common.html#MAV_CMD_DO_JUMP
|
||||
|
||||
### Return Mode
|
||||
|
||||
This mode uses the [pure pursuit guidance logic](../config_rover/mecanum.md#pure-pursuit-guidance-logic) with the launch position as goal.
|
||||
Return mode can be activated through the respective [mission command](#mission-commands) or through the ground station UI.
|
||||
@@ -28,10 +28,11 @@ The set of supported configurations can be seen in [Airframes Reference > Autogy
|
||||
|
||||
This section contains build logs/instructions for assembling and configuring a number of Autogyro frames.
|
||||
|
||||
- [ThunderFly Auto-G2 (Holybro pix32)](../frames_autogyro/thunderfly_auto_g2.md)
|
||||
- [ThunderFly Auto-G2 (Holybro pix32)](../frames_autogyro/thunderfly_auto_g2.md) - Modified Autogyro RC model
|
||||
|
||||
### Complete Frames with PX4 Preinstalled
|
||||
|
||||
This section lists vehicles that are sold fully assembled and ready to fly (RTF), with PX4 installed.
|
||||
|
||||
- [ThunderFly TF-G2](https://www.thunderfly.cz/tf-g2.html)
|
||||
- [ThunderFly TF-G2](https://docs.thunderfly.cz/instruments/TF-G2) - Unmanned Autogyro Development Kit
|
||||
- [ThunderFly TF-G250](https://docs.thunderfly.cz/instruments/TF-G250) - Atmospheric Sounding Aerological Autogyro
|
||||
|
||||
@@ -6,10 +6,11 @@ Durafly™ Auto-G2 Gyrocopter](https://hobbyking.com/en_us/duraflytm-auto-g2-gyr
|
||||

|
||||
|
||||
::: info
|
||||
Auto-G2 autogyro’s airframe is developed and maintained by ThuderFly s.r.o. company.
|
||||
Auto-G2 autogyro’s airframe was originally developed by [ThunderFly](https://www.thunderfly.cz/) and has since evolved into the updated [TF-G2 platform](https://docs.thunderfly.cz/instruments/TF-G2).
|
||||
Check out our site for more information on the current [TF-G2 commercial airframe](https://www.thunderfly.cz/tf-g2.html).
|
||||
:::
|
||||
|
||||
All the added parts are available on [GitHub](https://github.com/ThunderFly-aerospace/TF-G2/) as an open-source project.
|
||||
All the added parts are available on [GitHub](https://github.com/ThunderFly-aerospace/Auto-G2) as an open-source project.
|
||||
Printed parts are designed in [OpenSCAD](https://www.openscad.org/).
|
||||
|
||||
|
||||
@@ -23,7 +24,7 @@ Durafly Auto-G2 autogyro box contains the autogyro polystyrene body, ESC, motor
|
||||
Modification of the Durafly model are as follows:
|
||||
* Addition of an autopilot
|
||||
* Rotor head with two axes of freedom (pitch, roll)
|
||||
* Two blade rotor with safely breakable rotor plate
|
||||
* Two-blade rotor with safely breakable rotor plate
|
||||
* Larger landing gears
|
||||
|
||||
### Autopilot
|
||||
@@ -31,15 +32,15 @@ Modification of the Durafly model are as follows:
|
||||
The aircraft with all of the modifications is already quite heavy.
|
||||
Therefore a low-weight flight controller is recommended (e.g. [Holybro pix32](../flight_controller/holybro_pix32.md) or [CUAV nano](../flight_controller/cuav_v5_nano.md)).
|
||||
|
||||
The autopilot should be mounted on the bottom side of the autogyro on a 3D printed damping pad.
|
||||
The autopilot should be mounted on the bottom side of the autogyro on a 3D-printed damping pad.
|
||||
We have used the damping platform found on [thingiverse](https://www.thingiverse.com/thing:160655)
|
||||
|
||||
|
||||
### Rotor-head
|
||||
|
||||
The rotor head is (compared to the original autogyro) modified so it allows a motion in both roll and pitch axes.
|
||||
The rotor head is (compared to the original autogyro) modified so that it allows a motion in both roll and pitch axes.
|
||||
Thanks to this, the rotor can control turning as well climbing of the autogyro.
|
||||
Directional control of autogyro by rotor is possible even in case of low airspeed compared to the original rudder and elevator control.
|
||||
Directional control of an autogyro by the rotor is possible even in the case of low airspeed compared to the original rudder and elevator control.
|
||||
|
||||
The printed rotor head consists of three parts.
|
||||
The bottom part is screwed using an M2.5 screw to the original plywood pylon.
|
||||
@@ -50,48 +51,48 @@ From the rotor side, the screw head has a large area washer.
|
||||
Rotor axis, made of M3x50 high tensile strength screw, goes through the third part.
|
||||
Bearings used are 623 2Z C3 SKF.
|
||||
At the end of this part, there are ball rods attached via M2.5 screws to servos positioned in the bottom part of the pylon.
|
||||
It is preferable to exchange these original servos for better quality ones as they are weak and in the original construction they help each other.
|
||||
It is preferable to exchange these original servos for better quality ones as they are weak and in the original construction, they help each other.
|
||||
|
||||

|
||||
|
||||
### Two-blade rotor
|
||||
|
||||
The original Durafly Auto-G2 autogyro has a three-blade rotor, which as been modified in this built to use a two-blade rotor.
|
||||
The original Durafly Auto-G2 autogyro has a three-blade rotor, which has been modified in this build to use a two-blade rotor.
|
||||
The reasons are reduced vibration and easier construction.
|
||||
Printed central parts are designed to be used both with Chinese Durafly blades or 3D printed blades.
|
||||
|
||||
The rotor's central part consists of several components which have following roles:
|
||||
The rotor's central part consists of several components, which have the following roles:
|
||||
* They enable blade flapping.
|
||||
* They have deformation zones that break upon impact with ground.
|
||||
* They have deformation zones that break upon impact with the ground.
|
||||
Thanks to this, the rotor can usually be repaired quickly by replacing only one component.
|
||||
* Easy setup of blades angle-of-attack.
|
||||
* Easy setup of blades' angle-of-attack.
|
||||
|
||||
#### HobbyKing rotor blades
|
||||
|
||||
It is possible to use a printed central part of the rotor with the original blades.
|
||||
These blades can be bought on [HobbyKing](https://hobbyking.com/en_us/duraflytm-auto-g-gyrocopter-821mm-replacement-main-blade-1pcs-bag.html).
|
||||
Hobbyking blades differ in the position of center of gravity and it is therefore necessary to balance them properly.
|
||||
Hobbyking blades differ in the position of the center of gravity, and it is therefore necessary to balance them properly.
|
||||
|
||||
#### 3D printed rotor blades
|
||||
|
||||
It is also possible to print rotor blades.
|
||||
|
||||
The printed rotor blads are still under development, but preliminary tests show they are of better quality mostly thanks to their precise shape and absence of longitudinal grooves.
|
||||
The printed rotor blades are still under development, but preliminary tests show they are of better quality, mostly thanks to their precise shape and absence of longitudinal grooves.
|
||||
However, some of the production processes still need to be tuned.
|
||||
|
||||

|
||||
|
||||
#### Balancing
|
||||
|
||||
Proper blades balance is very important to minimize vibrations.
|
||||
Proper blade balance is very important to minimize vibrations.
|
||||
Blades have to be balanced in such a way, that the center of gravity is located in the middle of the rotor axis.
|
||||
|
||||
Printed blades are balanced in the production process and there is no need to further balance them.
|
||||
Printed blades are balanced in the production process, and there is no need to further balance them.
|
||||
|
||||
### Release device
|
||||
|
||||
If you want to launch an autogyro using a winch or if you want to launch it by towing you need to print a release device.
|
||||
It is a small box equipped with servo which pulls out the pin and releases the rope.
|
||||
If you want to launch an autogyro using a winch or if you want to launch it by towing, you need to print a release device.
|
||||
It is a small box equipped with a servo that pulls out the pin and releases the rope.
|
||||
|
||||
The whole part is glued, using a hot-melt adhesive, under the engine on the bottom part of an autogyro’s body.
|
||||
If an autogyro is towed by a rope its engine must not be turned on.
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
# Ackermann Rovers
|
||||
|
||||
<Badge type="tip" text="PX4 v1.16" /> <Badge type="warning" text="Experimental" />
|
||||
|
||||
An _Ackermann rover_ controls its direction by pointing the front wheels in the direction of travel — the [Ackermann steering geometry](https://en.wikipedia.org/wiki/Ackermann_steering_geometry) compensates for the fact that wheels on the inside and outside of the turn move at different rates.
|
||||
This kind of steering is used on most commercial vehicles, including cars, trucks etc.
|
||||
|
||||
::: info
|
||||
PX4 does not require that the vehicle uses the Ackermann geometry and will work with any front-steering rover.
|
||||
:::
|
||||
|
||||

|
||||
|
||||
See [Configuration/Tuning](../config_rover/ackermann.md) to set up your rover and [Drive Modes](../flight_modes_rover/ackermann.md) for the supported flight (aka drive) modes.
|
||||
@@ -1,11 +0,0 @@
|
||||
# Differential Rovers
|
||||
|
||||
<Badge type="tip" text="PX4 v1.16" /> <Badge type="warning" text="Experimental" />
|
||||
|
||||
A differential rover's motion is controlled using a differential drive mechanism, where the left and right wheel speeds are adjusted independently to achieve the desired forward speed and yaw rate.
|
||||
Forward motion is achieved by driving both wheels at the same speed in the same direction.
|
||||
Rotation is achieved by driving the wheels at different speeds in opposite directions, allowing the rover to turn on the spot.
|
||||
|
||||

|
||||
|
||||
See [Configuration/Tuning](../config_rover/differential.md) to set up your rover and [Drive Modes](../flight_modes_rover/differential.md) for the supported flight (aka drive) modes.
|
||||
@@ -9,42 +9,57 @@ Maintainer volunteers, [contribution](../contribute/index.md) of new features, n
|
||||
|
||||

|
||||
|
||||
PX4 supports the following rover types:
|
||||
|
||||
| Rover Type | Steering |
|
||||
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [**Ackermann**](../frames_rover/ackermann.md) | Direction is controlled by pointing wheels in the direction of travel. This kind of steering is used on most commercial vehicles, including cars, trucks etc. |
|
||||
| [**Differential**](../frames_rover/differential.md) | Direction is controlled by moving the left- and right-side wheels at different speeds (also know as skid or tank steering). |
|
||||
| [**Mecanum**](../frames_rover/mecanum.md) | Direction is controlled by moving each mecanum wheel individually at different speeds and in different directions. |
|
||||
PX4 provides support for the three most common types of rovers:
|
||||
| Rover Type | Steering |
|
||||
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [**Ackermann**](#ackermann) | Direction is controlled by pointing wheels in the direction of travel. This kind of steering is used on most commercial vehicles, including cars, trucks etc. |
|
||||
| [**Differential**](#differential) | Direction is controlled by moving the left- and right-side wheels at different speeds. |
|
||||
| [**Mecanum**](#mecanum) | Direction is controlled by moving each mecanum wheel individually at different speeds and in different directions. |
|
||||
|
||||
The supported frames can be seen in [Airframes Reference > Rover](../airframes/airframe_reference.md#rover).
|
||||
|
||||
## Flashing the Rover Build
|
||||
## Ackermann
|
||||
|
||||
Rovers use a custom build that must be flashed onto your flight controller instead of the default PX4 build:
|
||||
<Badge type="tip" text="PX4 v1.16" /> <Badge type="warning" text="Experimental" />
|
||||
|
||||
1. First build the rover firmware for your flight controller from the `main` branch (there is no release build, so you can't just select this build from QGroundControl).
|
||||
An Ackermann rover controls its direction by pointing the front wheels in the direction of travel — the [Ackermann steering geometry](https://en.wikipedia.org/wiki/Ackermann_steering_geometry) compensates for the fact that wheels on the inside and outside of the turn move at different rates.
|
||||
This kind of steering is used on most commercial vehicles, including cars, trucks etc.
|
||||
|
||||
To build for rover with the `make` command, replace the `_default` suffix with `_rover`.
|
||||
For example, to build rover for px4_fmu-v6x boards, you would use the command:
|
||||
::: info
|
||||
PX4 does not require that the vehicle uses the Ackermann geometry and will work with any front-steering rover.
|
||||
:::
|
||||
|
||||
```sh
|
||||
make px4_fmu-v6x_rover
|
||||
```
|
||||

|
||||
|
||||
::: info
|
||||
You can also enable the modules in default builds by adding these lines to your [board configuration](../hardware/porting_guide_config.md) (e.g. for fmu-v6x you might add them to [`main/boards/px4/fmu-v6x/default.px4board`](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v6x/default.px4board)):
|
||||
## Differential
|
||||
|
||||
```sh
|
||||
CONFIG_MODULES_ROVER_ACKERMANN=y
|
||||
CONFIG_MODULES_ROVER_DIFFERENTIAL=y
|
||||
CONFIG_MODULES_ROVER_MECANUM=y
|
||||
```
|
||||
<Badge type="tip" text="PX4 v1.16" /> <Badge type="warning" text="Experimental" />
|
||||
|
||||
Note that adding the rover modules may lead to flash overflow, in which case you will need to disable modules that you do not plan to use (such as those related to multicopter or fixed wing).
|
||||
:::
|
||||
A differential rover's motion is controlled using a differential drive mechanism, where the left and right wheel speeds are adjusted independently to achieve the desired forward speed and yaw rate.
|
||||
Forward motion is achieved by driving both wheels at the same speed in the same direction.
|
||||
Rotation is achieved by driving the wheels at different speeds in opposite directions, allowing the rover to turn on the spot.
|
||||
|
||||
2. Load the **custom firmware** that you just built onto your flight controller (see [Loading Firmware > Installing PX4 Main, Beta or Custom Firmware](../config/firmware.md#installing-px4-main-beta-or-custom-firmware)).
|
||||

|
||||
|
||||
::: info
|
||||
The differential setup also work for rovers with skid or tank steering.
|
||||
:::
|
||||
|
||||
## Mecanum
|
||||
|
||||
<Badge type="tip" text="PX4 v1.16" /> <Badge type="warning" text="Experimental" />
|
||||
|
||||
A Mecanum rover is a type of mobile robot that uses Mecanum wheels to achieve omnidirectional movement. These wheels are unique because they have rollers mounted at a 45-degree angle around their circumference, allowing the rover to move not only forward and backward but also side-to-side and diagonally without needing to rotate first.
|
||||
Each wheel is driven by its own motor, and by controlling the speed and direction of each motor, the rover can move in any direction or spin in place.
|
||||
|
||||

|
||||
|
||||
## See Also
|
||||
|
||||
- [Drive Modes](../flight_modes_rover/index.md).
|
||||
- [Configuration/Tuning](../config_rover/index.md)
|
||||
- [Complete Vehicles](../complete_vehicles_rover/index.md)
|
||||
|
||||
## Simulation
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
# Mecanum Rovers
|
||||
|
||||
<Badge type="tip" text="PX4 v1.16" /> <Badge type="warning" text="Experimental" />
|
||||
|
||||
A Mecanum rover is a type of mobile robot that uses Mecanum wheels to achieve omnidirectional movement. These wheels are unique because they have rollers mounted at a 45-degree angle around their circumference, allowing the rover to move not only forward and backward but also side-to-side and diagonally without needing to rotate first.
|
||||
Each wheel is driven by its own motor, and by controlling the speed and direction of each motor, the rover can move in any direction or spin in place.
|
||||
|
||||

|
||||
|
||||
See [Configuration/Tuning](../config_rover/mecanum.md) to set up your rover and [Drive Modes](../flight_modes_rover/mecanum.md) for the supported flight (aka drive) modes.
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
::: warning
|
||||
This information applies to the original generic rover module that was derived from the fixed wing controller.
|
||||
It has been replaced with new modules for [Ackermann](../frames_rover/ackermann.md) and [Differential-steering](../frames_rover/differential.md) rovers.
|
||||
It has been replaced with new modules for [Ackermann](../frames_rover/index.md#ackermann) and [Differential-steering](../frames_rover/index.md#differential) rovers.
|
||||
This module is no longer supported and will receive no updates.
|
||||
:::
|
||||
|
||||
|
||||
@@ -333,8 +333,7 @@ An overview of the flight modes implemented within PX4 for each vehicle can be f
|
||||
- [Flight Modes (Multicopter)](../flight_modes_mc/index.md)
|
||||
- [Flight Modes (Fixed-Wing)](../flight_modes_fw/index.md)
|
||||
- [Flight Modes (VTOL)](../flight_modes_vtol/index.md)
|
||||
- [Drive Modes (Differential Rover)](../flight_modes_rover/differential.md)
|
||||
- [Drive Modes (Ackermann Rover)](../flight_modes_rover/ackermann.md)
|
||||
- [Drive Modes (Rover)](../flight_modes_rover/index.md)
|
||||
|
||||
Instructions for how to set up your remote control switches to enable different flight modes is provided in [Flight Mode Configuration](../config/flight_mode.md).
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ Remove propellers before changing ESC configuration parameters!
|
||||
|
||||
Enable DShot for your required outputs in the [Actuator Configuration](../config/actuators.md).
|
||||
|
||||
DShot comes with different speed options: _DShot150_, _DShot300_, _DShot600_ and _DShot1200_, where the number indicates the speed in kilo-bits/second.
|
||||
DShot comes with different speed options: _DShot150_, _DShot300_, and _DShot600_ where the number indicates the speed in kilo-bits/second.
|
||||
You should set the parameter to the highest speed supported by your ESC (according to its datasheet).
|
||||
|
||||
Then connect the battery and arm the vehicle.
|
||||
@@ -110,18 +110,19 @@ The most important ones are:
|
||||
|
||||
:::
|
||||
|
||||
## Telemetry
|
||||
|
||||
Some ESCs are capable of sending telemetry back to the flight controller, including:
|
||||
|
||||
- temperature
|
||||
- voltage
|
||||
- current
|
||||
- accumulated current consumption
|
||||
- RPM values
|
||||
## ESC Telemetry
|
||||
|
||||
Some ESCs are capable of sending telemetry back to the flight controller through a UART RX port.
|
||||
These DShot ESCs will have an additional telemetry wire.
|
||||
|
||||
The provided telemetry includes:
|
||||
|
||||
- Temperature
|
||||
- Voltage
|
||||
- Current
|
||||
- Accumulated current consumption
|
||||
- RPM values
|
||||
|
||||
To enable this feature (on ESCs that support it):
|
||||
|
||||
1. Join all the telemetry wires from all the ESCs together, and then connect them to one of the RX pins on an unused flight controller serial port.
|
||||
@@ -147,3 +148,40 @@ ERROR [dshot] No data received. If telemetry is setup correctly, try again.
|
||||
|
||||
Check manufacturer documentation for confirmation/details.
|
||||
:::
|
||||
|
||||
## Bidirectional DShot (Telemetry)
|
||||
|
||||
<Badge type="tip" text="PX4 v1.16" />
|
||||
|
||||
Bidirectional DShot is a protocol that can provide telemetry including: high rate ESC RPM data, voltage, current, and temperature with a single wire.
|
||||
|
||||
The PX4 implementation currently enables only ESC RPM (eRPM) data collection from each ESC at high frequencies.
|
||||
This telemetry significantly improves the performance of [Dynamic Notch Filters](../config_mc/filter_tuning.md#dynamic-notch-filters) and enables more precise vehicle tuning.
|
||||
|
||||
::: info
|
||||
The [ESC Telemetry](#esc-telemetry) described above is currently still necessary if you want voltage, current, or temperature information.
|
||||
It's setup and use is independent of bidirectional DShot.
|
||||
:::
|
||||
|
||||
### Hardware Setup
|
||||
|
||||
The ESC must be connected to FMU outputs only.
|
||||
These will be labeled `MAIN` on flight controllers that only have one PWM bus, and `AUX` on controllers that have both `MAIN` and `AUX` ports (i.e. FCs that have an IO board).
|
||||
|
||||
:::warning **Limited hardware support**
|
||||
This feature is only supported on flight controllers with the following processors:
|
||||
|
||||
- STM32H7: First four FMU outputs
|
||||
- Must be connected to the first 4 FMU outputs, and these outputs must also be mapped to the same timer.
|
||||
- [KakuteH7](../flight_controller/kakuteh7v2.md) is not supported because the outputs are not mapped to the same timer.
|
||||
- [i.MXRT](../flight_controller/nxp_mr_vmu_rt1176.md) (V6X-RT & Tropic): 8 FMU outputs.
|
||||
|
||||
No other boards are supported.
|
||||
:::
|
||||
|
||||
### Configuration {#bidirectional-dshot-configuration}
|
||||
|
||||
To enable bidirectional DShot, set the [DSHOT_BIDIR_EN](../advanced_config/parameter_reference.md#DSHOT_BIDIR_EN) parameter.
|
||||
|
||||
The system calculates actual motor RPM from the received eRPM data using the [MOT_POLE_COUNT](../advanced_config/parameter_reference.md#MOT_POLE_COUNT) parameter.
|
||||
This parameter must be set correctly for accurate RPM reporting.
|
||||
|
||||
@@ -204,7 +204,7 @@ Please continue reading for [upgrade instructions](#upgrade-guide).
|
||||
|
||||
### Rover
|
||||
|
||||
- [Aion R1](../frames_rover/aion_r1.md)<Badge type="warning" text="Experimental"/>: ESC Driver for Roboclaw motor controller.
|
||||
- [Aion R1](../complete_vehicles_rover/aion_r1.md)<Badge type="warning" text="Experimental"/>: ESC Driver for Roboclaw motor controller.
|
||||
This comes with build instructions and support for the Aion R1, a new differential drive rover, along with information about integrating the Roboclaw motor controller.
|
||||
- Add dedicated Rover build variants to px4/fmu-{v5,v5x,v6c,v6x} ([PX4-Autopilot#22675](https://github.com/PX4/PX4-Autopilot/pull/22675))
|
||||
|
||||
|
||||
@@ -167,13 +167,13 @@ Please continue reading for [upgrade instructions](#upgrade-guide).
|
||||
This release contains a major rework for the rover support in PX4:
|
||||
|
||||
- Complete restructure of the [rover related documentation](../frames_rover/index.md).
|
||||
- New firmware build specifically for [rovers](../frames_rover/index.md#flashing-the-rover-build).
|
||||
- New module dedicated to [Ackermann rovers](../frames_rover/ackermann.md):
|
||||
- The module currently supports [manual mode](../flight_modes_rover/ackermann.md#manual-mode), [acro mode](../flight_modes_rover/ackermann.md#acro-mode), [position mode](../flight_modes_rover/ackermann.md#position-mode) and [auto modes](../flight_modes_rover/ackermann.md#auto-modes).
|
||||
- New module dedicated to [differential rovers](../frames_rover/differential.md):
|
||||
- The module currently supports [manual mode](../flight_modes_rover/differential.md#manual-mode), [acro mode](../flight_modes_rover/differential.md#acro-mode), [stabilized mode](../flight_modes_rover/differential.md#stabilized-mode), [position mode](../flight_modes_rover/differential.md#position-mode) and [auto modes](../flight_modes_rover/differential.md#auto-modes).
|
||||
- New module dedicated to [mecanum rovers](../frames_rover/mecanum.md):
|
||||
- The module currently supports [manual mode](../flight_modes_rover/mecanum.md#manual-mode), [acro mode](../flight_modes_rover/mecanum.md#acro-mode), [stabilized mode](../flight_modes_rover/mecanum.md#stabilized-mode), [position mode](../flight_modes_rover/mecanum.md#position-mode) and [auto modes](../flight_modes_rover/mecanum.md#auto-modes).
|
||||
- New firmware build specifically for [rovers](../config_rover/index.md#flashing-the-rover-build).
|
||||
- New module dedicated to [Ackermann rovers](../frames_rover/index.md#ackermann):
|
||||
- The module currently supports [manual mode](../flight_modes_rover/manual.md#manual-mode), [acro mode](../flight_modes_rover/manual.md#acro-mode), [stabilized mode](../flight_modes_rover/manual.md#stabilized-mode), [position mode](../flight_modes_rover/manual.md#position-mode) and [auto modes](../flight_modes_rover/auto.md).
|
||||
- New module dedicated to [differential rovers](../frames_rover/index.md#differential):
|
||||
- The module currently supports [manual mode](../flight_modes_rover/manual.md#manual-mode), [acro mode](../flight_modes_rover/manual.md#acro-mode), [stabilized mode](../flight_modes_rover/manual.md#stabilized-mode), [position mode](../flight_modes_rover/manual.md#position-mode) and [auto modes](../flight_modes_rover/auto.md).
|
||||
- New module dedicated to [mecanum rovers](../frames_rover/index.md#mecanum):
|
||||
- The module currently supports [manual mode](../flight_modes_rover/manual.md#manual-mode), [acro mode](../flight_modes_rover/manual.md#acro-mode), [stabilized mode](../flight_modes_rover/manual.md#stabilized-mode), [position mode](../flight_modes_rover/manual.md#position-mode) and [auto modes](../flight_modes_rover/auto.md).
|
||||
- Added rover-specific firmware build (`50000–52000`) for Ackermann, differential and mecanum rovers
|
||||
- Restructure of the [rover airframe](../airframes/airframe_reference.md#rover) numbering convention ([PX4-Autopilot#23506](https://github.com/PX4/PX4-Autopilot/pull/23506)).
|
||||
This also introduces several [new rover airframes](../airframes/airframe_reference.md#rover):
|
||||
@@ -181,7 +181,7 @@ This release contains a major rework for the rover support in PX4:
|
||||
- Generic Ackermann Rover `51000`.
|
||||
- Axial SCX10 2 Trail Honcho `51001`.
|
||||
- Generic Mecanum Rover `52000`.
|
||||
- Library for the [pure pursuit guidance algorithm](../config_rover/differential.md#pure-pursuit-guidance-logic) that is shared by all the rover modules.
|
||||
- Library for the [pure pursuit guidance algorithm](../config_rover/position_tuning.md#pure-pursuit-guidance-logic-info-only) that is shared by all the rover modules.
|
||||
- [Simulation](../frames_rover/index.md#simulation) for differential-steering and Ackermann rovers in gazebo (for release notes see `r1_rover` and `rover_ackermann` in [simulation](#simulation)).
|
||||
- Deprecation of the [rover position control](../frames_rover/rover_position_control.md) module: Note that the legacy rover module still exists but has been superseded by the new dedicated modules.
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ Please continue reading for [upgrade instructions](#upgrade-guide).
|
||||
|
||||
### Common
|
||||
|
||||
- TBD
|
||||
- [QGroundControl Bootloader Update](../advanced_config/bootloader_update.md#qgc-bootloader-update-sys-bl-update) via the [SYS_BL_UPDATE](../advanced_config/parameter_reference.md#SYS_BL_UPDATE) parameter has been re-enabled after being broken for a number of releases. ([PX4-Autopilot#25032: build: romf: fix generation of rc.board_bootloader_upgrade](https://github.com/PX4/PX4-Autopilot/pull/25032)).
|
||||
|
||||
### Control
|
||||
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
|
||||
It is recommended for:
|
||||
|
||||
* Connecting offboard components that require low bandwidth and low latency communication, e.g. [rangefinders](../sensor/rangefinders.md), [magnetometers](../gps_compass/magnetometer.md), [airspeed sensors](../sensor/airspeed.md) and [tachometers](../sensor/tachometers.md) .
|
||||
* Connecting offboard components that require low bandwidth and low latency communication, e.g. [rangefinders](../sensor/rangefinders.md), [magnetometers](../gps_compass/magnetometer.md), [airspeed sensors](../sensor/airspeed.md) and [tachometers](../sensor/tachometers.md).
|
||||
* Compatibility with peripheral devices that only support I2C.
|
||||
* Allowing multiple devices to attach to a single bus, which is useful for conserving ports.
|
||||
|
||||
I2C allows multiple master devices to connect to multiple slave devices using only 2 wires per connection (SDA, SCL).
|
||||
in theory a bus can support 128 devices, each accessed via its unique address.
|
||||
in theory, a bus can support 128 devices, each accessed via its unique address.
|
||||
|
||||
::: info
|
||||
UAVCAN would normally be preferred where higher data rates are required, and on larger vehicles where sensors are be mounted further from the flight controller.
|
||||
UAVCAN would normally be preferred where higher data rates are required, and on larger vehicles where sensors are mounted further from the flight controller.
|
||||
:::
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ UAVCAN would normally be preferred where higher data rates are required, and on
|
||||
|
||||
I2C uses a pair of wires: SDA (serial data) and SCL (serial clock).
|
||||
The bus is of open-drain type, meaning that devices ground the data line.
|
||||
It uses a pullup resistor to push it to `log.1` (idle state) - every wire has it usually located on the bus terminating devices.
|
||||
It uses a pull-up resistor to push it to `log.1` (idle state) - every wire has it usually located on the bus terminating devices.
|
||||
One bus can connect to multiple I2C devices.
|
||||
The individual devices are connected without any crossing.
|
||||
|
||||
@@ -52,41 +52,44 @@ If two I2C devices on a bus have the same ID there will be a clash, and neither
|
||||
This usually occurs because a user needs to attach two sensors of the same type to the bus, but may also happen if devices use duplicate addresses by default.
|
||||
|
||||
Particular I2C devices may allow you to select a new address for one of the devices to avoid the clash.
|
||||
Some devices do not support this option, or do not have broad options for the addresses that can be used (i.e. cannot be used to avoid a clash).
|
||||
Some devices do not support this option or do not have broad options for the addresses that can be used (i.e. cannot be used to avoid a clash).
|
||||
|
||||
If you can't change the addresses, one option is to use an [I2C Address Translator](#i2c-address-translators).
|
||||
|
||||
### Insufficient Transfer Capacity
|
||||
|
||||
The bandwidth available for each individual device generally decreases as more devices are added. The exact decrease depends on the bandwidth used by each individual device. Therefore it is possible to connect many low bandwidth devices, like [tachometers](../sensor/tachometers.md).
|
||||
The bandwidth available for each device generally decreases as more devices are added. The exact decrease depends on the bandwidth used by each individual device. Therefore it is possible to connect many low-bandwidth devices, like [tachometers](../sensor/tachometers.md).
|
||||
If too many devices are added, it can cause transmission errors and network unreliability.
|
||||
|
||||
There are several ways to reduce the problem:
|
||||
* Dividing the devices into groups, each with approximately the same number of devices and connecting each group to one autopilot port
|
||||
* Dividing the devices into groups, each with approximately the same number of devices, and connecting each group to one autopilot port
|
||||
* Increase bus speed limit (usually set to 100kHz for external I2C bus)
|
||||
|
||||
### Excessive Wiring Capacitance
|
||||
|
||||
The electrical capacity of bus wiring increases as more devices/wires are added. The exact decrease depends on total length of bus wiring and wiring specific capacitance.
|
||||
The electrical capacity of bus wiring increases as more devices/wires are added. The exact decrease depends on the total length of bus wiring and wiring-specific capacitance.
|
||||
The problem can be analyzed using an oscilloscope, where we see that the edges of SDA/SCL signals are no longer sharp.
|
||||
|
||||
There are several ways to reduce the problem:
|
||||
* Dividing the devices into groups, each with approximately the same number of devices and connecting each group to one autopilot port
|
||||
* Using the shortest and the highest quality I2C cables possible
|
||||
* Separating the devices with a weak open-drain driver to smaller bus with lower capacitance
|
||||
* [I2C Bus Accelerators](#i2c-bus-accelerators)
|
||||
* Dividing the devices into groups, each with approximately the same number of devices, and connecting each group to one autopilot port
|
||||
* Using the shorter and higher quality I2C cables, see the [cable wiring page](../assembly/cable_wiring.md#i2c-cables) for details
|
||||
* Separating the devices with a weak open-drain driver to smaller buses with lower capacitance by using [I2C Bus Accelerators](#i2c-bus-accelerators)
|
||||
|
||||
## I2C Bus Accelerators
|
||||
|
||||
I2C bus accelerators are separate circuits that can be used to support longer wiring length on an I2C bus.
|
||||
I2C bus accelerators are separate circuits that can be used to support longer wiring lengths on an I2C bus.
|
||||
They work by physically dividing an I2C network into 2 parts and using their own transistors to amplify I2C signals.
|
||||
|
||||
Available accelerators include:
|
||||
- [Thunderfly TFI2CEXT01](https://github.com/ThunderFly-aerospace/TFI2CEXT01):
|
||||
- [Thunderfly TFI2CEXT01](https://docs.thunderfly.cz/avionics/TFI2CEXT01/):
|
||||

|
||||
- This has Dronecode connectors and is hence very easy to add to a Pixhawk I2C setup.
|
||||
- The module has no settings (it works out of the box).
|
||||
|
||||
### I2C Level Converter function
|
||||
|
||||
Some I2C devices have 5V on the data lines, while the Pixhawk connector standard port expects these lines to be 3.3 V.
|
||||
You can use the TFI2CEXT01 as a level converter to connect 5V devices to a Pixhawk I2C port. This feature is possible because the SCL and SDA lines of TFI2CEXT01 are 5V tolerant.
|
||||
|
||||
## I2C Address Translators
|
||||
|
||||
@@ -96,21 +99,12 @@ The work by listening for I2C communication and transforming the address when a
|
||||
Supported I2C Address Translators include:
|
||||
|
||||
- [Thunderfly TFI2CADT01](../sensor_bus/translator_tfi2cadt.md)
|
||||
|
||||
- This has Dronecode connectors and is very easy to add to a Pixhawk I2C setup.
|
||||
|
||||
## I2C Bus Splitters
|
||||
|
||||
I2C Bus Splitters are circuit boards that split the I2C port on your flight controller into multiple ports.
|
||||
They are useful if you want to use multiple I2C peripherals on a flight controller that has only one I2C port (or too few), such as an airspeed sensor and a distance sensor.
|
||||
|
||||
You can find an appropriate board using an internet search.
|
||||
|
||||
## I2C Level Converter
|
||||
|
||||
Some I2C devices have 5V on the data lines, while the Pixhawk connector standard port expects these lines to be 3.3 V.
|
||||
You can use an I2C level converter to connect 5V devices to a Pixhawk I2C port.
|
||||
|
||||
You can find an appropriate covnerter using an internet search.
|
||||
I2C Bus Splitters are devices that split the I2C port on your flight controller into multiple connectors.
|
||||
They are useful if you want to use multiple I2C peripherals on a flight controller that has only one I2C port (or too few), such as an airspeed sensor and a distance sensor. Both devices [I2C Address Translator](../sensor_bus/translator_tfi2cadt.md) and [I2C Bus Accelerators](#i2c-bus-accelerators) could also be used as I2C splitters because they have multiple I2C connectors for connecting additional I2C devices.
|
||||
|
||||
## I2C Development
|
||||
|
||||
|
||||