diff options
author | andre-nguyen <nguyen.apv@gmail.com> | 2014-06-04 00:06:55 -0400 |
---|---|---|
committer | andre-nguyen <nguyen.apv@gmail.com> | 2014-06-04 00:06:55 -0400 |
commit | 915ed5aa1f8ba52dcedc7f90c28dad03f39995ff (patch) | |
tree | 913caa318ee900b5c0c85cea56a073d5bfb19faa /src | |
parent | abbf57dac655bb0832052efea9841b7e41525799 (diff) | |
parent | f1b6a3f44f3c1ade07de2a1a996b055eccd5155c (diff) | |
download | px4-firmware-915ed5aa1f8ba52dcedc7f90c28dad03f39995ff.tar.gz px4-firmware-915ed5aa1f8ba52dcedc7f90c28dad03f39995ff.tar.bz2 px4-firmware-915ed5aa1f8ba52dcedc7f90c28dad03f39995ff.zip |
had the wrong setpoint structure
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/mc_pos_control/mc_pos_control_main.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/modules/mc_pos_control/mc_pos_control_main.cpp b/src/modules/mc_pos_control/mc_pos_control_main.cpp index 4d0c3216a..b73becf3c 100644 --- a/src/modules/mc_pos_control/mc_pos_control_main.cpp +++ b/src/modules/mc_pos_control/mc_pos_control_main.cpp @@ -685,6 +685,18 @@ MulticopterPositionControl::task_main() _pos_sp(1) = _offboard_control_pos_sp.y; _pos_sp(2) = _offboard_control_pos_sp.z; _att_sp.yaw_body = _offboard_control_pos_sp.yaw; + + /* Make sure position control is selected i.e. not only velocity control */ + if (_control_mode.flag_control_position_enabled) { + _pos_sp(0) = _offboard_control_pos_sp.x; + _pos_sp(1) = _offboard_control_pos_sp.y; + } + + if (_control_mode.flag_control_altitude_enabled) { + _pos_sp(2) = _offboard_control_pos_sp.z; + } + + _att_sp.yaw_body = _offboard_control_pos_sp.yaw; } else { /* AUTO */ |