ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

AR DRONE 2.0 Tracking

asked 2014-12-17 09:30:58 -0500

huevos gravatar image

Hello, I'm using ROS, OpenCV and Eclipse with an AR DRONE 2.0. My question is: How can my drone follow an object? I installed ardrone_autonomy and tried some tutorials to convert my video on image to use Opencv but no good results.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-12-17 10:03:16 -0500

Marc gravatar image

Hi,

I think this is a multi-faceted problem... First, you'll have to make sure you know how to implement high-level control with ardrone_autonomy (which is pretty straight forward if you look at https://github.com/AutonomyLab/ardron... ). Then you'll have to use the stream from the camera (which is either the bottom camera or the front camera, but I believe definitely not both at the same time) and forward it to/subscribe to it from your node which does the OpenCV stuff. There you'll also generate the high level commands based on what you figure out with OpenCV. If you then transform everything correctly from the camera frame to the ardrone frame you should be able to send it cmd_vel commands based on the output of your OpenCV algorithm. Re. the two different cameras, I think there is a service you can call to switch between the active cameras to be transmitted over wifi, if I remember correctly.

Those are just my first thoughts, but I think if you go that route it should be easily doable... Just read into ardrone_autonomy documentation and also have a look at the tum_ardrone package. It uses PTAM for localization, which is an old method but a good start.

Best Regards, Marc

edit flag offensive delete link more
0

answered 2014-12-18 06:36:39 -0500

huevos gravatar image

Hi, thank you for your answer!

i can pilot the drone with this command on eclipse: but i would like to use the video with OpenCV. I will try tum_ardrone but i think it can't help me with the stream.

void takeoff(){
    system("bash -i -c 'rostopic pub /ardrone/takeoff std_msgs/Empty -1'");
}
void land(){
    system("bash -i -c 'rostopic pub /ardrone/land std_msgs/Empty -1'");
}
void z(){
    system("bash -i -c 'rostopic pub /cmd_vel geometry_msgs/Twist -1 \"{linear: {x: 0, y: 0, z: 0}, angular: {x: 0, y: 0, z: -0.7}}\"'");
}
void nomove(){
    system("bash -i -c 'rostopic pub /cmd_vel geometry_msgs/Twist -1 \"{linear: {x: 0, y: 0, z: 0}, angular: {x: 0, y: 0, z: 0}}\"'");
}
void reset(){
    system("bash -i -c 'rostopic pub /ardrone/reset std_msgs/Empty -1'");
}

int main()
{
    takeoff();
    z();
    nomove();
    land();
    reset();

    return 0;
}
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-12-17 09:30:58 -0500

Seen: 1,766 times

Last updated: Dec 18 '14