How to use default takeoff stage

Building on the HelloDrone example, how do we use the default take-off mode? For example, suppose we want the drone to take off right after doing the “hello” nod. I believe the general idea is to insert Where would the message go, and what message should be used? And we would not need to write a new “takeoff” folder under fsup, since we’re using default, correct?

Here is what I’ve tried, which isn’t working:

First, I added transitions to know when “hello” is complete and to enable takeoff from hello complete, so this is my complete list of transitions in

            # "say/hold" messages from the mission UI alternate between "say"
            # and "idle" states in the ground stage.
                msg_id(hello_messages.Command, "say"),
                msg_id(hello_messages.Command, "hold"),
                msg_id(hello_messages.Command, "complete"),
                msg_id(ui_messages.Command, 'take_off'),

I added a new guidance mode under ground, so this is the bottom of that file:

class Complete(State):
    def enter(self, msg):"entered complete guidance mode")
            _GROUND_MODE_NAME, hello_gdnc_mode_messages.Config(complete=True)

    "name": "idle",
    "class": Idle,

    "name": "say",
    "class": Say,

    "name": "complete",
    "class": Complete,

    "name": "ground",
    "class": DEF_GROUND_STAGE["class"],
    "initial": "say",
    "children": [
        for child in DEF_GROUND_STAGE["children"]
        if not child["name"] in _STATES_TO_REMOVE

I added the command to the package messages:

// Union of all possible commands of this package.
message Command {
    oneof id {
        // Ask to start say hello (ground)
        google.protobuf.Empty say = 1;
        // Ask to stop say hello (ground)
        google.protobuf.Empty hold = 2;
        // Finished hello
        google.protobuf.Empty complete = 3;

And I added “complete” to the config message:

// Ground mode configuration
message Config {
    bool say = 1;
    bool complete = 2;

But nothing happens. It builds, and I can send it to the drone, and see the hello nod, but no takeoff. I think I must be missing somewhere that a message should be sent. What am I missing?

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