Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
miferco97 committed May 13, 2022
1 parent 3393d3d commit 39adc43
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 25 deletions.
25 changes: 8 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
cmake_minimum_required(VERSION 3.5)
project(takeoff_plugins)
set(PROJECT_NAME takeoff_plugins)
project(${PROJECT_NAME} VERSION 0.1.0)

# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
endif()

# if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# add_compile_options(-Wall -Wextra -Wpedantic)
# endif()

# find dependencies
set(PROJECT_DEPENDENCIES
ament_cmake
Expand All @@ -34,27 +25,27 @@ foreach(DEPENDENCY ${PROJECT_DEPENDENCIES})
find_package(${DEPENDENCY} REQUIRED)
endforeach()

add_library(takeoff_plugins src/takeoff_plugin_speed.cpp)
target_include_directories(takeoff_plugins PUBLIC
add_library(${PROJECT_NAME} src/takeoff_plugin_speed.cpp)
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(
takeoff_plugins
${PROJECT_NAME}
${PROJECT_DEPENDENCIES}
)

pluginlib_export_plugin_description_file(takeoff_plugin_base plugins.xml)

install(
TARGETS takeoff_plugins
TARGETS ${PROJECT_NAME}
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

ament_export_libraries(
takeoff_plugins
${PROJECT_NAME}
)
ament_export_targets(
export_${PROJECT_NAME}
Expand Down
10 changes: 5 additions & 5 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>takeoff_plugins</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="pedroariasperez96@gmail.com">parias</maintainer>
<license>TODO: License declaration</license>
<version>0.1.0</version>
<description> Package with multiple basic takeoff_plugins </description>
<maintainer email="cvar.upm3@gmail.com">Computer Vision And Aerial Robotics Group (UPM)</maintainer>
<license>BSD-3-Clause</license>

<buildtool_depend>ament_cmake_ros</buildtool_depend>
<buildtool_depend>ament_cmake</buildtool_depend>

<depend>takeoff_plugin_base</depend>
<depend>pluginlib</depend>
Expand Down
2 changes: 1 addition & 1 deletion plugins.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<class type="takeoff_plugins::TakeOffSpeed" base_class_type="takeoff_base::TakeOffBase">
<description>Takeoff done with speed commands.</description>
</class>
</library>
</library>
40 changes: 38 additions & 2 deletions src/takeoff_plugin_speed.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
/*!*******************************************************************************************
* \file takeoff_plugin_speed.cpp
* \brief Plugin for takeoff with speed control
* \authors Miguel Fernández Cortizas
* Pedro Arias Pérez
* David Pérez Saura
* Rafael Pérez Seguí
*
* \copyright Copyright (c) 2022 Universidad Politécnica de Madrid
* 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 of the copyright holder 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 HOLDER 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.
********************************************************************************/

#include "motion_reference_handlers/speed_motion.hpp"
#include "takeoff_base.hpp"

Expand Down Expand Up @@ -34,7 +70,7 @@ namespace takeoff_plugins
{
result->takeoff_success = false;
goal_handle->canceled(result);
RCLCPP_INFO(node_ptr_->get_logger(), "Goal canceled");
RCLCPP_WARN(node_ptr_->get_logger(), "Goal canceled");
// TODO: change this to hover
motion_handler.sendSpeedCommandWithYawSpeed(0.0, 0.0, 0.0, 0.0);
return false;
Expand All @@ -61,4 +97,4 @@ namespace takeoff_plugins

#include <pluginlib/class_list_macros.hpp>

PLUGINLIB_EXPORT_CLASS(takeoff_plugins::TakeOffSpeed, takeoff_base::TakeOffBase)
PLUGINLIB_EXPORT_CLASS(takeoff_plugins::TakeOffSpeed, takeoff_base::TakeOffBase)

0 comments on commit 39adc43

Please sign in to comment.