diff --git a/ROMFS/px4fmu_common/init.d-posix/6101_hexa_x_tilt b/ROMFS/px4fmu_common/init.d-posix/6101_hexa_x_tilt new file mode 100644 index 00000000000..324b3b4d2e3 --- /dev/null +++ b/ROMFS/px4fmu_common/init.d-posix/6101_hexa_x_tilt @@ -0,0 +1,33 @@ +#!/bin/sh +# +# @name Hexarotor x with tilted arms +# +# @url http://theairlab.org/ +# +# @type Tilt-Hexarotor +# @class Copter +# +# @output AUX1 feed-through of RC AUX1 channel +# @output AUX2 feed-through of RC AUX2 channel +# @output AUX3 feed-through of RC AUX3 channel +# +# @maintainer Azarakhsh Keipour +# + +sh /etc/init.d/rc.mc_defaults + +if [ $AUTOCNF = yes ] +then + param set MC_PITCHRATE_P 0.2 + param set MC_ROLLRATE_P 0.2 + param set MPC_Z_VEL_I 0.15 + param set MPC_Z_VEL_P 0.6 + + param set RTL_DESCEND_ALT 5.0 + param set RTL_LAND_DELAY 5 +fi + +set MAV_TYPE 13 + +# Set mixer +set MIXER hexa_tilt_x diff --git a/ROMFS/px4fmu_common/init.d-posix/6101_hexa_x_tilt.post b/ROMFS/px4fmu_common/init.d-posix/6101_hexa_x_tilt.post new file mode 100644 index 00000000000..1d96d61fe96 --- /dev/null +++ b/ROMFS/px4fmu_common/init.d-posix/6101_hexa_x_tilt.post @@ -0,0 +1 @@ +mavlink stream -r 250 -s HIGHRES_IMU -u 14556 diff --git a/ROMFS/px4fmu_common/init.d/airframes/6100_hexa_tilt_x b/ROMFS/px4fmu_common/init.d/airframes/6100_hexa_tilt_x index 679f6bc5e0d..2157fc5a8bd 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/6100_hexa_tilt_x +++ b/ROMFS/px4fmu_common/init.d/airframes/6100_hexa_tilt_x @@ -13,16 +13,40 @@ # @output MAIN4 motor 4 # @output MAIN5 motor 5 # @output MAIN6 motor 6 -# -# @output AUX1 feed-through of RC AUX1 channel -# @output AUX2 feed-through of RC AUX2 channel -# @output AUX3 feed-through of RC AUX3 channel + # # @maintainer Azarakhsh Keipour # sh /etc/init.d/rc.mc_defaults +if [ $AUTOCNF == yes ] +then + param set MC_PITCH_P 4.0 + param set MC_PITCHRATE_P 0.24 + param set MC_PITCHRATE_I 0.09 + param set MC_PITCHRATE_D 0.013 + param set MC_PITCHRATE_MAX 180.0 + + param set MC_ROLL_P 4.0 + param set MC_ROLLRATE_P 0.16 + param set MC_ROLLRATE_I 0.07 + param set MC_ROLLRATE_D 0.009 + param set MC_ROLLRATE_MAX 180.0 + + param set MC_YAW_P 3.0 + param set MC_YAWRATE_P 0.2 + param set MC_YAWRATE_I 0.1 + param set MC_YAWRATE_D 0.0 + param set MC_YAW_FF 0.5 + + param set MPC_HOLD_MAX_XY 0.25 + param set MPC_THR_MIN 0.15 + param set MPC_Z_VEL_MAX_DN 2.0 + + param set BAT_N_CELLS 4 +fi + # Set mixer set MIXER hexa_tilt_x diff --git a/platforms/posix/cmake/sitl_target.cmake b/platforms/posix/cmake/sitl_target.cmake index dbfda497253..54f1fcc680a 100644 --- a/platforms/posix/cmake/sitl_target.cmake +++ b/platforms/posix/cmake/sitl_target.cmake @@ -63,7 +63,7 @@ set(debuggers none ide gdb lldb ddd valgrind callgrind) set(models none shell if750a iris iris_opt_flow iris_vision iris_rplidar iris_irlock iris_obs_avoid iris_rtps solo typhoon_h480 plane - standard_vtol tailsitter tiltrotor + standard_vtol tailsitter tiltrotor hexa_x_tilt hippocampus rover) set(all_posix_vmd_make_targets) foreach(viewer ${viewers}) diff --git a/src/lib/mixer/MultirotorMixer/geometries/hex_tilt_x.toml b/src/lib/mixer/MultirotorMixer/geometries/hex_tilt_x.toml index c4041926867..b4c593712b6 100644 --- a/src/lib/mixer/MultirotorMixer/geometries/hex_tilt_x.toml +++ b/src/lib/mixer/MultirotorMixer/geometries/hex_tilt_x.toml @@ -1,57 +1,46 @@ # Hexacopter in with tilted arms [info] -key = "6tx" +key = "6xt" description = "Hexacopter with tilted arms" [rotor_default] +# No default axis, each rotor has different axis Ct = 1.0 Cm = 0.05 [[rotors]] -name = "front_right_top" -position = [0.707107, 0.707107, -0.1] -axis = [-0.35355, 0.35355, -0.866025] -direction = "CCW" - -[[rotors]] -name = "front_left_top" -position = [0.707107, -0.707107, -0.1] -axis = [-0.35355, -0.35355, -0.866025] +name = "mid_right" +axis = [0.5, 0.0, -0.866025] +position = [0.0, 1.0, 0.0] direction = "CW" [[rotors]] -name = "rear_left_top" -position = [-0.707107, -0.707107, -0.1] -axis = [0.35355, -0.35355, -0.866025] +name = "mid_left" +axis = [0.5, 0.0, -0.866025] +position = [0.0, -1.0, 0.0] direction = "CCW" [[rotors]] -name = "rear_right_top" -position = [-0.707107, 0.707107, -0.1] -axis = [0.35355, 0.35355, -0.866025] +name = "front_left" +axis = [-0.25, -0.4330125, -0.866025] +position = [0.866025, -0.5, 0.0] direction = "CW" [[rotors]] -name = "front_left_bottom" -position = [0.707107, -0.707107, 0.1] -axis = [0.35355, 0.35355, -0.866025] +name = "rear_right" +axis = [-0.25, -0.4330125, -0.866025] +position = [-0.866025, 0.5, 0.0] direction = "CCW" [[rotors]] -name = "front_right_bottom" -position = [0.707107, 0.707107, 0.1] -axis = [0.35355, -0.35355, -0.866025] -direction = "CW" - -[[rotors]] -name = "rear_right_bottom" -position = [-0.707107, 0.707107, 0.1] -axis = [-0.35355, -0.35355, -0.866025] +name = "front_right" +axis = [-0.25, 0.4330125, -0.866025] +position = [0.866025, 0.5, 0.0] direction = "CCW" [[rotors]] -name = "rear_left_bottom" -position = [-0.707107, -0.707107, 0.1] -axis = [-0.35355, 0.35355, -0.866025] +name = "rear_left" +axis = [-0.25, 0.4330125, -0.866025] +position = [-0.866025, -0.5, 0.0] direction = "CW"