Open MJ-1007 opened 3 years ago
Not sure I understand. This is what drone.telemetry.position()
does: it gives you the position telemetry data:
async for position in drone.telemetry.position():
<do something with position>
Hello,
Thank you for your response.
I would like to know if there is a possibility to return this position information to another user-defined function where I will be using this continuous telemetry data for performing some tasks.
Like for example:
"""
Telemetry information from drone
"""
async def telemetry(drone):
# This is a function specific for telemetry
async for position in drone.telemetry.position():
lat = position.latitude_deg
lon = position.longitude_deg
Now I would like to use this lat and lon information in some other function, say functionA to perform some tasks.
Is it possible to continuously return these values to another function?
Thanks in advance,
Why not something like:
async def handle_position(drone):
async for position in drone.telemetry.position():
await some_function(position)
async def some_function(position):
<do something with position>
Hello,
I would like to hold or make the drone hold, when it reaches a particular position and then continue its path to another location. Something like this:
async def handle_position(drone): async for position in drone.telemetry.position(): await some_function(position)
async def some_function(position):
Just check the position and do what's needed when it is reached, e.g.
async def handle_position(drone):
async for position in drone.telemetry.position():
if (should_hold(position)):
await drone.mission.pause_mission()
No need to sleep :thinking:
Thank you for your response.
Is it possible to use await drone.mission.pause_mission()
even if I am using goto_location
command instead of using mission? I am using goto_location
to have a control over orientation of the drone while moving from one location to another. Is there a way that I can make changes in orientation by using a mission function?
Thanks again.
Oh, so you goto_location
, and sometimes you want to interrupt the goto and hold? I mean, there is a hold function in the action plugin, too...
Oh okay. Thank you so much for your suggestions. I will have a look into it.
Thanks.
Hello I think I am having a similar problem, I need attitude and distance sensor data to use it for another function to achieve the horizontal distance between drone and the target and so that I can use it for controlling the drone in a no GPS environment. the problem is when I want to get attitude telemetry data, if I write and start it in another loop I don't know how to enter the value to main loop, so I have used await distance sensor and await attitude and it makes the program very slow that the camera is able to be run in 13 ,14 FPS. So it would be great if U could let me know how to get a return value from async distance sensor function into the main loop
Hello,
Is there a way to get the position telemetry data after using async for position in drone.telemetry.position():? The purpose is to use the real time position data from this async loop and return it so that I can use the data for some other purpose.
Is there any way to do this in MAVSDK-Python? Any suggestion will be very helpful.
Thanks in advance.