Skip to content

High level API to control the anafi4k drones in simulation

Notifications You must be signed in to change notification settings

Kchour/drone_controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This repo contains a simple, high level wrapper for Olympe (only a few things implemented), that utlizes threading to do multi-drone control. An example world and a multi-vehicle simulation demo is included. Screenshot from 2021-08-08 02-14-10

Screenshot from 2021-08-08 02-15-52

Getting Started

First install parrot-sphinx and parrot-olympe.

Then clone this repo somewhere say

$ cd ~/tests
$ git clone https://github.com/Kchour/drone_controller

After starting the olympe virtual environment, install this package in editable mode:

(olympe venv) $ cd ~/tests/drone_controller
(olympe venv) $ python3 -m pip install -e .

Terminal 1

Start firmware daemon.

$ sudo systemctl start firmwared.service

Start olympe virtual environment.

$ source /path_to/parrot-groundsdk/products/olympe/linux/env/shell

Export models path to GAZEBO_MODEL_PATH.

$ source export_gazebo.sh

Start Sphinx simulator with a specific drone (replace xxx).

$ sphinx drones/xxx.drone

Also, you can also set simulation parameters at run-time

$ sphinx drones/anafi4k.drone::stolen_interface=::simple_front_cam=true worlds/rellis_campus.world

Terminal 2

Source environmental variables before running any of the scripts

$ source /path_to/parrot-groundsdk/products/olympe/linux/env/setenv

Multi-drone simulation

Simply pass two .drone files to sphinx, but each drone must have a unique name and different starting pose! e.g.

sphinx /opt/parrot-sphinx/usr/share/sphinx/drones/bebop2.drone /opt/parrot-sphinx/usr/share/sphinx/drones/bebop2.drone::name=other::stolen_interface=

Follow all the steps in the previous section except for what you will pass to sphinx:

sphinx drones/anafi4k.drone drones/anafi4k.drone::name="blah"::pose="5 0 0.2 0 0 0" worlds/rellis_campus.world

If using ethernet interface, the default address for the first drone is 10.202.0.1 (then 10.202.1.1 for the second drone, …).

Verify using fdc list instances to see simulated instances. More info at https://developer.parrot.com/docs/sphinx/firmwared.html

Now trying running multi_waypoint_following.py in terminal 2. You should see the following:

mutli-veh-2021-08-08_02.21.16.mp4

Here's a view from the drone1 camera:

h264_data.mp4

Misc

  • Reset the gazebo simulator often when testing via CTRL+R

Issues

  • VideoStream will have olympe.pdraw.ANAFI-0000000 - _unregister_future - Failed to unregister future. Seems like an issue with the latest version of olympe?
  • How to send mavlink files to the drone?
  • Unable to control drone horizontal speed via moveTo command...perhaps consider moving via pcmd?

About

High level API to control the anafi4k drones in simulation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published