From b36dbf8de4030ec09995c1bd905dc55577045f63 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Mon, 15 Nov 2021 21:27:29 +0100 Subject: [PATCH] Remove AutoLineSmoothVel, merged into Auto --- .../flight_mode_manager/CMakeLists.txt | 2 +- .../flight_mode_manager/FlightModeManager.cpp | 2 +- .../Templates/FlightTasks_generated.cpp.em | 5 +- .../Templates/FlightTasks_generated.hpp.em | 5 +- .../tasks/AutoLineSmoothVel/CMakeLists.txt | 39 --------------- .../FlightTaskAutoLineSmoothVel.cpp | 41 --------------- .../FlightTaskAutoLineSmoothVel.hpp | 50 ------------------- .../flight_mode_manager/tasks/CMakeLists.txt | 1 - 8 files changed, 4 insertions(+), 141 deletions(-) delete mode 100644 src/modules/flight_mode_manager/tasks/AutoLineSmoothVel/CMakeLists.txt delete mode 100644 src/modules/flight_mode_manager/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.cpp delete mode 100644 src/modules/flight_mode_manager/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.hpp diff --git a/src/modules/flight_mode_manager/CMakeLists.txt b/src/modules/flight_mode_manager/CMakeLists.txt index 582950c70d..1d8e82bf98 100644 --- a/src/modules/flight_mode_manager/CMakeLists.txt +++ b/src/modules/flight_mode_manager/CMakeLists.txt @@ -52,8 +52,8 @@ endif() # add core flight tasks to list list(APPEND flight_tasks_all + Auto AutoFollowMe - AutoLineSmoothVel Descend Failsafe ManualAcceleration diff --git a/src/modules/flight_mode_manager/FlightModeManager.cpp b/src/modules/flight_mode_manager/FlightModeManager.cpp index d6c3c32047..6354ac8d01 100644 --- a/src/modules/flight_mode_manager/FlightModeManager.cpp +++ b/src/modules/flight_mode_manager/FlightModeManager.cpp @@ -241,7 +241,7 @@ void FlightModeManager::start_flight_task() should_disable_task = false; FlightTaskError error = FlightTaskError::NoError; - error = switchTask(FlightTaskIndex::AutoLineSmoothVel); + error = switchTask(FlightTaskIndex::Auto); if (error != FlightTaskError::NoError) { if (prev_failure_count == 0) { diff --git a/src/modules/flight_mode_manager/Templates/FlightTasks_generated.cpp.em b/src/modules/flight_mode_manager/Templates/FlightTasks_generated.cpp.em index 8ae9ed4bff..f7522afdbe 100644 --- a/src/modules/flight_mode_manager/Templates/FlightTasks_generated.cpp.em +++ b/src/modules/flight_mode_manager/Templates/FlightTasks_generated.cpp.em @@ -60,11 +60,8 @@ int FlightModeManager::_initTask(FlightTaskIndex task_index) @# loop through all requested tasks @[if tasks]@ @[for task in tasks]@ -@{ -firstLowercase = lambda s: s[:1].lower() + s[1:] if s else '' -}@ case FlightTaskIndex::@(task): - _current_task.task = new (&_task_union.@(firstLowercase(task))) FlightTask@(task)(); + _current_task.task = new (&_task_union.@(task)) FlightTask@(task)(); break; @[end for]@ diff --git a/src/modules/flight_mode_manager/Templates/FlightTasks_generated.hpp.em b/src/modules/flight_mode_manager/Templates/FlightTasks_generated.hpp.em index 6471d1e397..9232ea2644 100644 --- a/src/modules/flight_mode_manager/Templates/FlightTasks_generated.hpp.em +++ b/src/modules/flight_mode_manager/Templates/FlightTasks_generated.hpp.em @@ -68,11 +68,8 @@ union TaskUnion { @# loop through all requested tasks @[if tasks]@ -@{ -firstLowercase = lambda s: s[:1].lower() + s[1:] if s else '' -}@ @[for task in tasks]@ - FlightTask@(task) @(firstLowercase(task)); + FlightTask@(task) @(task); @[end for]@ @[end if]@ }; diff --git a/src/modules/flight_mode_manager/tasks/AutoLineSmoothVel/CMakeLists.txt b/src/modules/flight_mode_manager/tasks/AutoLineSmoothVel/CMakeLists.txt deleted file mode 100644 index c5d222ad0f..0000000000 --- a/src/modules/flight_mode_manager/tasks/AutoLineSmoothVel/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################ -# -# Copyright (c) 2018 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(FlightTaskAutoLineSmoothVel - FlightTaskAutoLineSmoothVel.cpp -) - -target_link_libraries(FlightTaskAutoLineSmoothVel PUBLIC FlightTaskAuto FlightTaskUtility) -target_include_directories(FlightTaskAutoLineSmoothVel PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/modules/flight_mode_manager/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.cpp b/src/modules/flight_mode_manager/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.cpp deleted file mode 100644 index d80aae3e89..0000000000 --- a/src/modules/flight_mode_manager/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018 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 FlightAutoLine.cpp - */ - -#include "FlightTaskAutoLineSmoothVel.hpp" -#include - -using namespace matrix; diff --git a/src/modules/flight_mode_manager/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.hpp b/src/modules/flight_mode_manager/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.hpp deleted file mode 100644 index c08be22816..0000000000 --- a/src/modules/flight_mode_manager/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018 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 FlightTaskAutoLineSmoothVel.hpp - * - * Flight task for autonomous, gps driven mode. The vehicle flies - * along a straight line in between waypoints. - */ - -#pragma once - -#include "FlightTaskAuto.hpp" - -class FlightTaskAutoLineSmoothVel : public FlightTaskAuto -{ -public: - FlightTaskAutoLineSmoothVel() = default; - virtual ~FlightTaskAutoLineSmoothVel() = default; -}; diff --git a/src/modules/flight_mode_manager/tasks/CMakeLists.txt b/src/modules/flight_mode_manager/tasks/CMakeLists.txt index e49d9c4857..8411196b88 100644 --- a/src/modules/flight_mode_manager/tasks/CMakeLists.txt +++ b/src/modules/flight_mode_manager/tasks/CMakeLists.txt @@ -34,7 +34,6 @@ # add the core Flight tasks that the additional flight tasks depend on add_subdirectory(FlightTask) add_subdirectory(Utility) -add_subdirectory(Auto) # add all additional flight tasks foreach(task ${flight_tasks_all})