You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
589 B
C++
23 lines
589 B
C++
#include "class_model/PubInfo.h"
|
|
|
|
PubInfoClass::PubInfoClass():node_handle_("~"){
|
|
|
|
std::string ros_namespace;
|
|
if (!node_handle_.hasParam("namespace"))
|
|
{
|
|
}else{
|
|
node_handle_.getParam("namespace", ros_namespace);
|
|
}
|
|
PubInfo = node_handle_.advertise<diagnostic_msgs::KeyValue>(ros_namespace+"/Flight_Information_reciver",100);
|
|
|
|
}
|
|
|
|
PubInfoClass::~PubInfoClass() { ros::shutdown(); }
|
|
|
|
void PubInfoClass::pub_info(INFO msg){
|
|
info.key = msg.type; //key == drone's formation
|
|
info.value = msg.mission; //value == drone's mission
|
|
PubInfo.publish(info);
|
|
}
|
|
|