Reading position of the parrot Anafi drone in Sphinx gazebo using Olympe

I am new to using Anafi drone and I was wondering if someone can direct me to documentation or any discussion related to reading/storing the position (x,y,z) of the drone in the simulation. Thanks in advance.

To retrieve the position of the drone, you can call this command:

parrot-gz model -m anafi4k --pose

thank you. however, this command displays it on terminal. is there a way i can access it using a python code? i need the data to process and find control inputs for my project. thanks in advance.

You can use popen in python:

import os

name = "anafi4k"
print([float(coord) for coord in (os.popen(f"parrot-gz model -m {name} --pose").read().split())])

This topic was automatically closed after 30 days. New replies are no longer allowed.