Browse Source

mixers: Multirotor remove text roll, pitch, yaw scaling and idle speed

sbg
Daniel Agar 5 years ago
parent
commit
26bac78eaf
  1. 2
      ROMFS/px4fmu_common/init.d/airframes/4080_zmr250
  2. 2
      ROMFS/px4fmu_common/mixers-sitl/quad_x_vtol.main.mix
  3. 2
      ROMFS/px4fmu_common/mixers-sitl/standard_vtol_sitl.main.mix
  4. 2
      ROMFS/px4fmu_common/mixers-sitl/tiltrotor_sitl.main.mix
  5. 2
      ROMFS/px4fmu_common/mixers/CMakeLists.txt
  6. 2
      ROMFS/px4fmu_common/mixers/babyshark.main.mix
  7. 2
      ROMFS/px4fmu_common/mixers/claire.main.mix
  8. 2
      ROMFS/px4fmu_common/mixers/deltaquad.main.mix
  9. 2
      ROMFS/px4fmu_common/mixers/dodeca_bottom_cox.aux.mix
  10. 2
      ROMFS/px4fmu_common/mixers/dodeca_top_cox.main.mix
  11. 2
      ROMFS/px4fmu_common/mixers/firefly6.main.mix
  12. 2
      ROMFS/px4fmu_common/mixers/hexa_+.main.mix
  13. 2
      ROMFS/px4fmu_common/mixers/hexa_cox.main.mix
  14. 2
      ROMFS/px4fmu_common/mixers/hexa_x.main.mix
  15. 1
      ROMFS/px4fmu_common/mixers/ocpoc_quad_x.main.mix
  16. 2
      ROMFS/px4fmu_common/mixers/octo_+.main.mix
  17. 2
      ROMFS/px4fmu_common/mixers/octo_cox.main.mix
  18. 2
      ROMFS/px4fmu_common/mixers/octo_cox_w.main.mix
  19. 2
      ROMFS/px4fmu_common/mixers/octo_x.main.mix
  20. 2
      ROMFS/px4fmu_common/mixers/quad_+.main.mix
  21. 2
      ROMFS/px4fmu_common/mixers/quad_+_vtol.main.mix
  22. 2
      ROMFS/px4fmu_common/mixers/quad_dc.main.mix
  23. 2
      ROMFS/px4fmu_common/mixers/quad_h.main.mix
  24. 2
      ROMFS/px4fmu_common/mixers/quad_s250aq.main.mix
  25. 2
      ROMFS/px4fmu_common/mixers/quad_w.main.mix
  26. 2
      ROMFS/px4fmu_common/mixers/quad_x.main.mix
  27. 2
      ROMFS/px4fmu_common/mixers/quad_x_cw.main.mix
  28. 2
      ROMFS/px4fmu_common/mixers/quad_x_vtol.main.mix
  29. 2
      ROMFS/px4fmu_common/mixers/standard_vtol_hitl.main.mix
  30. 2
      ROMFS/px4fmu_common/mixers/tri_y_yaw+.main.mix
  31. 2
      ROMFS/px4fmu_common/mixers/tri_y_yaw-.main.mix
  32. 2
      ROMFS/px4fmu_common/mixers/vtol_convergence.main.mix
  33. 2
      ROMFS/px4fmu_common/mixers/vtol_tailsitter_duo.main.mix
  34. 11
      ROMFS/px4fmu_common/mixers/zmr250.main.mix
  35. 2
      ROMFS/px4fmu_test/mixers/hexa_x.main.mix
  36. 2
      ROMFS/px4fmu_test/mixers/octo_x.main.mix
  37. 2
      ROMFS/px4fmu_test/mixers/quad_+.main.mix
  38. 2
      ROMFS/px4fmu_test/mixers/quad_+_vtol.main.mix
  39. 2
      ROMFS/px4fmu_test/mixers/quad_test.mix
  40. 2
      ROMFS/px4fmu_test/mixers/quad_x.main.mix
  41. 2
      ROMFS/px4fmu_test/mixers/vtol1_test.mix
  42. 2
      ROMFS/px4fmu_test/mixers/vtol2_test.mix
  43. 2
      ROMFS/px4fmu_test/mixers/vtol_convergence.main.mix
  44. 2
      posix-configs/ocpoc/px4.config
  45. 37
      src/lib/mixer/MultirotorMixer/MultirotorMixer.cpp
  46. 7
      src/lib/mixer/MultirotorMixer/MultirotorMixer.hpp

2
ROMFS/px4fmu_common/init.d/airframes/4080_zmr250

@ -14,7 +14,7 @@
sh /etc/init.d/rc.mc_defaults sh /etc/init.d/rc.mc_defaults
set MIXER zmr250 set MIXER quad_x
set PWM_OUT 1234 set PWM_OUT 1234
if [ $AUTOCNF = yes ] if [ $AUTOCNF = yes ]

2
ROMFS/px4fmu_common/mixers-sitl/quad_x_vtol.main.mix

@ -1,7 +1,7 @@
Mixer for the gazebo tailsitter model Mixer for the gazebo tailsitter model
===================================== =====================================
R: 4x 10000 10000 10000 0 R: 4x
Z: Z:

2
ROMFS/px4fmu_common/mixers-sitl/standard_vtol_sitl.main.mix

@ -3,7 +3,7 @@ Mixer for standard vtol plane (SITL) with motor x configuration
This file defines a single mixer for a standard vtol plane (SITL gazebo) with motors in X configuration. The plane has two ailerons and one elevator. This file defines a single mixer for a standard vtol plane (SITL gazebo) with motors in X configuration. The plane has two ailerons and one elevator.
R: 4x 10000 10000 10000 0 R: 4x
# mixer for the pusher/puller throttle # mixer for the pusher/puller throttle
M: 1 M: 1

2
ROMFS/px4fmu_common/mixers-sitl/tiltrotor_sitl.main.mix

@ -3,7 +3,7 @@ Mixer for quad tiltrotor (x motor configuration)
This file defines a single mixer for a tiltrotor (SITL gazebo) with motors in X configuration. The plane has two ailerons and one elevator. This file defines a single mixer for a tiltrotor (SITL gazebo) with motors in X configuration. The plane has two ailerons and one elevator.
R: 4x 10000 10000 10000 0 R: 4x
# tilt servo motor 1 # tilt servo motor 1
M: 1 M: 1

2
ROMFS/px4fmu_common/mixers/CMakeLists.txt

@ -57,7 +57,6 @@ px4_add_romfs_files(
IO_pass.main.mix IO_pass.main.mix
mount.aux.mix mount.aux.mix
mount_legs.aux.mix mount_legs.aux.mix
ocpoc_quad_x.main.mix
octo_cox.main.mix octo_cox.main.mix
octo_cox_w.main.mix octo_cox_w.main.mix
octo_+.main.mix octo_+.main.mix
@ -84,7 +83,6 @@ px4_add_romfs_files(
vtol_convergence.main.mix vtol_convergence.main.mix
vtol_delta.aux.mix vtol_delta.aux.mix
wingwing.main.mix wingwing.main.mix
zmr250.main.mix
TF-AutoG2.main.mix TF-AutoG2.main.mix
uuv_x.main.mix uuv_x.main.mix
) )

2
ROMFS/px4fmu_common/mixers/babyshark.main.mix

@ -35,4 +35,4 @@ S: 1 1 -8000 -8000 0 -10000 10000
Quad motors 1 - 4 Quad motors 1 - 4
----------------- -----------------
R: 4x 10000 10000 10000 0 R: 4x

2
ROMFS/px4fmu_common/mixers/claire.main.mix

@ -4,4 +4,4 @@
#=========================== #===========================
R: 4x 10000 10000 10000 0 R: 4x

2
ROMFS/px4fmu_common/mixers/deltaquad.main.mix

@ -4,7 +4,7 @@
Quad motors 1 - 4 Quad motors 1 - 4
------------- -------------
R: 4x 10000 10000 10000 0 R: 4x
Elevon mixers Elevon mixers

