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.
39 lines
677 B
C++
39 lines
677 B
C++
/*Publish Compass & velocity data to topic "DroneStatus"*/
|
|
#ifndef PUBDATA_H
|
|
#define PUBDATA_H
|
|
|
|
#include <ros/ros.h>
|
|
#include <sensor_msgs/NavSatFix.h>
|
|
#include <std_msgs/Float64.h>
|
|
#include <mavros_msgs/Waypoint.h>
|
|
#include "class_model/velocity.h"
|
|
|
|
class PubDataClass {
|
|
public:
|
|
PubDataClass();
|
|
virtual ~PubDataClass();
|
|
void publishData(velocity v);
|
|
|
|
|
|
|
|
private:
|
|
// ROS NodeHandle
|
|
ros::NodeHandle node_handle_;
|
|
|
|
//SUBSCRIBE
|
|
ros::Subscriber Compass;
|
|
|
|
//PUBLISH
|
|
ros::Publisher PubData;
|
|
|
|
mavros_msgs::Waypoint msg;
|
|
float heading;
|
|
void Compass_callback(const std_msgs::Float64::ConstPtr °ree);
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
#endif // PUBDATA_H
|