Coder Social home page Coder Social logo

cjwqhz / djim100-people-detect-track Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fan0210/djim100-people-detect-track

0.0 0.0 0.0 18.95 MB

A ros demo for people detection and tracking on DJI M100 drone

CMake 24.36% C++ 44.60% Python 31.03%

djim100-people-detect-track's Introduction

DJIM100-people-detect-track

A ros demo for people detection and tracking on DJI M100 drone

Building project

1.Prerequisites

2.Create a workspace and compile

mkdir -p ~/catkin_ws/src

next, copy all packages to /catkin_ws/src and

catkin_make

Usage

  • Set your own image topic

    find ros_people_detect.launch, ros_kcf_node.launch, dji_sdk_client.launch, and replace /image_pub/image with your own image topic.

  • Run dji_sdk_client and dji_sdk

    roslaunch dji_sdk_demo dji_sdk_client.launch roslaunch dji_sdk sdk_manifold.launch

  • Run people_detect node

    roslaunch people_detect ros_people_detect.launch

  • Run ros_kcf node

    roslaunch ros_kcf ros_kcf_node.launch

  • Remote control

    Now, you can use your remote control with custom functions to control the stop and start of tracking and detection. The control interface is defined in client.cpp.

    void StartMission1Callback(DJIDrone *drone)
    {
        drone->request_sdk_permission_control();
        sleep(1);
    
        ros::Rate loop_rate(50);
    
        while(ros::ok())
        {
            ros::spinOnce();
            drone->attitude_control(0x4B,forwardV,leftrV,heightV,yawV);
            cout<<fixed<<setprecision(2)<<"          "<<forwardV<<"  "<<leftrV<<"  "<<heightV<<"  "<<yawV<<endl;
            loop_rate.sleep();
        }
    }
    

    This callback function is used to start the task, that is to start the autonomous detection and tracking.

    void StartMission2Callback(DJIDrone *drone)
    {
        std_srvs::Empty srv;
        start_tracking.call(srv);
    }
    

    This callback function is used to start tracking, that is, people_detect node give a target to kcf_track node. In fact, this goal is the closest person to the center of the image, and if there is no people is detected, the tracking program will not run, but when any people is detected again, the tracking program will automatic run.

    void StartMission3Callback(DJIDrone *drone)
    {
        std_srvs::Empty srv;
        if(stop_detecting.call(srv))
        {
            sleep(1);
            detect_stop.call(srv);
        }
    }
    

    This callback function is used to start and stop people detecting.

    void StartMission4Callback(DJIDrone *drone)
    {
        std_srvs::Empty srv;
        if(stop_tracking.call(srv))
        {
            sleep(1);
            track_stop.call(srv);
        }
    }
    

    This callback function is used to stop kcf tracker.

Show results

videos:
autonomous detection and tracking.mp4

img1 load error img2 load error

djim100-people-detect-track's People

Contributors

fan0210 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.