HIL mode with ANAFI UKR¶
H.I.L.: Hardware In the Loop. More details here.
Parrot Sphinx is able to delegate to external hardware devices some tasks requiring specific hardware processing and/or intensive GPU/CPU computation.
The HIL mode supports two applications that require the computer vision processing running on the drone chipset:
to generate realistic depth/disparity maps and support the hand-landing feature
to detect class objects and track targets
Setup¶
What you need:
an ANAFI UKR
a USB3 cable (either type-A or type-C)
an appropriate USB3 port on your computer
To recognize a USB3 cable or port, you can check for the existence of the visual below:
The “SS” symbol can sometimes be accompanied by a small number like “5” or “10” which indicates a more recent version of the USB3 standard with higher transfer speeds. Both the cable and the port need to support the same version to benefit from higher speeds.
Note
Make sure to plug the drone directly on the computer, using a USB hub can degrade transfer performance.
Power up the physical drone and wait until the drone finishes its startup sequence.
The network interface created on top of the USB3 link is called “ana_ukr_<xxxx>”. It should automatically receive an IP address from the drone. To check whether the IP link is up, you can enter the following command, and verify the presence of the network interface “ana_ukr_xxxx”.
$ ip a | grep ana_ukr
If there is no IP v4 address attached to the interface,
you may need to manually create a new “Network Manager connection”.
To add a new connection, you can use the nmcli command as shown below:
$ sudo nmcli connection add type ethernet autoconnect yes ifname ana_ukr_<xxxx>
… where ana_ukr_<xxxx> is the name of the network interface you see when running “ip a”.
Then, reboot the physical drone, to apply the proper network configurations.
For more information about the Network Manager, check this page.
Measure USB3 bandwidth¶
The bandwidth is recommended to be higher than 900 Mbit/s.
In case you are unsure about the reliability and the quality of the USB3 link, a script is installed alongside Parrot Sphinx and allows you to measure the available bandwidth:
$ sphinx-hil-bandwidth
Warning
On some not fully compliant USB3 type C cables, the cable isn’t always symmetrical, causing one side to give you USB2 speeds at maximum. You might need to flip the cable to get the full speed.
In this case it is recommended to replace the cable with a fully compliant USB3 cable.
How to launch the simulation¶
To run Parrot Sphinx in HIL mode, you need to activate one or more applications running on the drone chipset by enabling the following drone options:
with_depth_hil: to generate realistic depth/disparity maps and support hand-landingwith_tracking_hil: to detect class objects and track targets
For example, to activate the generation of realistic depth/disparity maps, the command line to launch Parrot Sphinx should resemble this:
$ sphinx <my_anafi3.drone>::with_depth_hil=1 & parrot-ue4-empty
During the startup of Parrot Sphinx, as soon as a physical drone is detected, Parrot Sphinx reconfigures the drone in HIL mode. To exit the HIL mode, just turn off and turn on your drone.