Can I have a call back from the server only after the completion of the action (either takeoff or position set)


#1

I am using Rest calls to communicate to the server Flytsim. whenever I takeoff drone or set some point I was getting a reply “Takeoff command successfull but not waiting for drone to reach the height”. Is there any way so that I can get a callback from server only when the drone reaches the particular height or reaches the particular point


#2

Hi,

Subscribe to this rostopic:
<namespace>/navigation_server_pos/result

You would get response on this topic, once takeoff or position sp has completed.


#3

I have set async = false
but in response

200
{"_format": “ros”, “message”: “[INFO] Position Set service initiated successfully. async=true: Not waiting for the vehicle to reach position setpoints in NED Frame as x: -4.377035m, y: -1.795129m, z: 1.370578m, yaw: 3.035400rad”, “success”: true}

I am getting async= true


#4

Yes. Rest calls are forced async. There is no way to override that.
This is by design, because these REST calls might take a few seconds to respond, before which REST call timeout will be called by the server.


#5

But is there any way that we get response from the server that position set Or Takeoff has been completed?


#6

Yes. And I have already answered this. Please take a look at my first reply in this thread: Can I have a call back from the server only after the completion of the action (either takeoff or position set)


#7

Thanks for the reply .
I hope this would work