Reset, reboot, and initialisation#

Reset the simulation#

You can reset the simulation by selecting Edit > Reset World or by pressing Ctrl+R. You can also trig the world_reset_all action on the fwman world component. This can be done easily using the following call:

$ sphinx-cli reset

This will reset the time, drone poses, and restart the firmwares from scratch. All changes made by the firmwares on their file systems are lost.

Reboot the firmware#

There are two ways to reboot the firmware:

  • By issuing a reboot request to the Web server:

    $ curl -i -X PUT http://anafi-ai.local/api/v1/system/reboot
    

    This will properly shutdown all services and reboot the firmware instance. Any changes made by the firmware on the file system are preserved. The operation is canceled if the drone is flying.

    Note

    This command is not supported on ANAFI. To reboot an ANAFI firmware, you have to connect to your firmware with adb and issue a reboot shell command:

    $ adb connect 10.202.0.1:9050 ; adb shell reboot
    
  • By triggering a reset_firmware action on the fwman drone component:

    $ sphinx-cli action fwman reset_firmware
    

    This will reboot the firmware instance without properly shutting down services, and without checking if the drone is flying. Any changes made by the firmware on the file system are preserved.

Modify runtime parameters before firmware startup#

This section shows how to set up runtime parameters before the firmware starts up. This way, we can check the firmware initialization with custom parameter values.

First, you need to start Parrot Sphinx with the -U (or --pause-firmware) option.

$ sphinx -U /path/to/my.drone

Once Parrot Sphinx is started, all runtime parameters are accessible and can be modified even though the firmware is waiting to be launched.

Finally, you just have to start your firmware by sending the start_firmwares action to the world component fwman. This can be achieved either from the Web interface, or using the command line:

$ sphinx-cli action -m world fwman start_firmwares

Change initial drone position for next world reset#

As already told in Interact with the simulation, the initial drone position (also called spawn point) can be configured using either Parrot Sphinx command line, or by editing the .drone file.

It is also possible to change this starting position so the drone gets spawned at a different position after a world reset. To do that, just set the initial_pose parameter of the fwman component to the name of an existing spawn point or an explicit 6-number pose. For example, use the following command if you want the drone to be spawned 5 meters in front of the origin:

$ sphinx-cli param fwman initial_pose "5 0 0.2 0 0 0"

Change spherical coordinates at origin for next world reset#

It is also possible to change the geodetic coordinates at the origin (requires a world reset). To do that, set the latitutde_deg, longitude_deg, and elevation parameters of the spherical_coordinates component to the values you want. This won’t change the position value of the drone, but components like the GPS and some world and physics parameters will be influenced by this change.

This setting overrides the GPS parameters set by the -gps-json option of UE4 applications.

For example, use the following commands if you want the origin of the world to be at 2000 meters:

$ sphinx-cli param -m world spherical_coordinates elevation 2000
$ sphinx-cli action -m world fwman world_reset_all