Drone software for locating animals with a focus on dogs.
- Initial Author: Ziad Arafat
- In this design we will focus on implementing compoments in a simulation environment rather than having to worry about implementing things around a particular drone setup.
- Things such as drone connectivity, availablity of a secondary board etc. won't need to be a consideration.
- However, in order to help make this design portable and adaptable to a wide range of drone setups we will make it modular and non monolithic in nature.
- This means we will break up functionality into multiple running services
- Dare I say "microservices"
- This means we will break up functionality into multiple running services
- Some real challenges we have identified with designing this system.
- What is the necessary flow of logic when it comes to identifying dogs and further investigating the found dog?
- How do we efficiently stream video data from the cameras and deliver it to multiple endpoints that need it?
- Which endpoints need said video and which do not?
- In the context of having a physical drone we encountered these challenges which we hope to not deal with in simulated setups.
- How do we connect the end user to the drone?
- How do we stream video data and to whom given the limitations of connectivity?
- Updated model for defining and refining the design documentation.
- We will maintain a list of functional requirements and non-functional requirements here.
- Functional Requirements (What does it do for the user?)
- The system will help the user quickly locate their lost dog.
- The drone can autonomously follow waypoints set by the user.
- During flight the user will receive real-time detections of dogs on the ground
- A "detection" constitutes the following
- A photo or multiple photos of the detected dog.
- The precise location of the dog.
- A graphical map representation of the location.
- Directions to navigate in person to the location (like google maps).
- The user will be able to browse through detections of dogs
- For each detection
- The user can indicate if it should be ignored or investigated further.
- A "detection" constitutes the following
- For each detection that is marked for further investigation.
- The drone will autonomously track the dog and attempt to get a better view of the dog.
- As the drone is doing this
- The user can cancel at any time to continue the search for other dogs.
- The user can indicate that this is the correct dog and begin efforts of recovery.
- When the user has begun recovery efforts the drone can be used to continue tracking the location of the found dog until recovered.
- The system will help the user quickly locate their lost dog.
- Non-functional requirements (Constraints and general operational requirements)
- The UI needs to be user friendly.
- Drones need to be operated safely and in accordance to laws and FAA regulations.
- One intended use case is for there to be a community drone that can be operated for a community to help locate lost dogs.
- Therefore it's important to consider the cost and easy of setup for this use case.
- Functional Requirements (What does it do for the user?)
- Excalidraw Link https://excalidraw.com/#room=0bce184d057265cbe4c8,P5FUULkvaY4YWWWxdnA5VQ
- Key Components and their relations
- Simulation Machine (Powerful machine that will run the simulated drone and it's other services)
- Simulation
- This is used to simulate the physical drone and the environment it interacts with. This is likely going to be Airsim/Colosseum or Gazebo.
- PX4 SITL
- PX4 is the firmware used on many drones and it can run Software-In-The-Loop mode which means it is simulated in software.
- This can connect to a simulation platform.
- Video Broadcaster
- Takes a video stream as input and will process it and allow other clients to subscribe to the broadcast.
- Dog detector
- This service will read in video data and make predictions on where there are dogs or other important features in the video. It can do this in real time.
- Captain
- The captain is responsible for guiding the drone based on user inputs and other factors.
- Application server
- The application server provides an interface between the user device and other services on the simulated drone. It does this by serving a web application and a web API.
- Simulation
- User device (A device used to access the UI application and command/monitor the mission.)
- Web Application
- This web application will be served from the application server and run in a web browser.
- Web Application
- Pilot Device (specialized device that is meant for an experienced pilot to monitor and control the drone as needed.)
- QGroundControl
- This is the standard software used for configuring and commanding PX4 flight stacks.
- QGroundControl
- Simulation Machine (Powerful machine that will run the simulated drone and it's other services)
- Description of various data entities, the fields they contain and which components they belong to.
- Data Entities
- See Table 1 in Appendix
- For this iteration we are going to focus on server-client interaction.
- Application Server
- missions_available
- HTTP Method:
GET
- Path:
/missions_available
- Description: Fetches the available missions to pick from
- Parameters
None
- Response
{"missions": [{"id": "123", "name": "Path A", "path_preview": "TODO"}]}
- HTTP Method:
- select_mission
- HTTP Method:
POST
- Path:
/select_mission
- Description: Select a mission to execute on the drone.
- Parameters
{"selected_mission": {"id": "123"}}
- Response
- If mission exists
{"status": "Mission Started"}
{"status": "Failed to Start Mission"}
- If not
{"error": "No such mission"}
- If mission exists
- HTTP Method:
- mission_status
- HTTP Method:
GET
- Path:
/mission_status
- Description: get current mission status info
- Parameters
None
- Response
{"status_info": {"battery_percent": 69, "time_elapsed": 200, "current_location": [420.69, 69.420], "time_remaining": 500, "progress_percent": 69}}
- HTTP Method:
- detections
- HTTP Method:
GET
- Path:
/detections
- Descriptions: A list of existing detections including links to hosted images of the detection.
- Parameters
None
- Response
{"detections": [{"id": "1234", "location": [123,123], "time": "timeUTC", "images": ["www.link.to/image.png", "www.link.to/another_image.png"]}]}
- HTTP Method:
- abort
- HTTP Method:
POST
- Path:
/abort_mission
- Description: Immediately end the mission and RTL (sent to captain)
- Parameters
None
- Respose
{"status": "success"}
{"status": "failed"}
- HTTP Method:
- missions_available
- Captain
- Available missions
- HTTP Method:
GET
- Path:
/missions_available
- Description: A list of available missions that can be sent to the Drone.
- Parameters
None
- Response
{"missions": [{"id": "123", "name": "Path A", "path_preview": "TODO"}]}
- HTTP Method:
- abort
- HTTP Method:
POST
- Path:
/abort_mission
- Description: Immediately end the mission and RTL sends directly to PX4
- Parameters
None
- Respose
{"status": "success"}
{"status": "failed"}
- HTTP Method:
- Available missions
- detector-service
- Real-time broadcasts
- New Detections
- Dog Detector will broadcast new detections using socket-io.
- The UI and the Application Server will listen to these and when a new detection is broadcast they will both update their state to display the latest detection.
- New Detections
- Proposed design diagram
- The overall design is as follows.
- The goal is for a user to be able to use a drone that will fly over a large area of ground autonomously and try to locate dogs in real time.
- Drone
- The drone will be equipped with sensors and computers to be able to autonomously fly over a path and detect dogs on the ground.
- Flight Controller
- The flight controller will manage autonomous flight and following preset waypoints.
- Secondary Board
- A secondary compute board on the drone will take care of processing and transmitting data including.
- Processing input video/image data from cameras
- Looking for pets in video/image data using AI
- Transmitting data back to the user
- Processing user input from the user to command other components.
- Web App
- The web app will provide an interface for the user app to communicate with the drone and also receive data from the drone.
- Database
- The database will store any persistent data the system needs.
- dog detector service
- This component will take images/videos as input and provide useful data about found dogs.
- Flight Service
- The flight service will talk to the Flight Controller to command missions and receive telemetry data needed for the user.
- A secondary compute board on the drone will take care of processing and transmitting data including.
- User device
- Phone or tablet running an app that will interface with the web app to allow the user to
- Select a flight mission and begin missions.
- Customize settings for searching for dogs.
- See the current status of the mission
- See images of dogs and generally what the drone sees
- Views
- Dog Finder
- Subviews
- Feed of detected dogs
- Allows you to see pictures of found dogs and browse through them.
- Selecting one will display it in "is this your dog"
- "Is this your dog" card
- Includes a picture of the dog
- location of the dog on map
- Option to select if it should be further investigated or ignored.
- Feed of detected dogs
- Subviews
- Video View
- A live stream showing what the drone sees and detections on screen in real time.
- Map View
- An interactive map
- Location of drone
- Locations of detected dogs.
- An interactive map
- Select Mission
- View at the beginning to select which mission the drone should fly.
- Also displays a map showing the route of the mission.
- ABORT MISSION
- Button to abort the current mission.
- Always visible
- Status Bar
- Bar at the top displaying mission status info
- Subviews
- Battery indicator
- Clock
- Current Time, Time Elapsed, Estimated Time Remaining
- Progress Bar
- Dog Finder
- Controller
- Processes data produced by the user as well as data retrieved from the backend server.
- Caters the data to be best viewed by the individual "Views"
- Stores and retrieves data from the client's local data store. "Client Store"
- Client Store
- Used to store data relevant to the current mission in the RAM of the client.
- Phone or tablet running an app that will interface with the web app to allow the user to
- Ground Pilot Device
- The ground pilot device will allow a pilot to monitor and take emergency manual control of the drone.
- This is a requirement by the FAA for all autonomous drones and a critical safety measure.
- Communicates directly with PX4 SITL via mavlink.
- Drone platform
- Simulated drone
- For the drone platform itself we will start with a simulated drone using the colosseum simulator and possible Gazebo.
- Flight Controller
- For the flight controller we will use PX4 in SITL mode
- Physical Drone
- For the physical drone we plan to use a basic drone frame kit with a classic pixhawk flight controller capable of running PX4
- Currently we are looking at the Holybro X500 v2
- We have 2 pixhawk controllers available already.
- Controller
- We are currently looking into a Herelink controller from ETV otherwise we will need to do more research
- For the physical drone we plan to use a basic drone frame kit with a classic pixhawk flight controller capable of running PX4
- Simulated drone
- Secondary Board Components
- The Board itself
- Currently we are looking into either a Raspberry pi or to borrow an Nvidia Jetson Nano board from ETV
- Web App
- Database
- PostgreSQL or SQLite but we are undecided.
- Dog detector service
- No implementation plan yet
- Ideas
- OpenCV
- YOLOv8
- Python
- Flight Service
- No implementation plan yet
- Ideas
- PyMavSDK
- Python
- FastAPI
- The Board itself
- User Device
- Device itself
- No plan yet but anticipate a laptop or tablet or phone
- Frontend App
- Device itself
Entity | Source | Belongs To | Fields | Other |
---|---|---|---|---|
Video Stream | Simulation | Dog Detector | ||
Select Telemetry | Captain | Application Server | battery_level, time_elapsed, coordinates | |
Detection | Dog Detector | Controller, Client Store | id, Location, Images | |
Available Missions | Missions Database | Controller | id, Name, Map Preview Data | |
Detections on Video Stream | Dog Detector | Video View | ||
Dog Selection | Detections Feed | Is This Your Dog | dog_id | |
Mission Status | Application Server | Status Bar | battery_percent, mission_progress, time_elapsed, time_remaining, in_progress | |
Abort | Controller | PX4 | ABORT | |