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 2101d07f40ee51ffd9c09baf93c65223edc92e8b..4453745924aa539f87cd0f878b3a833dadbe5cd4 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 @@ -20,8 +20,8 @@ MainWindow::MainWindow(int argc, char **argv, QWidget *parent) : qRegisterMetaType<ptrToMessage>("ptrToMessage"); QObject::connect(m_rosNodeThread, SIGNAL(newViconData(const ptrToMessage&)), this, SLOT(updateNewViconData(const ptrToMessage&))); - ros::NodeHandle nodeHandle("~"); - crazyRadioStatusSubscriber = nodeHandle.subscribe(ros_namespace + "/CrazyRadioStatus", 1, &MainWindow::crazyRadioStatusCallback, this); + ros::NodeHandle nodeHandle(ros_namespace); + crazyRadioStatusSubscriber = nodeHandle.subscribe("CrazyRadio/CrazyRadioStatus", 1, &MainWindow::crazyRadioStatusCallback, this); // communication with PPS Client, just to make it possible to communicate through terminal also we use PPSClient's name ros::NodeHandle nh_PPSClient(ros_namespace + "/PPSClient"); diff --git a/pps_ws/src/d_fall_pps/crazyradio/CrazyRadio.py b/pps_ws/src/d_fall_pps/crazyradio/CrazyRadio.py index 6f0dbcff37b005d6558cf16dcc3f4409436282e7..78517bd1c50a994915fcf916a54097b18f6c77c5 100755 --- a/pps_ws/src/d_fall_pps/crazyradio/CrazyRadio.py +++ b/pps_ws/src/d_fall_pps/crazyradio/CrazyRadio.py @@ -72,7 +72,7 @@ class PPSRadioClient: self._status = DISCONNECTED self.link_uri = link_uri - self.status_pub = rospy.Publisher('CrazyRadioStatus', Int32, queue_size=1) + self.status_pub = rospy.Publisher(node_name + '/CrazyRadioStatus', Int32, queue_size=1) # Initialize the CrazyFlie and add callbacks self._cf = Crazyflie() @@ -202,7 +202,9 @@ def controlCommandCallback(data): if __name__ == '__main__': - rospy.init_node('CrazyRadio', anonymous=True) + global node_name + node_name = "CrazyRadio" + rospy.init_node(node_name, anonymous=True) # Initialize the low-level drivers (don't list the debug drivers) cflib.crtp.init_drivers(enable_debug_driver=False) @@ -218,7 +220,7 @@ if __name__ == '__main__': # rospy.loginfo("manual address loaded") global cfbattery_pub - cfbattery_pub = rospy.Publisher('cfbattery', Float32, queue_size=10) + cfbattery_pub = rospy.Publisher(node_name + '/cfbattery', Float32, queue_size=10) global cf_client