I am working on a offboard control algorithm for a custom drone and part of the task is to make the drone fall a certain height (as vertically as possible). Below i’d like to conceptually outline my algorithm and ask some general questions regarding the algorithm’s implementation.
[Node 1] Initiate Offboard mode, Arm and tell drone to fly to a specified location. (Topic of Interest:
[Node 1] Call Drop Drone Service [AKA Service 1]
[Service 1] Stop Thrust until height drop is achieved. (Topic of Interest:
mavros/setpoint_raw/attitude) My drone has a px4FlowSensor integrated so it can tell the height with good accuracy.
[Service 1] Tell drone to start thrust with velocity (or force) only in the z direction. Stop High thrust when velocity in the z-direction becomes positive again (AKA when the drone stops dropping) (Topic of Interest:
[Node 1] Tell drone to hover at the expected location after the height drop. (Topic of Interest:
What are the best topics to communicate the various kinds of commands needed to implement the algorithm? I have placed my best guess in parenthesis above.
Since, (It seems) there is not one topic that can handle all of the command types (Flying to position, stopping thrust, restarting acceleration in a given direction), are there any special considerations needed to make sure the commands across various topics don’t conflict or overlap? Currently, all I do is ensure that I stop sending commands on one topic before sending them on another. But perhaps, there is a
spinall(), instead of
spinonce()to ensure there are no commands left in the previous topics buffer.
I would appreciate any help.
Thank you very much,