From 78c665facbd4b776e509197815060e4807a901bb Mon Sep 17 00:00:00 2001
From: roangel <roangel@student.ethz.ch>
Date: Tue, 29 Aug 2017 11:16:00 +0200
Subject: [PATCH] Fixed name of DBChanged topic name in GUI and PPSClient

---
 pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.cpp | 3 ++-
 pps_ws/src/d_fall_pps/src/PPSClient.cpp                    | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.cpp b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.cpp
index 62271a73..5447e708 100644
--- a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.cpp
+++ b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.cpp
@@ -39,7 +39,7 @@ MainWindow::MainWindow(int argc, char **argv, QWidget *parent) :
 
     setpointPublisher = nodeHandle.advertise<Setpoint>("SafeControllerService/Setpoint", 1);
     setpointSubscriber = nodeHandle.subscribe("SafeControllerService/Setpoint", 1, &MainWindow::setpointCallback, this);
-    DBChangedSubscriber = nodeHandle.subscribe("my_GUI/DBChanged", 1, &MainWindow::DBChangedCallback, this);
+    DBChangedSubscriber = nodeHandle.subscribe("/my_GUI/DBChanged", 1, &MainWindow::DBChangedCallback, this);
 
 
     // communication with PPS Client, just to make it possible to communicate through terminal also we use PPSClient's name
@@ -88,6 +88,7 @@ void MainWindow::enableGUI()
 void MainWindow::DBChangedCallback(const std_msgs::Int32& msg)
 {
     loadCrazyflieContext();
+    ROS_INFO("context reloaded in student_GUI");
 }
 
 void MainWindow::setpointCallback(const Setpoint& newSetpoint)
diff --git a/pps_ws/src/d_fall_pps/src/PPSClient.cpp b/pps_ws/src/d_fall_pps/src/PPSClient.cpp
index a135ddda..0e68c1b1 100755
--- a/pps_ws/src/d_fall_pps/src/PPSClient.cpp
+++ b/pps_ws/src/d_fall_pps/src/PPSClient.cpp
@@ -467,7 +467,7 @@ int main(int argc, char* argv[])
     safeControllerServiceSetpointPublisher = namespaceNodeHandle.advertise<d_fall_pps::Setpoint>("SafeControllerService/Setpoint", 1);
 
     // subscriber for DBChanged
-    ros::Subscriber DBChangedSubscriber = namespaceNodeHandle.subscribe("my_GUI/DBChanged", 1, DBChangedCallback);
+    ros::Subscriber DBChangedSubscriber = namespaceNodeHandle.subscribe("/my_GUI/DBChanged", 1, DBChangedCallback);
 
 	//start with safe controller
     flying_state = STATE_MOTORS_OFF;
-- 
GitLab