Commit c6ddb489 authored by tiagos's avatar tiagos
Browse files

Localisationserver listens to the change in UWB Setting

parent 713cbe73
......@@ -35,6 +35,9 @@ namespace d_fall_pps
// Callback function to handle incoming UWB data
void UWBDataCallback(const CrazyflieData &data);
// Callback function called when teachers changes UWB Status
void uwbChangedCallback(const std_msgs::Int32 &msg);
}
#endif // LOCALIZATIONSERVER_H included
\ No newline at end of file
......@@ -54,7 +54,8 @@ int main(int argc, char* argv[])
centralManager = nodeHandle.serviceClient<CMQuery>("/CentralManagerService/Query", false);
loadCrazyflieContext();
ros::Subscriber dbChangedSubscriber = namespaceNodeHandle.subscribe("/my_GUI/DBChanged", 1, dbChangedCallback);
ros::Subscriber enableUWBSubscriber = nodeHandle.subscribe("/my_GUI/enableUWB", 1, uwbChangedCallback);
// subscribe to the global vicon publisher and local uwb publisher
ros::Subscriber viconSubscriber = nodeHandle.subscribe("/ViconDataPublisher/ViconData", 100, viconDataCallback);
......@@ -152,4 +153,14 @@ void d_fall_pps::UWBDataCallback(const CrazyflieData &data)
void d_fall_pps::dbChangedCallback(const std_msgs::Int32 &msg)
{
d_fall_pps::loadCrazyflieContext();
}
\ No newline at end of file
}
void d_fall_pps::uwbChangedCallback(const std_msgs::Int32 &msg)
{
enableUWB = msg.data;
if(enableUWB)
ROS_WARN("[LocalizationServer] UWB activated!");
else
ROS_WARN("[LocalizationServer] UWB deactivated!");
}
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