2
ROMFS/px4fmu_common/mixers/dodeca_bottom_cox.aux.mix

@ -1,3 +1,3 @@
# Dodeca Cox # Dodeca Cox
R: 6a 10000 10000 10000 0 R: 6a

2
ROMFS/px4fmu_common/mixers/dodeca_top_cox.main.mix

@ -1,3 +1,3 @@
# Dodeca Cox # Dodeca Cox
R: 6m 10000 10000 10000 0 R: 6m

2
ROMFS/px4fmu_common/mixers/firefly6.main.mix

@ -1,4 +1,4 @@
# FireFly6 mixer for PX4FMU # FireFly6 mixer for PX4FMU
# #
#=========================== #===========================
R: 6c 10000 10000 10000 0 R: 6c

2
ROMFS/px4fmu_common/mixers/hexa_+.main.mix

@ -1,3 +1,3 @@
# Hexa + # Hexa +
R: 6+ 10000 10000 10000 0 R: 6+

2
ROMFS/px4fmu_common/mixers/hexa_cox.main.mix

@ -1,3 +1,3 @@
# Hexa coaxial # Hexa coaxial
R: 6c 10000 10000 10000 0 R: 6c

2
ROMFS/px4fmu_common/mixers/hexa_x.main.mix

@ -1,4 +1,4 @@
# Hexa X # Hexa X
R: 6x 10000 10000 10000 0 R: 6x

1
ROMFS/px4fmu_common/mixers/ocpoc_quad_x.main.mix

@ -1 +0,0 @@
R: 4x 10000 10000 10000 1300

2
ROMFS/px4fmu_common/mixers/octo_+.main.mix

@ -1,3 +1,3 @@
# Octo + # Octo +
R: 8+ 10000 10000 10000 0 R: 8+

2
ROMFS/px4fmu_common/mixers/octo_cox.main.mix

@ -1,3 +1,3 @@
# Octo coaxial # Octo coaxial
R: 8c 10000 10000 10000 0 R: 8c

2
ROMFS/px4fmu_common/mixers/octo_cox_w.main.mix

@ -1,3 +1,3 @@
# Octo coaxial with wide arms # Octo coaxial with wide arms
R: 8cw 10000 10000 10000 0 R: 8cw

2
ROMFS/px4fmu_common/mixers/octo_x.main.mix

@ -1,3 +1,3 @@
# Octo X # Octo X
R: 8x 10000 10000 10000 0 R: 8x

2
ROMFS/px4fmu_common/mixers/quad_+.main.mix

@ -4,7 +4,7 @@ Multirotor mixer for PX4FMU
This file defines a single mixer for a quadrotor in the + configuration. All controls This file defines a single mixer for a quadrotor in the + configuration. All controls
are mixed 100%. are mixed 100%.
R: 4+ 10000 10000 10000 0 R: 4+
Gimbal / payload mixer for last two channels Gimbal / payload mixer for last two channels
----------------------------------------------------- -----------------------------------------------------

2
ROMFS/px4fmu_common/mixers/quad_+_vtol.main.mix

@ -4,7 +4,7 @@ Mixer for Tailsitter with + motor configuration and elevons
This file defines a single mixer for tailsitter with motors in X configuration. All controls This file defines a single mixer for tailsitter with motors in X configuration. All controls
are mixed 100%. are mixed 100%.
R: 4+ 10000 10000 10000 0 R: 4+
# mixer for the elevons # mixer for the elevons
M: 2 M: 2

2
ROMFS/px4fmu_common/mixers/quad_dc.main.mix

@ -3,4 +3,4 @@ Multirotor mixer
This file defines a single mixer for a quadrotor in DC wide arms configuration. All controls are mixed 100%. This file defines a single mixer for a quadrotor in DC wide arms configuration. All controls are mixed 100%.
R: 4dc 10000 10000 10000 0 R: 4dc

2
ROMFS/px4fmu_common/mixers/quad_h.main.mix

