mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2025-12-09 15:58:31 +08:00
Move Stick class into a globally available library
This commit is contained in:
committed by
Silvan Fuhrer
parent
2cb97e79b9
commit
a514289a68
@@ -71,6 +71,7 @@ add_subdirectory(rover_control EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(rtl EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(sensor_calibration EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(slew_rate EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(sticks EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(stick_yaw EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(systemlib EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(system_identification EXCLUDE_FROM_ALL)
|
||||
|
||||
37
src/lib/sticks/CMakeLists.txt
Normal file
37
src/lib/sticks/CMakeLists.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2025 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.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
px4_add_library(Sticks
|
||||
Sticks.cpp
|
||||
)
|
||||
target_include_directories(Sticks PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
@@ -35,5 +35,5 @@ px4_add_library(FlightTaskAuto
|
||||
FlightTaskAuto.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(FlightTaskAuto PUBLIC FlightTask FlightTaskUtility StickYaw WeatherVane)
|
||||
target_link_libraries(FlightTaskAuto PUBLIC FlightTask FlightTaskUtility Sticks StickYaw WeatherVane)
|
||||
target_include_directories(FlightTaskAuto PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
@@ -49,9 +49,9 @@
|
||||
#include <lib/mathlib/math/filter/AlphaFilter.hpp>
|
||||
#include <lib/motion_planning/HeadingSmoothing.hpp>
|
||||
#include <lib/motion_planning/PositionSmoothing.hpp>
|
||||
#include <lib/sticks/Sticks.hpp>
|
||||
#include <lib/stick_yaw/StickYaw.hpp>
|
||||
#include <lib/weather_vane/WeatherVane.hpp>
|
||||
#include "Sticks.hpp"
|
||||
#include "StickAccelerationXY.hpp"
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
|
||||
#include "FlightTaskAuto.hpp"
|
||||
#include "follow_target_estimator/TargetEstimator.hpp"
|
||||
#include "Sticks.hpp"
|
||||
|
||||
#include <parameters/param.h>
|
||||
#include <mathlib/mathlib.h>
|
||||
@@ -57,6 +56,7 @@
|
||||
#include <uORB/topics/vehicle_command.h>
|
||||
|
||||
#include <lib/mathlib/math/filter/second_order_reference_model.hpp>
|
||||
#include <lib/sticks/Sticks.hpp>
|
||||
#include <motion_planning/VelocitySmoothing.hpp>
|
||||
|
||||
// << Follow Target Behavior related constants >>
|
||||
|
||||
@@ -35,5 +35,5 @@ px4_add_library(FlightTaskDescend
|
||||
FlightTaskDescend.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(FlightTaskDescend PUBLIC FlightTask FlightTaskUtility StickYaw)
|
||||
target_link_libraries(FlightTaskDescend PUBLIC FlightTask FlightTaskUtility Sticks StickYaw)
|
||||
target_include_directories(FlightTaskDescend PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
@@ -37,9 +37,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <lib/sticks/Sticks.hpp>
|
||||
#include <lib/stick_yaw/StickYaw.hpp>
|
||||
#include "FlightTask.hpp"
|
||||
#include "Sticks.hpp"
|
||||
#include "StickTiltXY.hpp"
|
||||
|
||||
class FlightTaskDescend : public FlightTask
|
||||
|
||||
@@ -35,5 +35,5 @@ px4_add_library(FlightTaskManualAltitude
|
||||
FlightTaskManualAltitude.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(FlightTaskManualAltitude PUBLIC FlightTask FlightTaskUtility StickYaw)
|
||||
target_link_libraries(FlightTaskManualAltitude PUBLIC FlightTask FlightTaskUtility Sticks StickYaw)
|
||||
target_include_directories(FlightTaskManualAltitude PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <lib/stick_yaw/StickYaw.hpp>
|
||||
#include <lib/sticks/Sticks.hpp>
|
||||
#include "FlightTask.hpp"
|
||||
#include "Sticks.hpp"
|
||||
#include "StickTiltXY.hpp"
|
||||
#include <uORB/Subscription.hpp>
|
||||
|
||||
|
||||
@@ -32,13 +32,12 @@
|
||||
############################################################################
|
||||
|
||||
px4_add_library(FlightTaskUtility
|
||||
Sticks.cpp
|
||||
StickAccelerationXY.cpp
|
||||
StickTiltXY.cpp
|
||||
Gimbal.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(FlightTaskUtility PUBLIC FlightTask hysteresis SlewRate motion_planning mathlib)
|
||||
target_link_libraries(FlightTaskUtility PUBLIC FlightTask hysteresis SlewRate Sticks motion_planning mathlib)
|
||||
target_include_directories(FlightTaskUtility PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
px4_add_functional_gtest(SRC StickTiltXYTest.cpp LINKLIBS FlightTaskUtility)
|
||||
|
||||
@@ -48,7 +48,8 @@
|
||||
#include <uORB/topics/gimbal_manager_status.h>
|
||||
#include <uORB/topics/vehicle_command.h>
|
||||
|
||||
#include "Sticks.hpp"
|
||||
#include <lib/sticks/Sticks.hpp>
|
||||
|
||||
|
||||
|
||||
class Gimbal : public ModuleParams
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "StickAccelerationXY.hpp"
|
||||
|
||||
#include <geo/geo.h>
|
||||
#include "Sticks.hpp"
|
||||
#include <lib/sticks/Sticks.hpp>
|
||||
|
||||
using namespace matrix;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "StickTiltXY.hpp"
|
||||
|
||||
#include <geo/geo.h>
|
||||
#include "Sticks.hpp"
|
||||
#include <lib/sticks/Sticks.hpp>
|
||||
|
||||
using namespace matrix;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user