Skip to content
Snippets Groups Projects
Commit 9bf104cc authored by roangel's avatar roangel
Browse files

now python nodes have correct names

parent ddc766a9
No related branches found
No related tags found
No related merge requests found
......@@ -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");
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment