mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-13 11:17:35 +08:00
unmanned ground vehicle (UGV) controllers and Traxxas Stampede configuration (#7175)
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Traxxas stampede vxl 2wd
|
||||
#
|
||||
# @url https://traxxas.com/products/models/electric/stampede-vxl-tsm
|
||||
#
|
||||
# @type Rover
|
||||
#
|
||||
# @output MAIN2 steering
|
||||
# @output MAIN4 throttle
|
||||
#
|
||||
# @maintainer Marco Zorzi
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.gnd_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set BAT_N_CELLS 7
|
||||
|
||||
param set FW_AIRSPD_MIN 0
|
||||
param set FW_AIRSPD_TRIM 1
|
||||
param set FW_AIRSPD_MAX 3
|
||||
|
||||
param set NAV_ACC_RAD 0.5
|
||||
|
||||
param set MIS_LTRMIN_ALT 0.01
|
||||
param set MIS_TAKEOFF_ALT 0.01
|
||||
|
||||
param set EKF2_GBIAS_INIT 0.01
|
||||
param set EKF2_ANGERR_INIT 0.01
|
||||
param set EKF2_MAG_TYPE 1
|
||||
|
||||
param set GND_WR_P 2
|
||||
param set GND_WR_I 0.9674
|
||||
param set GND_WR_IMAX 0.1
|
||||
param set GND_WR_D 1.2
|
||||
param set GND_SP_CTRL_MODE 1
|
||||
param set GND_L1_DIST 10
|
||||
param set GND_THR_IDLE 0
|
||||
param set GND_THR_CRUISE 0
|
||||
param set GND_THR_MAX 0.5
|
||||
param set GND_THR_MIN 0
|
||||
param set GND_SPEED_P 0.25
|
||||
param set GND_SPEED_I 0.001
|
||||
param set GND_SPEED_D 3
|
||||
param set GND_SPEED_IMAX 0.125
|
||||
param set GND_SPEED_THR_SC 1
|
||||
|
||||
fi
|
||||
|
||||
# Configure this as ugv
|
||||
set MAV_TYPE 10
|
||||
# Set mixer
|
||||
set MIXER stampede
|
||||
|
||||
# Provide ESC a constant 1500 us pulse
|
||||
set PWM_DISARMED 1500
|
||||
set PWM_MAIN_REV2 1
|
||||
set PWM_MAX 2000
|
||||
set PWM_MIN 1000
|
||||
@@ -1,6 +1,6 @@
|
||||
#!nsh
|
||||
|
||||
set VEHICLE_TYPE rover
|
||||
set VEHICLE_TYPE ugv
|
||||
|
||||
# This section can be enabled once tuning parameters for this particular
|
||||
# rover model are known. It allows to configure default gains via the GUI
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#!nsh
|
||||
#
|
||||
# Standard apps for unmanned ground vehicles (UGV)
|
||||
#
|
||||
|
||||
#
|
||||
# Start the attitude and position estimator
|
||||
#
|
||||
ekf2 start
|
||||
#attitude_estimator_q start
|
||||
#local_position_estimator start
|
||||
|
||||
|
||||
#
|
||||
# Start attitude controllers
|
||||
#
|
||||
gnd_att_control start
|
||||
gnd_pos_control start
|
||||
|
||||
|
||||
#
|
||||
# Start Land Detector
|
||||
#
|
||||
land_detector start ugv
|
||||
@@ -0,0 +1,32 @@
|
||||
#!nsh
|
||||
|
||||
set VEHICLE_TYPE ugv
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
#
|
||||
# Default parameters for UGVs
|
||||
#
|
||||
param set NAV_DLL_ACT 0
|
||||
param set NAV_ACC_RAD 2.0
|
||||
|
||||
# temporary
|
||||
param set NAV_FW_ALT_RAD 1000
|
||||
|
||||
param set MIS_LTRMIN_ALT 0.01
|
||||
param set MIS_TAKEOFF_ALT 0.01
|
||||
fi
|
||||
|
||||
# Enable servo output on pins 3 and 4 (steering and thrust)
|
||||
# but also include 1+2 as they form together one output group
|
||||
# and need to be set together.
|
||||
set PWM_OUT 1234
|
||||
|
||||
# PWM Hz - 50 Hz is the normal rate in RC cars, higher rates
|
||||
# may damage analog servos.
|
||||
set PWM_RATE 50
|
||||
|
||||
# This is the gimbal pass mixer
|
||||
set MIXER_AUX pass
|
||||
set PWM_AUX_RATE 50
|
||||
set PWM_AUX_OUT 1234
|
||||
@@ -1042,20 +1042,29 @@ then
|
||||
fi
|
||||
|
||||
#
|
||||
# Rover setup
|
||||
# UGV setup
|
||||
#
|
||||
if [ $VEHICLE_TYPE == rover ]
|
||||
if [ $VEHICLE_TYPE == ugv ]
|
||||
then
|
||||
# 10 is MAV_TYPE_GROUND_ROVER
|
||||
set MAV_TYPE 10
|
||||
if [ $MIXER == none ]
|
||||
then
|
||||
# Set default mixer for UGV if not defined
|
||||
set MIXER stampede
|
||||
fi
|
||||
|
||||
if [ $MAV_TYPE == none ]
|
||||
then
|
||||
# Use MAV_TYPE = 10 (UGV) if not defined
|
||||
set MAV_TYPE 10
|
||||
fi
|
||||
|
||||
param set MAV_TYPE ${MAV_TYPE}
|
||||
|
||||
# Load mixer and configure outputs
|
||||
sh /etc/init.d/rc.interface
|
||||
|
||||
# Start standard rover apps
|
||||
sh /etc/init.d/rc.axialracing_ax10_apps
|
||||
|
||||
param set MAV_TYPE 10
|
||||
# Start standard UGV apps
|
||||
sh /etc/init.d/rc.gnd_apps
|
||||
fi
|
||||
|
||||
#
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
Traxxas Stampede Rc Car mixer for PX4FMU
|
||||
===========================
|
||||
|
||||
Designed for Traxxas Stampede
|
||||
|
||||
This file defines mixers suitable for controlling a Traxxas Stampede rover using
|
||||
PX4FMU. The configuration assumes the steering is connected to PX4FMU
|
||||
servo outputs 1 and the motor speed control to output 3. Output 0 and 2 is
|
||||
assumed to be unused.
|
||||
|
||||
Inputs to the mixer come from channel group 0 (vehicle attitude), channels 2 (yaw), and 3 (thrust).
|
||||
|
||||
See the README for more information on the scaler format.
|
||||
|
||||
|
||||
Output 0
|
||||
---------------------------------------
|
||||
Z:
|
||||
|
||||
Steering mixer using roll on output 1
|
||||
---------------------------------------
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 2 10000 10000 0 -10000 10000
|
||||
|
||||
|
||||
Output 2
|
||||
---------------------------------------
|
||||
This mixer is empty.
|
||||
Z:
|
||||
|
||||
|
||||
Output 3
|
||||
---------------------------------------
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 10000 10000 0 -10000 10000
|
||||
@@ -1,37 +1,46 @@
|
||||
Mixer for SITL rover
|
||||
=========================================================
|
||||
|
||||
# mixer for the rudder
|
||||
Output 0
|
||||
---------------------------------------
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 0 10000 10000 0 -10000 10000
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 2 10000 10000 0 -10000 10000
|
||||
|
||||
# mixer for the rudder
|
||||
Output 1
|
||||
---------------------------------------
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 0 10000 10000 0 -10000 10000
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 2 10000 10000 0 -10000 10000
|
||||
|
||||
# mixer for the elevator
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 1 10000 10000 0 -10000 10000
|
||||
Output 2
|
||||
---------------------------------------
|
||||
Z:
|
||||
|
||||
# mixer for throttle
|
||||
Output 3
|
||||
---------------------------------------
|
||||
Z:
|
||||
|
||||
Output 4
|
||||
---------------------------------------
|
||||
Z:
|
||||
|
||||
Output 5
|
||||
---------------------------------------
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
S: 0 3 10000 10000 0 -10000 10000
|
||||
|
||||
# mixer for throttle
|
||||
Output 6
|
||||
---------------------------------------
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
S: 0 3 10000 10000 0 -10000 10000
|
||||
|
||||
# mixer for throttle
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
Output 7
|
||||
---------------------------------------
|
||||
Z:
|
||||
|
||||
# mixer for throttle
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
Output 8
|
||||
---------------------------------------
|
||||
Z:
|
||||
|
||||
Reference in New Issue
Block a user