forked from Archive/PX4-Autopilot
Merge pull request #225 from PX4/sign_fix
Fix signs for fixed wing control
This commit is contained in:
commit
002fb1b4ea
|
@ -25,13 +25,13 @@ for the elevons.
|
||||||
|
|
||||||
M: 2
|
M: 2
|
||||||
O: 10000 10000 0 -10000 10000
|
O: 10000 10000 0 -10000 10000
|
||||||
S: 0 0 -5000 -8000 0 -10000 10000
|
S: 0 0 5000 8000 0 -10000 10000
|
||||||
S: 0 1 -8000 -8000 0 -10000 10000
|
S: 0 1 8000 8000 0 -10000 10000
|
||||||
|
|
||||||
M: 2
|
M: 2
|
||||||
O: 10000 10000 0 -10000 10000
|
O: 10000 10000 0 -10000 10000
|
||||||
S: 0 0 -8000 -5000 0 -10000 10000
|
S: 0 0 8000 5000 0 -10000 10000
|
||||||
S: 0 1 8000 8000 0 -10000 10000
|
S: 0 1 -8000 -8000 0 -10000 10000
|
||||||
|
|
||||||
Output 2
|
Output 2
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -23,13 +23,13 @@ for the elevons.
|
||||||
|
|
||||||
M: 2
|
M: 2
|
||||||
O: 10000 10000 0 -10000 10000
|
O: 10000 10000 0 -10000 10000
|
||||||
S: 0 0 3000 5000 0 -10000 10000
|
S: 0 0 -3000 -5000 0 -10000 10000
|
||||||
S: 0 1 5000 5000 0 -10000 10000
|
S: 0 1 -5000 -5000 0 -10000 10000
|
||||||
|
|
||||||
M: 2
|
M: 2
|
||||||
O: 10000 10000 0 -10000 10000
|
O: 10000 10000 0 -10000 10000
|
||||||
S: 0 0 5000 3000 0 -10000 10000
|
S: 0 0 -5000 -3000 0 -10000 10000
|
||||||
S: 0 1 -5000 -5000 0 -10000 10000
|
S: 0 1 5000 5000 0 -10000 10000
|
||||||
|
|
||||||
Output 2
|
Output 2
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -323,7 +323,7 @@ void BlockMultiModeBacksideAutopilot::update()
|
||||||
_att.rollspeed, _att.pitchspeed, _att.yawspeed
|
_att.rollspeed, _att.pitchspeed, _att.yawspeed
|
||||||
);
|
);
|
||||||
_actuators.control[CH_AIL] = _backsideAutopilot.getAileron();
|
_actuators.control[CH_AIL] = _backsideAutopilot.getAileron();
|
||||||
_actuators.control[CH_ELV] = - _backsideAutopilot.getElevator();
|
_actuators.control[CH_ELV] = _backsideAutopilot.getElevator();
|
||||||
_actuators.control[CH_RDR] = _backsideAutopilot.getRudder();
|
_actuators.control[CH_RDR] = _backsideAutopilot.getRudder();
|
||||||
_actuators.control[CH_THR] = _backsideAutopilot.getThrottle();
|
_actuators.control[CH_THR] = _backsideAutopilot.getThrottle();
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@ void BlockMultiModeBacksideAutopilot::update()
|
||||||
_att.rollspeed, _att.pitchspeed, _att.yawspeed);
|
_att.rollspeed, _att.pitchspeed, _att.yawspeed);
|
||||||
|
|
||||||
_actuators.control[CH_AIL] = _stabilization.getAileron();
|
_actuators.control[CH_AIL] = _stabilization.getAileron();
|
||||||
_actuators.control[CH_ELV] = - _stabilization.getElevator();
|
_actuators.control[CH_ELV] = _stabilization.getElevator();
|
||||||
_actuators.control[CH_RDR] = _stabilization.getRudder();
|
_actuators.control[CH_RDR] = _stabilization.getRudder();
|
||||||
_actuators.control[CH_THR] = _manual.throttle;
|
_actuators.control[CH_THR] = _manual.throttle;
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,6 +192,10 @@ controls_tick() {
|
||||||
unsigned mapped = conf[PX4IO_P_RC_CONFIG_ASSIGNMENT];
|
unsigned mapped = conf[PX4IO_P_RC_CONFIG_ASSIGNMENT];
|
||||||
ASSERT(mapped < MAX_CONTROL_CHANNELS);
|
ASSERT(mapped < MAX_CONTROL_CHANNELS);
|
||||||
|
|
||||||
|
/* invert channel if pitch - pulling the lever down means pitching up by convention */
|
||||||
|
if (mapped == 1) /* roll, pitch, yaw, throttle, override is the standard order */
|
||||||
|
scaled = -scaled;
|
||||||
|
|
||||||
r_rc_values[mapped] = SIGNED_TO_REG(scaled);
|
r_rc_values[mapped] = SIGNED_TO_REG(scaled);
|
||||||
assigned_channels |= (1 << mapped);
|
assigned_channels |= (1 << mapped);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue