diff --git a/pps_ws/src/d_fall_pps/CMakeLists.txt b/pps_ws/src/d_fall_pps/CMakeLists.txt index 0550d2dc9c9f84ecbb5e9aa9cfdb3529cb542dde..6a6191cfb433615d8d0becada0b56f6139aec7e6 100644 --- a/pps_ws/src/d_fall_pps/CMakeLists.txt +++ b/pps_ws/src/d_fall_pps/CMakeLists.txt @@ -62,6 +62,7 @@ add_message_files( AngleCommand.msg RateCommand.msg Setpoint.msg + CrazyflieContext.msg ) ## Generate services in the 'srv' folder @@ -75,6 +76,7 @@ add_service_files( MotorController.srv AngleController.srv RateController.srv + CentralManager.srv ) ## Generate actions in the 'action' folder @@ -159,6 +161,7 @@ include_directories( add_executable(ViconDataPublisher src/ViconDataPublisher.cpp) add_executable(PPSClient src/PPSClient.cpp) add_executable(SafeControllerService src/SafeControllerService.cpp) +add_executable(CentralManagerService src/CentralManagerService.cpp) ## Rename C++ executable without prefix ## The above recommended prefix causes long target names, the following renames the @@ -184,6 +187,8 @@ target_link_libraries(PPSClient ${catkin_LIBRARIES}) target_link_libraries(SafeControllerService ${catkin_LIBRARIES}) +target_link_libraries(CentralManagerService ${catkin_LIBRARIES}) + ############# ## Install ## ############# diff --git a/pps_ws/src/d_fall_pps/msg/CrazyflieContext.msg b/pps_ws/src/d_fall_pps/msg/CrazyflieContext.msg new file mode 100755 index 0000000000000000000000000000000000000000..fce833c5407064361c6570160850796914901d71 --- /dev/null +++ b/pps_ws/src/d_fall_pps/msg/CrazyflieContext.msg @@ -0,0 +1 @@ +string test diff --git a/pps_ws/src/d_fall_pps/src/CentralManagerService.cpp b/pps_ws/src/d_fall_pps/src/CentralManagerService.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8a767b6877c5a4fad1d5e1edd9a2b887196de370 --- /dev/null +++ b/pps_ws/src/d_fall_pps/src/CentralManagerService.cpp @@ -0,0 +1,48 @@ +// The service that manages the context of the student groups. +// Copyright (C) 2017 Cyrill Burgener, Marco Mueller, Philipp Friedli +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +#include "ros/ros.h" +#include "d_fall_pps/CrazyflieContext.h" +#include "d_fall_pps/CentralManager.h" + +using namespace d_fall_pps; + + +/*TODO: +request from paul +Specificy controller in a file + + + +*/ + +bool returnCrazyflieContext(CentralManager::Request &request, CentralManager::Response &response) { + ROS_INFO("cnetal manager"); + + return true; +} + +int main(int argc, char* argv[]) { + ros::init(argc, argv, "CentralManagerService"); + + ros::NodeHandle nodeHandle("~"); + + ros::ServiceServer service = nodeHandle.advertiseService("CentralManager", returnCrazyflieContext); + ROS_INFO("CentralManagerService ready"); + ros::spin(); + + return 0; +} diff --git a/pps_ws/src/d_fall_pps/srv/CentralManager.srv b/pps_ws/src/d_fall_pps/srv/CentralManager.srv new file mode 100644 index 0000000000000000000000000000000000000000..0d77f793b69e54e4a3197aa72128988f72496263 --- /dev/null +++ b/pps_ws/src/d_fall_pps/srv/CentralManager.srv @@ -0,0 +1,4 @@ +string groupName +--- +CrazyflieContext context +