@ -4,7 +4,7 @@ Multirotor mixer for PX4FMU
This file defines a single mixer for a quadrotor in the H configuration. All controls This file defines a single mixer for a quadrotor in the H configuration. All controls
are mixed 100%. are mixed 100%.
R: 4h 10000 10000 10000 0 R: 4h
Gimbal / payload mixer for last two channels Gimbal / payload mixer for last two channels
----------------------------------------------------- -----------------------------------------------------

2
ROMFS/px4fmu_common/mixers/quad_s250aq.main.mix

@ -1,4 +1,4 @@
R: 4s 10000 10000 10000 0 R: 4s
M: 1 M: 1
S: 3 5 10000 10000 0 -10000 10000 S: 3 5 10000 10000 0 -10000 10000
M: 1 M: 1

2
ROMFS/px4fmu_common/mixers/quad_w.main.mix

@ -3,7 +3,7 @@ Multirotor mixer for PX4FMU
This file defines a single mixer for a quadrotor with a wide configuration. All controls are mixed 100%. This file defines a single mixer for a quadrotor with a wide configuration. All controls are mixed 100%.
R: 4w 10000 10000 10000 0 R: 4w
Gimbal / payload mixer for last two channels Gimbal / payload mixer for last two channels
----------------------------------------------------- -----------------------------------------------------

2
ROMFS/px4fmu_common/mixers/quad_x.main.mix

@ -1,4 +1,4 @@
R: 4x 10000 10000 10000 0 R: 4x
AUX1 Passthrough AUX1 Passthrough
M: 1 M: 1

2
ROMFS/px4fmu_common/mixers/quad_x_cw.main.mix

@ -1,4 +1,4 @@
# @board px4_fmu-v2 exclude # @board px4_fmu-v2 exclude
# Quad X with clock-wise motor assigment # Quad X with clock-wise motor assigment
R: 4xcw 10000 10000 10000 0 R: 4xcw

2
ROMFS/px4fmu_common/mixers/quad_x_vtol.main.mix

@ -4,7 +4,7 @@ Mixer for Tailsitter with x motor configuration and elevons
This file defines a single mixer for tailsitter with motors in X configuration. All controls This file defines a single mixer for tailsitter with motors in X configuration. All controls
are mixed 100%. are mixed 100%.
R: 4x 10000 10000 10000 0 R: 4x
# left elevon # left elevon
M: 2 M: 2

2
ROMFS/px4fmu_common/mixers/standard_vtol_hitl.main.mix

@ -3,7 +3,7 @@ Mixer for Standard VTOL (QuadPlane) with motor x configuration (Gazebo HITL)
# @board px4_fmu-v2 exclude # @board px4_fmu-v2 exclude
R: 4x 10000 10000 10000 0 R: 4x
# mixer for the pusher/puller throttle # mixer for the pusher/puller throttle
M: 1 M: 1

2
ROMFS/px4fmu_common/mixers/tri_y_yaw+.main.mix

@ -4,7 +4,7 @@
# Yaw Servo +Output ==> +Yaw Vehicle Rotation # Yaw Servo +Output ==> +Yaw Vehicle Rotation
# Motors # Motors
R: 3y 10000 10000 10000 0 R: 3y
# Yaw Servo # Yaw Servo
M: 1 M: 1

2
ROMFS/px4fmu_common/mixers/tri_y_yaw-.main.mix

@ -4,7 +4,7 @@
# Yaw Servo +Output ==> -Yaw Vehicle Rotation # Yaw Servo +Output ==> -Yaw Vehicle Rotation
# Motors # Motors
R: 3y 10000 10000 10000 0 R: 3y
# Yaw Servo # Yaw Servo
M: 1 M: 1

2
ROMFS/px4fmu_common/mixers/vtol_convergence.main.mix

@ -1,7 +1,7 @@
# E-flite Convergence Tricopter Y-Configuration Mixer # E-flite Convergence Tricopter Y-Configuration Mixer
# Motors # Motors
R: 3y 10000 10000 10000 0 R: 3y
Z: Z:

