Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Boat (USV) in SITL gazebo #14132

Merged
merged 1 commit into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions ROMFS/px4fmu_common/init.d-posix/1070_boat
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh
#
# @name Boat
#

sh /etc/init.d/rc.boat_defaults

if [ $AUTOCNF = yes ]
then
param set GND_L1_DIST 5
param set GND_SP_CTRL_MODE 1
param set GND_SPEED_D 3
param set GND_SPEED_I 0.001
param set GND_SPEED_IMAX 0.125
param set GND_SPEED_P 0.25
param set GND_SPEED_THR_SC 1
param set GND_SPEED_TRIM 4
param set GND_THR_CRUISE 0.3
param set GND_THR_IDLE 0
param set GND_THR_MAX 0.5
param set GND_THR_MIN 0

param set MIS_LTRMIN_ALT 0.01
param set MIS_TAKEOFF_ALT 0.01
param set NAV_ACC_RAD 0.5
param set NAV_LOITER_RAD 2

param set CBRK_AIRSPD_CHK 162128

param set GND_MAX_ANG 0.6
param set GND_WHEEL_BASE 2.0

fi

set MAV_TYPE 11

set MIXER_FILE etc/mixers-sitl/boat_sitl.main.mix
42 changes: 42 additions & 0 deletions ROMFS/px4fmu_common/init.d/rc.boat_defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/sh
#
# UGV default parameters.
#
# NOTE: Script variables are declared/initialized/unset in the rcS script.
#

set VEHICLE_TYPE rover

if [ $AUTOCNF = yes ]
then
#
# Default parameters for UGVs.
#
param set MIS_LTRMIN_ALT 0.01
param set MIS_TAKEOFF_ALT 0.01

param set NAV_DLL_ACT 0
param set NAV_ACC_RAD 2

# Temporary.
param set NAV_FW_ALT_RAD 1000
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_OUT 1234
15 changes: 15 additions & 0 deletions ROMFS/px4fmu_common/mixers-sitl/boat_sitl.main.mix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Mixer for SITL boat
=========================================================

Throttle of left propeller of boat on Output 0
---------------------------------------
M: 2
S: 0 2 10000 10000 0 -10000 10000
S: 0 3 10000 10000 0 -10000 10000


Throttle of right propeller of boat on Output 1
---------------------------------------
M: 2
S: 0 2 -10000 -10000 0 -10000 10000
S: 0 3 10000 10000 0 -10000 10000
2 changes: 1 addition & 1 deletion platforms/posix/cmake/sitl_target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ set(models none shell
if750a iris iris_opt_flow iris_opt_flow_mockup iris_vision iris_rplidar iris_irlock iris_obs_avoid iris_rtps solo typhoon_h480
plane plane_catapult
standard_vtol tailsitter tiltrotor
rover
rover boat
uuv_hippocampus)
set(all_posix_vmd_make_targets)
foreach(viewer ${viewers})
Expand Down