diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index d963024682..f273242105 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -54,6 +54,7 @@ add_subdirectory(led) add_subdirectory(mathlib) add_subdirectory(mixer) add_subdirectory(mixer_module) +add_subdirectory(motion_planning) add_subdirectory(output_limit) add_subdirectory(perf) add_subdirectory(pid) diff --git a/src/lib/flight_tasks/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.hpp b/src/lib/flight_tasks/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.hpp index c8ef2a2980..3e4b361e99 100644 --- a/src/lib/flight_tasks/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.hpp +++ b/src/lib/flight_tasks/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.hpp @@ -41,7 +41,7 @@ #pragma once #include "FlightTaskAutoMapper.hpp" -#include "VelocitySmoothing.hpp" +#include class FlightTaskAutoLineSmoothVel : public FlightTaskAutoMapper { diff --git a/src/lib/flight_tasks/tasks/Utility/CMakeLists.txt b/src/lib/flight_tasks/tasks/Utility/CMakeLists.txt index 5842f65778..a1d7c5bb50 100644 --- a/src/lib/flight_tasks/tasks/Utility/CMakeLists.txt +++ b/src/lib/flight_tasks/tasks/Utility/CMakeLists.txt @@ -33,7 +33,6 @@ px4_add_library(FlightTaskUtility StraightLine.cpp - VelocitySmoothing.cpp ManualVelocitySmoothingXY.cpp ManualVelocitySmoothingZ.cpp Sticks.cpp @@ -41,8 +40,7 @@ px4_add_library(FlightTaskUtility StickYaw.cpp ) -target_link_libraries(FlightTaskUtility PUBLIC FlightTask hysteresis bezier SlewRate) +target_link_libraries(FlightTaskUtility PUBLIC FlightTask hysteresis bezier SlewRate motion_planning) target_include_directories(FlightTaskUtility PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -px4_add_unit_gtest(SRC VelocitySmoothingTest.cpp LINKLIBS FlightTaskUtility) px4_add_unit_gtest(SRC ManualVelocitySmoothingXYTest.cpp LINKLIBS FlightTaskUtility) diff --git a/src/lib/flight_tasks/tasks/Utility/ManualVelocitySmoothingXY.hpp b/src/lib/flight_tasks/tasks/Utility/ManualVelocitySmoothingXY.hpp index aa35cabe9d..f9d3b89229 100644 --- a/src/lib/flight_tasks/tasks/Utility/ManualVelocitySmoothingXY.hpp +++ b/src/lib/flight_tasks/tasks/Utility/ManualVelocitySmoothingXY.hpp @@ -38,7 +38,7 @@ #pragma once -#include "VelocitySmoothing.hpp" +#include #include diff --git a/src/lib/flight_tasks/tasks/Utility/ManualVelocitySmoothingZ.hpp b/src/lib/flight_tasks/tasks/Utility/ManualVelocitySmoothingZ.hpp index affeaeb98b..3a293cbd1e 100644 --- a/src/lib/flight_tasks/tasks/Utility/ManualVelocitySmoothingZ.hpp +++ b/src/lib/flight_tasks/tasks/Utility/ManualVelocitySmoothingZ.hpp @@ -38,7 +38,7 @@ #pragma once -#include "VelocitySmoothing.hpp" +#include class ManualVelocitySmoothingZ final { diff --git a/src/lib/motion_planning/CMakeLists.txt b/src/lib/motion_planning/CMakeLists.txt new file mode 100644 index 0000000000..b090aa0337 --- /dev/null +++ b/src/lib/motion_planning/CMakeLists.txt @@ -0,0 +1,40 @@ +############################################################################ +# +# Copyright (c) 2018 - 2020 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(motion_planning + VelocitySmoothing.cpp +) + +target_include_directories(motion_planning PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +px4_add_unit_gtest(SRC VelocitySmoothingTest.cpp LINKLIBS motion_planning) diff --git a/src/lib/flight_tasks/tasks/Utility/VelocitySmoothing.cpp b/src/lib/motion_planning/VelocitySmoothing.cpp similarity index 100% rename from src/lib/flight_tasks/tasks/Utility/VelocitySmoothing.cpp rename to src/lib/motion_planning/VelocitySmoothing.cpp diff --git a/src/lib/flight_tasks/tasks/Utility/VelocitySmoothing.hpp b/src/lib/motion_planning/VelocitySmoothing.hpp similarity index 100% rename from src/lib/flight_tasks/tasks/Utility/VelocitySmoothing.hpp rename to src/lib/motion_planning/VelocitySmoothing.hpp diff --git a/src/lib/flight_tasks/tasks/Utility/VelocitySmoothingTest.cpp b/src/lib/motion_planning/VelocitySmoothingTest.cpp similarity index 100% rename from src/lib/flight_tasks/tasks/Utility/VelocitySmoothingTest.cpp rename to src/lib/motion_planning/VelocitySmoothingTest.cpp diff --git a/src/lib/flight_tasks/tasks/Utility/test_velocity_smoothing.cpp b/src/lib/motion_planning/test_velocity_smoothing.cpp similarity index 100% rename from src/lib/flight_tasks/tasks/Utility/test_velocity_smoothing.cpp rename to src/lib/motion_planning/test_velocity_smoothing.cpp