aboutsummaryrefslogtreecommitdiff
path: root/src/modules/mc_att_control
diff options
context:
space:
mode:
authorRoman Bapst <romanbapst@yahoo.de>2014-11-10 17:01:59 +0100
committerRoman Bapst <romanbapst@yahoo.de>2014-11-10 17:01:59 +0100
commit0acdf5927b9e2dd2cc7375008af2d00cd7f9ba0e (patch)
tree2538345c3e3f6c5c588a9256ff00ea1e7e3c200b /src/modules/mc_att_control
parenta2ec2ec857f5b7584628c2a923c85d0b62b082dd (diff)
downloadpx4-firmware-0acdf5927b9e2dd2cc7375008af2d00cd7f9ba0e.tar.gz
px4-firmware-0acdf5927b9e2dd2cc7375008af2d00cd7f9ba0e.tar.bz2
px4-firmware-0acdf5927b9e2dd2cc7375008af2d00cd7f9ba0e.zip
cleaned up
Diffstat (limited to 'src/modules/mc_att_control')
-rw-r--r--src/modules/mc_att_control/mc_att_control_base.cpp44
1 files changed, 35 insertions, 9 deletions
diff --git a/src/modules/mc_att_control/mc_att_control_base.cpp b/src/modules/mc_att_control/mc_att_control_base.cpp
index b07a1a6be..baf2bfe65 100644
--- a/src/modules/mc_att_control/mc_att_control_base.cpp
+++ b/src/modules/mc_att_control/mc_att_control_base.cpp
@@ -1,8 +1,39 @@
-/*
- * mc_att_control_base.cpp
+/* Copyright (c) 2014 PX4 Development Team. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* 1. Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in
+* the documentation and/or other materials provided with the
+* distribution.
+* 3. Neither the name PX4 nor the names of its contributors may be
+* used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*
+****************************************************************************/
+
+/**
+ * @file mc_att_control_base.h
+ *
+ * @author Roman Bapst <bapstr@ethz.ch>
*
- * Created on: Sep 25, 2014
- * Author: roman
*/
#include "mc_att_control_base.h"
@@ -308,11 +339,9 @@ void MulticopterAttitudeControlBase::set_actuator_controls() {
_actuators.control[1] = (isfinite(_att_control(1))) ? _att_control(1) : 0.0f;
_actuators.control[2] = (isfinite(_att_control(2))) ? _att_control(2) : 0.0f;
_actuators.control[3] = (isfinite(_thrust_sp)) ? _thrust_sp : 0.0f;
- //_actuators.timestamp = hrt_absolute_time();
}
void MulticopterAttitudeControlBase::set_attitude(const Eigen::Quaternion<double> attitude) {
- // check if this is consistent !!!
math::Quaternion quat;
quat(0) = (float)attitude.w();
quat(1) = (float)attitude.x();
@@ -336,7 +365,6 @@ void MulticopterAttitudeControlBase::set_attitude(const Eigen::Quaternion<double
_v_att.R[2][2] = Rot(2,2);
_v_att.R_valid = true;
-
}
void MulticopterAttitudeControlBase::set_attitude_rates(const Eigen::Vector3d& angular_rate) {
@@ -344,7 +372,6 @@ void MulticopterAttitudeControlBase::set_attitude_rates(const Eigen::Vector3d& a
_v_att.rollspeed = angular_rate(0);
_v_att.pitchspeed = angular_rate(1);
_v_att.yawspeed = angular_rate(2);
-
}
void MulticopterAttitudeControlBase::set_attitude_reference(const Eigen::Vector4d& control_attitude_thrust_reference) {
@@ -365,7 +392,6 @@ void MulticopterAttitudeControlBase::set_attitude_reference(const Eigen::Vector4
_v_att_sp.R_body[0][2] = Rot_sp(0,2);
_v_att_sp.R_body[1][2] = Rot_sp(1,2);
_v_att_sp.R_body[2][2] = Rot_sp(2,2);
-
}
void MulticopterAttitudeControlBase::get_mixer_input(Eigen::Vector4d& motor_inputs) {