2
ROMFS/px4fmu_common/mixers/vtol_tailsitter_duo.main.mix

@ -13,7 +13,7 @@ Motor mixer
Channel 1 connects to the right (starboard) motor. Channel 1 connects to the right (starboard) motor.
Channel 2 connects to the left (port) motor. Channel 2 connects to the left (port) motor.
R: 2- 10000 10000 10000 0 R: 2-
Zero mixer (2x) Zero mixer (2x)
--------------- ---------------

11
ROMFS/px4fmu_common/mixers/zmr250.main.mix

@ -1,11 +0,0 @@
#
# @board px4_fmu-v2 exclude
#
# R: <geometry> <roll scale> <pitch scale> <yaw scale> <deadband>
R: 4x 7654 10000 10000 0
M: 1
S: 0 4 10000 10000 0 -10000 10000
M: 1
S: 0 5 10000 10000 0 -10000 10000

2
ROMFS/px4fmu_test/mixers/hexa_x.main.mix

@ -1,4 +1,4 @@
# Hexa X # Hexa X
R: 6x 10000 10000 10000 0 R: 6x

2
ROMFS/px4fmu_test/mixers/octo_x.main.mix

@ -1,3 +1,3 @@
# Octo X # Octo X
R: 8x 10000 10000 10000 0 R: 8x

2
ROMFS/px4fmu_test/mixers/quad_+.main.mix

@ -4,7 +4,7 @@ Multirotor mixer for PX4FMU
This file defines a single mixer for a quadrotor in the + configuration. All controls This file defines a single mixer for a quadrotor in the + configuration. All controls
are mixed 100%. are mixed 100%.
R: 4+ 10000 10000 10000 0 R: 4+
Gimbal / payload mixer for last two channels Gimbal / payload mixer for last two channels
----------------------------------------------------- -----------------------------------------------------

2
ROMFS/px4fmu_test/mixers/quad_+_vtol.main.mix

@ -4,7 +4,7 @@ Mixer for Tailsitter with + motor configuration and elevons
This file defines a single mixer for tailsitter with motors in X configuration. All controls This file defines a single mixer for tailsitter with motors in X configuration. All controls
are mixed 100%. are mixed 100%.
R: 4+ 10000 10000 10000 0 R: 4+
# mixer for the elevons # mixer for the elevons
M: 2 M: 2

2
ROMFS/px4fmu_test/mixers/quad_test.mix

@ -3,7 +3,7 @@ Multirotor mixer for TEST
This file defines a single mixer for a quadrotor with a wide configuration. All controls are mixed 100%. This file defines a single mixer for a quadrotor with a wide configuration. All controls are mixed 100%.
R: 4w 10000 10000 10000 0 R: 4w
Gimbal / payload mixer for last four channels Gimbal / payload mixer for last four channels
----------------------------------------------------- -----------------------------------------------------

2
ROMFS/px4fmu_test/mixers/quad_x.main.mix

@ -1,4 +1,4 @@
R: 4x 10000 10000 10000 0 R: 4x
M: 1 M: 1
O: 10000 10000 0 -10000 10000 O: 10000 10000 0 -10000 10000
S: 3 5 10000 10000 0 -10000 10000 S: 3 5 10000 10000 0 -10000 10000

2
ROMFS/px4fmu_test/mixers/vtol1_test.mix

@ -1,6 +1,6 @@
# VTOL test mixer # VTOL test mixer
R: 2- 10000 10000 10000 0 R: 2-
Z: Z:
M: 2 M: 2
O: 10000 10000 0 -10000 10000 O: 10000 10000 0 -10000 10000

2
ROMFS/px4fmu_test/mixers/vtol2_test.mix

@ -1,7 +1,7 @@
# E-flite Convergence Tricopter Y-Configuration Mixer # E-flite Convergence Tricopter Y-Configuration Mixer
# Motors # Motors
R: 3y 10000 10000 10000 0 R: 3y
Z: Z:

2
ROMFS/px4fmu_test/mixers/vtol_convergence.main.mix

@ -1,7 +1,7 @@
# E-flite Convergence Tricopter Y-Configuration Mixer # E-flite Convergence Tricopter Y-Configuration Mixer
# Motors # Motors
R: 3y 10000 10000 10000 0 R: 3y
Z: Z:

2
posix-configs/ocpoc/px4.config

@ -46,6 +46,6 @@ mavlink stream -d /dev/ttyPS1 -s ATTITUDE -r 50
rc_input start -d /dev/ttyS2 rc_input start -d /dev/ttyS2
linux_pwm_out start -p ocpoc_mmap -m ROMFS/px4fmu_common/mixers/ocpoc_quad_x.main.mix linux_pwm_out start -p ocpoc_mmap -m ROMFS/px4fmu_common/mixers/quad_x.main.mix
logger start -t -b 200 logger start -t -b 200
mavlink boot_complete mavlink boot_complete

37
src/lib/mixer/MultirotorMixer/MultirotorMixer.cpp

@ -79,14 +79,9 @@ const char *_config_key[] = {"4x"};
//#include <debug.h> //#include <debug.h>
//#define debug(fmt, args...) syslog(fmt "\n", ##args) //#define debug(fmt, args...) syslog(fmt "\n", ##args)
MultirotorMixer::MultirotorMixer(ControlCallback control_cb, uintptr_t cb_handle, MultirotorGeometry geometry, MultirotorMixer::MultirotorMixer(ControlCallback control_cb, uintptr_t cb_handle, MultirotorGeometry geometry) :
float roll_scale, float pitch_scale, float yaw_scale, float idle_speed) :
MultirotorMixer(control_cb, cb_handle, _config_index[(int)geometry], _config_rotor_count[(int)geometry]) MultirotorMixer(control_cb, cb_handle, _config_index[(int)geometry], _config_rotor_count[(int)geometry])
{ {
_roll_scale = roll_scale;
_pitch_scale = pitch_scale;
_yaw_scale = yaw_scale;
_idle_speed = -1.0f + idle_speed * 2.0f; /* shift to output range here to avoid runtime calculation */
} }
MultirotorMixer::MultirotorMixer(ControlCallback control_cb, uintptr_t cb_handle, const Rotor *rotors, MultirotorMixer::MultirotorMixer(ControlCallback control_cb, uintptr_t cb_handle, const Rotor *rotors,
@ -98,7 +93,7 @@ MultirotorMixer::MultirotorMixer(ControlCallback control_cb, uintptr_t cb_handle
_tmp_array(new float[_rotor_count]) _tmp_array(new float[_rotor_count])
{ {
for (unsigned i = 0; i < _rotor_count; ++i) { for (unsigned i = 0; i < _rotor_count; ++i) {
_outputs_prev[i] = _idle_speed; _outputs_prev[i] = 0.f;
} }
} }
@ -113,24 +108,17 @@ MultirotorMixer::from_text(Mixer::ControlCallback control_cb, uintptr_t cb_handl
{ {
MultirotorGeometry geometry = MultirotorGeometry::MAX_GEOMETRY; MultirotorGeometry geometry = MultirotorGeometry::MAX_GEOMETRY;
char geomname[16]; char geomname[16];
int s[4];
int used;
/* enforce that the mixer ends with a new line */ /* enforce that the mixer ends with a new line */
if (!string_well_formed(buf, buflen)) { if (!string_well_formed(buf, buflen)) {
return nullptr; return nullptr;
} }
if (sscanf(buf, "R: %15s %d %d %d %d%n", geomname, &s[0], &s[1], &s[2], &s[3], &used) != 5) { if (sscanf(buf, "R: %15s", geomname) != 1) {
debug("multirotor parse failed on '%s'", buf); debug("multirotor parse failed on '%s'", buf);
return nullptr; return nullptr;
} }
if (used > (int)buflen) {
debug("OVERFLOW: multirotor spec used %d of %u", used, buflen);
return nullptr;
}
buf = skipline(buf, buflen); buf = skipline(buf, buflen);
if (buf == nullptr) { if (buf == nullptr) {
@ -155,14 +143,7 @@ MultirotorMixer::from_text(Mixer::ControlCallback control_cb, uintptr_t cb_handl
debug("adding multirotor mixer '%s'", geomname); debug("adding multirotor mixer '%s'", geomname);
return new MultirotorMixer( return new MultirotorMixer(control_cb, cb_handle, geometry);
control_cb,
cb_handle,
geometry,
s[0] / 10000.0f,
s[1] / 10000.0f,
s[2] / 10000.0f,
s[3] / 10000.0f);
} }
float float
@ -339,9 +320,9 @@ MultirotorMixer::mix(float *outputs, unsigned space)
return 0; return 0;
} }
float roll = math::constrain(get_control(0, 0) * _roll_scale, -1.0f, 1.0f); float roll = math::constrain(get_control(0, 0), -1.0f, 1.0f);
float pitch = math::constrain(get_control(0, 1) * _pitch_scale, -1.0f, 1.0f); float pitch = math::constrain(get_control(0, 1), -1.0f, 1.0f);
float yaw = math::constrain(get_control(0, 2) * _yaw_scale, -1.0f, 1.0f); float yaw = math::constrain(get_control(0, 2), -1.0f, 1.0f);
float thrust = math::constrain(get_control(0, 3), 0.0f, 1.0f); float thrust = math::constrain(get_control(0, 3), 0.0f, 1.0f);
// clean out class variable used to capture saturation // clean out class variable used to capture saturation
@ -375,7 +356,7 @@ MultirotorMixer::mix(float *outputs, unsigned space)
_thrust_factor)); _thrust_factor));
} }
outputs[i] = math::constrain(_idle_speed + (outputs[i] * (1.0f - _idle_speed)), _idle_speed, 1.0f); outputs[i] = math::constrain(outputs[i], 0.f, 1.f);
} }
// Slew rate limiting and saturation checking // Slew rate limiting and saturation checking
@ -389,7 +370,7 @@ MultirotorMixer::mix(float *outputs, unsigned space)
// clipping if airmode==roll/pitch), since in all other cases thrust will // clipping if airmode==roll/pitch), since in all other cases thrust will
// be reduced or boosted and we can keep the integrators enabled, which // be reduced or boosted and we can keep the integrators enabled, which
// leads to better tracking performance. // leads to better tracking performance.
if (outputs[i] < _idle_speed + 0.01f) { if (outputs[i] < 0.01f) {
if (_airmode == Airmode::disabled) { if (_airmode == Airmode::disabled) {
clipping_low_roll_pitch = true; clipping_low_roll_pitch = true;
clipping_low_yaw = true; clipping_low_yaw = true;

7
src/lib/mixer/MultirotorMixer/MultirotorMixer.hpp

@ -79,8 +79,7 @@ public:
* tuned to ensure that rotors never stall at the * tuned to ensure that rotors never stall at the
* low end of their control range. * low end of their control range.
*/ */
MultirotorMixer(ControlCallback control_cb, uintptr_t cb_handle, MultirotorGeometry geometry, MultirotorMixer(ControlCallback control_cb, uintptr_t cb_handle, MultirotorGeometry geometry);
float roll_scale, float pitch_scale, float yaw_scale, float idle_speed);
/** /**
* Constructor (for testing). * Constructor (for testing).
@ -241,10 +240,6 @@ private:
void update_saturation_status(unsigned index, bool clipping_high, bool clipping_low_roll_pitch, bool clipping_low_yaw); void update_saturation_status(unsigned index, bool clipping_high, bool clipping_low_roll_pitch, bool clipping_low_yaw);
float _roll_scale{1.0f};
float _pitch_scale{1.0f};
float _yaw_scale{1.0f};
float _idle_speed{0.0f};
float _delta_out_max{0.0f}; float _delta_out_max{0.0f};
float _thrust_factor{0.0f}; float _thrust_factor{0.0f};

Loading…
Cancel
Save