Skip to content

Commit

Permalink
modify copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
ComerLater committed Aug 29, 2024
1 parent a3477f5 commit 9eceed8
Show file tree
Hide file tree
Showing 185 changed files with 29,512 additions and 34,142 deletions.
Original file line number Diff line number Diff line change
@@ -1,35 +1,12 @@
/****************************************************************************
/*****************************************************************
* _ __ __ ____ _ __ __
* / | / /___ _ __ / /_ / __ \ (_)/ /____ / /_
* / |/ // _ \ | |/_// __// /_/ // // // __ \ / __/
* / /| // __/_> < / /_ / ____// // // /_/ // /_
* /_/ |_/ \___//_/|_| \__//_/ /_//_/ \____/ \__/
*
* Copyright (c) 2017 Intel Corporation. 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.
*
****************************************************************************/
* Copyright All Reserved © 2015-2024 NextPilot Development Team
******************************************************************/
#include "ArmAuthorization.h"

#include <string.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,12 @@
/****************************************************************************
/*****************************************************************
* _ __ __ ____ _ __ __
* / | / /___ _ __ / /_ / __ \ (_)/ /____ / /_
* / |/ // _ \ | |/_// __// /_/ // // // __ \ / __/
* / /| // __/_> < / /_ / ____// // // /_/ // /_
* /_/ |_/ \___//_/|_| \__//_/ /_//_/ \____/ \__/
*
* Copyright (c) 2017 Intel Corporation. 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.
*
****************************************************************************/
* Copyright All Reserved © 2015-2024 NextPilot Development Team
******************************************************************/

#pragma once

Expand Down
116 changes: 41 additions & 75 deletions apps/controller/fw_att_control/ecl_controller.cpp
Original file line number Diff line number Diff line change
@@ -1,35 +1,12 @@
/****************************************************************************
/*****************************************************************
* _ __ __ ____ _ __ __
* / | / /___ _ __ / /_ / __ \ (_)/ /____ / /_
* / |/ // _ \ | |/_// __// /_/ // // // __ \ / __/
* / /| // __/_> < / /_ / ____// // // /_/ // /_
* /_/ |_/ \___//_/|_| \__//_/ /_//_/ \____/ \__/
*
* Copyright (c) 2013 Estimation and Control Library (ECL). 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 ECL 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.
*
****************************************************************************/
* Copyright All Reserved © 2015-2024 NextPilot Development Team
******************************************************************/

/**
* @file ecl_controller.cpp
Expand All @@ -52,68 +29,57 @@
#include <mathlib/mathlib.h>

ECL_Controller::ECL_Controller() :
_last_run(0),
_tc(0.1f),
_k_p(0.0f),
_k_i(0.0f),
_k_ff(0.0f),
_integrator_max(0.0f),
_max_rate(0.0f),
_last_output(0.0f),
_integrator(0.0f),
_euler_rate_setpoint(0.0f),
_body_rate_setpoint(0.0f)
{
_last_run(0),
_tc(0.1f),
_k_p(0.0f),
_k_i(0.0f),
_k_ff(0.0f),
_integrator_max(0.0f),
_max_rate(0.0f),
_last_output(0.0f),
_integrator(0.0f),
_euler_rate_setpoint(0.0f),
_body_rate_setpoint(0.0f) {
}

void ECL_Controller::reset_integrator()
{
_integrator = 0.0f;
void ECL_Controller::reset_integrator() {
_integrator = 0.0f;
}

void ECL_Controller::set_time_constant(float time_constant)
{
if (time_constant > 0.1f && time_constant < 3.0f) {
_tc = time_constant;
}
void ECL_Controller::set_time_constant(float time_constant) {
if (time_constant > 0.1f && time_constant < 3.0f) {
_tc = time_constant;
}
}

void ECL_Controller::set_k_p(float k_p)
{
_k_p = k_p;
void ECL_Controller::set_k_p(float k_p) {
_k_p = k_p;
}

void ECL_Controller::set_k_i(float k_i)
{
_k_i = k_i;
void ECL_Controller::set_k_i(float k_i) {
_k_i = k_i;
}

void ECL_Controller::set_k_ff(float k_ff)
{
_k_ff = k_ff;
void ECL_Controller::set_k_ff(float k_ff) {
_k_ff = k_ff;
}

void ECL_Controller::set_integrator_max(float max)
{
_integrator_max = max;
void ECL_Controller::set_integrator_max(float max) {
_integrator_max = max;
}

void ECL_Controller::set_max_rate(float max_rate)
{
_max_rate = max_rate;
void ECL_Controller::set_max_rate(float max_rate) {
_max_rate = max_rate;
}

float ECL_Controller::get_euler_rate_setpoint()
{
return _euler_rate_setpoint;
float ECL_Controller::get_euler_rate_setpoint() {
return _euler_rate_setpoint;
}

float ECL_Controller::get_body_rate_setpoint()
{
return _body_rate_setpoint;
float ECL_Controller::get_body_rate_setpoint() {
return _body_rate_setpoint;
}

float ECL_Controller::get_integrator()
{
return _integrator;
float ECL_Controller::get_integrator() {
return _integrator;
}
49 changes: 11 additions & 38 deletions apps/controller/fw_att_control/ecl_pitch_controller.cpp
Original file line number Diff line number Diff line change
@@ -1,35 +1,12 @@
/****************************************************************************
/*****************************************************************
* _ __ __ ____ _ __ __
* / | / /___ _ __ / /_ / __ \ (_)/ /____ / /_
* / |/ // _ \ | |/_// __// /_/ // // // __ \ / __/
* / /| // __/_> < / /_ / ____// // // /_/ // /_
* /_/ |_/ \___//_/|_| \__//_/ /_//_/ \____/ \__/
*
* Copyright (c) 2013-2020 Estimation and Control Library (ECL). 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 ECL 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.
*
****************************************************************************/
* Copyright All Reserved © 2015-2024 NextPilot Development Team
******************************************************************/

