Commit 3bcfdc8b authored by beuchatp's avatar beuchatp
Browse files

Added a nodes folder in the src and inlcude folder

parent 09e45fc8
......@@ -236,6 +236,7 @@ include_directories(
${COORDINATOR_GUI_LIB_PATH_INC} # CoordinatorGUI -- include directory inside GUI folder
${catkin_INCLUDE_DIRS}
include
include/nodes
)
## Declare a C++ library
......@@ -252,12 +253,15 @@ include_directories(
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/d_fall_pps_node.cpp)
add_executable(ViconDataPublisher src/ViconDataPublisher.cpp)
add_executable(PPSClient src/PPSClient.cpp)
add_executable(SafeControllerService src/SafeControllerService.cpp)
add_executable(DemoControllerService src/DemoControllerService.cpp)
add_executable(CentralManagerService src/CentralManagerService.cpp src/CrazyflieIO.cpp)
add_executable(ParameterService src/ParameterService.cpp)
add_executable(ViconDataPublisher src/nodes/ViconDataPublisher.cpp)
add_executable(PPSClient src/nodes/PPSClient.cpp)
add_executable(SafeControllerService src/nodes/SafeControllerService.cpp)
add_executable(DemoControllerService src/nodes/DemoControllerService.cpp)
add_executable(StudentControllerService src/nodes/StudentControllerService.cpp)
add_executable(MpcControllerService src/nodes/MpcControllerService.cpp)
add_executable(CentralManagerService src/nodes/CentralManagerService.cpp src/CrazyflieIO.cpp)
add_executable(ParameterService src/nodes/ParameterService.cpp)
......@@ -309,12 +313,14 @@ qt5_use_modules(coordinator_GUI Widgets)
add_dependencies(ViconDataPublisher d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(PPSClient d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(SafeControllerService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(DemoControllerService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(CentralManagerService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(ParameterService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(ViconDataPublisher d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(PPSClient d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(SafeControllerService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(DemoControllerService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(StudentControllerService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(MpcControllerService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(CentralManagerService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(ParameterService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
# GUI-- dependencies
add_dependencies(my_GUI d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
......@@ -345,15 +351,14 @@ find_library(VICON_LIBRARY ViconDataStreamSDK_CPP HINTS lib/vicon)
target_link_libraries(ViconDataPublisher ${catkin_LIBRARIES})
target_link_libraries(ViconDataPublisher ${VICON_LIBRARY})
target_link_libraries(PPSClient ${catkin_LIBRARIES})
target_link_libraries(SafeControllerService ${catkin_LIBRARIES})
target_link_libraries(DemoControllerService ${catkin_LIBRARIES})
target_link_libraries(CentralManagerService ${catkin_LIBRARIES})
target_link_libraries(PPSClient ${catkin_LIBRARIES})
target_link_libraries(SafeControllerService ${catkin_LIBRARIES})
target_link_libraries(DemoControllerService ${catkin_LIBRARIES})
target_link_libraries(StudentControllerService ${catkin_LIBRARIES})
target_link_libraries(MpcControllerService ${catkin_LIBRARIES})
target_link_libraries(CentralManagerService ${catkin_LIBRARIES})
target_link_libraries(ParameterService ${catkin_LIBRARIES})
target_link_libraries(ParameterService ${catkin_LIBRARIES})
# GUI -- link libraries
target_link_libraries(my_GUI Qt5::Widgets) # GUI -- let my_GUI have acesss to Qt stuff
......
......@@ -51,7 +51,7 @@
#include "d_fall_pps/CrazyflieEntry.h"
#include "d_fall_pps/CMUpdate.h"
#include "d_fall_pps/CMCommand.h"
#include "CentralManagerService.h"
#include "nodes/CentralManagerService.h"
#include <ros/ros.h>
#include <ros/network.h>
......
......@@ -63,16 +63,25 @@
// ----------------------------------------------------------------------------------
// For which controller parameters to load
#define LOAD_YAML_SAFE_CONTROLLER_AGENT 1
#define LOAD_YAML_DEMO_CONTROLLER_AGENT 2
#define LOAD_YAML_SAFE_CONTROLLER_COORDINATOR 3
#define LOAD_YAML_DEMO_CONTROLLER_COORDINATOR 4
// For which controller parameters to load from file
#define LOAD_YAML_SAFE_CONTROLLER_AGENT 1
#define LOAD_YAML_DEMO_CONTROLLER_AGENT 2
#define LOAD_YAML_STUDENT_CONTROLLER_AGENT 3
#define LOAD_YAML_MPC_CONTROLLER_AGENT 4
#define LOAD_YAML_SAFE_CONTROLLER_COORDINATOR 11
#define LOAD_YAML_DEMO_CONTROLLER_COORDINATOR 12
#define LOAD_YAML_STUDENT_CONTROLLER_COORDINATOR 13
#define LOAD_YAML_MPC_CONTROLLER_COORDINATOR 14
// For which controller parameters to fetch from from file
#define FETCH_YAML_SAFE_CONTROLLER_FROM_OWN_AGENT 1
#define FETCH_YAML_DEMO_CONTROLLER_FROM_OWN_AGENT 2
#define FETCH_YAML_DEMO_CONTROLLER_FROM_OWN_AGENT 2
#define FETCH_YAML_SAFE_CONTROLLER_FROM_COORDINATOR 3
#define FETCH_YAML_DEMO_CONTROLLER_FROM_COORDINATOR 4
#define FETCH_YAML_DEMO_CONTROLLER_FROM_COORDINATOR 4
#define TYPE_INVALID -1
#define TYPE_COORDINATOR 1
......@@ -104,7 +113,7 @@ std::string my_agentID = "000";
// Publisher that notifies the relevant nodes when the YAML paramters have been loaded
// from file into ram/cache, and hence are ready to be fetched
ros::Publisher controllerYamlReadyForFetchPublihser;
ros::Publisher controllerYamlReadyForFetchPublisher;
std::string m_base_namespace;
......
......@@ -66,6 +66,16 @@
file = "$(find d_fall_pps)/param/DemoController.yaml"
ns = "DemoController"
/>
<rosparam
command = "load"
file = "$(find d_fall_pps)/param/StudentController.yaml"
ns = "StudentController"
/>
<rosparam
command = "load"
file = "$(find d_fall_pps)/param/MpcController.yaml"
ns = "MpcController"
/>
</node>
<!-- AGENT GUI (aka. the "student GUI") -->
......
# Mass of the crazyflie
mass : 31
# Frequency of the controller, in hertz
control_frequency : 200
# Quadratic motor regression equation (a0, a1, a2)
motorPoly : [5.484560e-4, 1.032633e-6, 2.130295e-11]
\ No newline at end of file
......@@ -34,7 +34,7 @@
// INCLUDE THE HEADER
#include "CentralManagerService.h"
#include "nodes/CentralManagerService.h"
......
......@@ -34,7 +34,7 @@
// INCLUDE THE HEADER
#include "DemoControllerService.h"
#include "nodes/DemoControllerService.h"
......
......@@ -34,7 +34,7 @@
// INCLUDE THE HEADER
#include "PPSClient.h"
#include "nodes/PPSClient.h"
......
......@@ -34,7 +34,7 @@
// INCLUDE THE HEADER
#include "ParameterService.h"
#include "nodes/ParameterService.h"
......@@ -172,7 +172,7 @@ void requestLoadControllerYamlCallback(const std_msgs::Int32& msg)
// ready to be fetched (i.e., using getparam())
if (isReadyForFetch)
{
controllerYamlReadyForFetchPublihser.publish(fetch_msg);
controllerYamlReadyForFetchPublisher.publish(fetch_msg);
}
}
}
......@@ -241,7 +241,7 @@ int main(int argc, char* argv[])
// Publisher that notifies the relevant nodes when the YAML paramters have been loaded
// from file into ram/cache, and hence are ready to be fetched
controllerYamlReadyForFetchPublihser = nodeHandle.advertise<std_msgs::Int32>("controllerYamlReadyForFetch", 1);
controllerYamlReadyForFetchPublisher = nodeHandle.advertise<std_msgs::Int32>("controllerYamlReadyForFetch", 1);
// Construct the string to the namespace of this Paramater Service
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment