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 ...@@ -35,6 +35,9 @@ namespace d_fall_pps
// Callback function to handle incoming UWB data // Callback function to handle incoming UWB data
void UWBDataCallback(const CrazyflieData &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 #endif // LOCALIZATIONSERVER_H included
\ No newline at end of file
...@@ -55,6 +55,7 @@ int main(int argc, char* argv[]) ...@@ -55,6 +55,7 @@ int main(int argc, char* argv[])
loadCrazyflieContext(); loadCrazyflieContext();
ros::Subscriber dbChangedSubscriber = namespaceNodeHandle.subscribe("/my_GUI/DBChanged", 1, dbChangedCallback); 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 // subscribe to the global vicon publisher and local uwb publisher
ros::Subscriber viconSubscriber = nodeHandle.subscribe("/ViconDataPublisher/ViconData", 100, viconDataCallback); ros::Subscriber viconSubscriber = nodeHandle.subscribe("/ViconDataPublisher/ViconData", 100, viconDataCallback);
...@@ -153,3 +154,13 @@ void d_fall_pps::dbChangedCallback(const std_msgs::Int32 &msg) ...@@ -153,3 +154,13 @@ void d_fall_pps::dbChangedCallback(const std_msgs::Int32 &msg)
{ {
d_fall_pps::loadCrazyflieContext(); d_fall_pps::loadCrazyflieContext();
} }
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