2 changed files with 43 additions and 0 deletions
@ -0,0 +1,42 @@ |
|||
#include "ros/ros.h" |
|||
#include <papillon/BoundingBox.h> |
|||
#include <geometry_msgs/Twist.h> |
|||
|
|||
#include <opencv/cv.h> |
|||
|
|||
#include <sstream> |
|||
|
|||
using namespace std; |
|||
|
|||
class Drone_control { |
|||
public: |
|||
cv::Rect objectBoundingRectangle = cv::Rect(0,0,0,0); |
|||
|
|||
ros::NodeHandle n; |
|||
|
|||
ros::Publisher pub_cmd; |
|||
ros::Subscriber sub_box; |
|||
|
|||
|
|||
Drone_control() : n("~") { |
|||
pub_cmd = n.advertise<geometry_msgs::Twist>("/bebop/cmd_vel", 1); |
|||
sub_box = n.subscribe<papillon::BoundingBox>("/papillon/bbox", 1, &Drone_control::on_msg, this); |
|||
} |
|||
|
|||
|
|||
// This processes an image and publishes the result.
|
|||
void on_msg(const papillon::BoundingBox::ConstPtr& bbox) { |
|||
ROS_INFO("plop"); |
|||
} |
|||
}; |
|||
|
|||
|
|||
int main(int argc, char **argv) |
|||
{ |
|||
ros::init(argc, argv, "control"); |
|||
Drone_control con=Drone_control(); |
|||
ros::spin(); |
|||
|
|||
return 0; |
|||
} |
|||
|
|||
Loading…
Reference in new issue