/**
* @file ecl_pitch_controller.cpp
Expand All @@ -45,10 +22,7 @@

float ECL_PitchController::control_attitude(const float dt, const ECL_ControlData &ctl_data) {
/* Do not calculate control signal with bad inputs */
if (!(PX4_ISFINITE(ctl_data.pitch_setpoint) &&
PX4_ISFINITE(ctl_data.roll) &&
PX4_ISFINITE(ctl_data.pitch) &&
PX4_ISFINITE(ctl_data.euler_yaw_rate_setpoint))) {
if (!(PX4_ISFINITE(ctl_data.pitch_setpoint) && PX4_ISFINITE(ctl_data.roll) && PX4_ISFINITE(ctl_data.pitch) && PX4_ISFINITE(ctl_data.euler_yaw_rate_setpoint))) {
return _body_rate_setpoint;
}

Expand All @@ -59,9 +33,8 @@ float ECL_PitchController::control_attitude(const float dt, const ECL_ControlDat
_euler_rate_setpoint = pitch_error / _tc;

/* Transform setpoint to body angular rates (jacobian) */
const float pitch_body_rate_setpoint_raw = cosf(ctl_data.roll) * _euler_rate_setpoint +
cosf(ctl_data.pitch) * sinf(ctl_data.roll) * ctl_data.euler_yaw_rate_setpoint;
_body_rate_setpoint = math::constrain(pitch_body_rate_setpoint_raw, -_max_rate_neg, _max_rate);
const float pitch_body_rate_setpoint_raw = cosf(ctl_data.roll) * _euler_rate_setpoint + cosf(ctl_data.pitch) * sinf(ctl_data.roll) * ctl_data.euler_yaw_rate_setpoint;
_body_rate_setpoint = math::constrain(pitch_body_rate_setpoint_raw, -_max_rate_neg, _max_rate);

return _body_rate_setpoint;
}
49 changes: 11 additions & 38 deletions apps/controller/fw_att_control/ecl_roll_controller.cpp
Original file line number Diff line number Diff line change
@@ -1,35 +1,12 @@
/****************************************************************************
/*****************************************************************
* _ __ __ ____ _ __ __
* / | / /___ _ __ / /_ / __ \ (_)/ /____ / /_
* / |/ // _ \ | |/_// __// /_/ // // // __ \ / __/
* / /| // __/_> < / /_ / ____// // // /_/ // /_
* /_/ |_/ \___//_/|_| \__//_/ /_//_/ \____/ \__/
*
* Copyright (c) 2013-2020 Estimation and Control Library (ECL). 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 ECL 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.
*
****************************************************************************/
* Copyright All Reserved © 2015-2024 NextPilot Development Team
******************************************************************/

/**
* @file ecl_roll_controller.cpp
Expand All @@ -45,10 +22,7 @@

float ECL_RollController::control_attitude(const float dt, const ECL_ControlData &ctl_data) {
/* Do not calculate control signal with bad inputs */
if (!(PX4_ISFINITE(ctl_data.roll_setpoint) &&
PX4_ISFINITE(ctl_data.euler_yaw_rate_setpoint) &&
PX4_ISFINITE(ctl_data.pitch) &&
PX4_ISFINITE(ctl_data.roll))) {
if (!(PX4_ISFINITE(ctl_data.roll_setpoint) && PX4_ISFINITE(ctl_data.euler_yaw_rate_setpoint) && PX4_ISFINITE(ctl_data.pitch) && PX4_ISFINITE(ctl_data.roll))) {
return _body_rate_setpoint;
}

Expand All @@ -59,9 +33,8 @@ float ECL_RollController::control_attitude(const float dt, const ECL_ControlData
_euler_rate_setpoint = roll_error / _tc;

/* Transform setpoint to body angular rates (jacobian) */
const float roll_body_rate_setpoint_raw = _euler_rate_setpoint - sinf(ctl_data.pitch) *
ctl_data.euler_yaw_rate_setpoint;
_body_rate_setpoint = math::constrain(roll_body_rate_setpoint_raw, -_max_rate, _max_rate);
const float roll_body_rate_setpoint_raw = _euler_rate_setpoint - sinf(ctl_data.pitch) * ctl_data.euler_yaw_rate_setpoint;
_body_rate_setpoint = math::constrain(roll_body_rate_setpoint_raw, -_max_rate, _max_rate);

return _body_rate_setpoint;
}
Loading

0 comments on commit 9eceed8

Please sign in to comment.