50004_nxpcup_car_dfrobot_gpx
1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/sh
#
# @name NXP Cup car: DF Robot GPX
#
# @type Rover
# @class Rover
#
# @board px4_fmu-v2 exclude
#
# @output MAIN2 Steering servo
# @output MAIN3 Speed of left wheels
# @output MAIN4 Speed of right wheels
#
# @maintainer Katrin Moritz
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
#
. ${R}etc/init.d/rc.rover_defaults
param set-default BAT_N_CELLS 2
param set-default EKF2_GBIAS_INIT 0.01
param set-default EKF2_ANGERR_INIT 0.01
param set-default EKF2_MAG_TYPE 1
param set-default FW_AIRSPD_MIN 0
param set-default FW_AIRSPD_TRIM 1
param set-default FW_AIRSPD_MAX 3
param set-default GND_THR_CRUISE 0.3
param set-default GND_THR_MAX 0.5
# Differential drive acts like ackermann steering with a maximum turn angle of 60 degrees, or pi/3 radians
param set-default GND_MAX_ANG 1.042
param set-default GND_WHEEL_BASE 0.17
# TODO: Set to -1.0, to allow reversing. This will require many changes in the codebase
# to support negative throttle.
param set-default GND_THR_MIN 0.0
param set-default GND_SPEED_P 0.25
param set-default GND_SPEED_I 3
param set-default GND_SPEED_D 0.001
param set-default GND_SPEED_IMAX 0.125
param set-default GND_SPEED_THR_SC 1
param set-default MIS_LTRMIN_ALT 0.01
param set-default MIS_TAKEOFF_ALT 0.01
param set-default NAV_ACC_RAD 0.5
# Provide ESC a constant 1500 us pulse to idle
param set-default PWM_MAIN_DISARM 1500
param set-default PWM_MAIN_DIS3 1485
param set-default PWM_MAIN_DIS4 1485
param set-default PWM_MAIN_FAIL3 1485
param set-default PWM_MAIN_FAIL4 1485
param set-default PWM_MAIN_MAX 2000
param set-default PWM_MAIN_MIN 1000
param set-default PWM_MAIN_MIN3 970
param set-default PWM_MAIN_MIN4 970
# Enable Airspeed check circuit breaker because Rovers will have no airspeed sensor
param set-default CBRK_AIRSPD_CHK 162128
# Configure this as rover
set MAV_TYPE 10
# Set mixer
set MIXER rover_diff_and_servo
set PWM_MAIN_REV2 1