upkie / vulp

Robot/simulation switch for the mjbots stack
Apache License 2.0
61 stars 4 forks source link

Re-sending of previous commands #2

Open stephane-caron opened 1 year ago

stephane-caron commented 1 year ago

When the spine is in neither of the following three states:

Then Spine::cycle_actuation will send the previous command:

    if (state_machine_.state() == State::kSendStops ||
        state_machine_.state() == State::kShutdown) {
      write_stop_commands(actuation_.commands());
    } else if (state_machine_.state() == State::kAct) {
      Dictionary& action = dict_("action");
      write_position_commands(actuation_.commands(),
                              actuation_.servo_joint_map(), action);
    } else {
      // TODO(scaron): clear commands, otherwise the previous ones will be
      // sent again!
    }

This is OK for stop commands, but not OK for infrequent position commands.

stephane-caron commented 1 year ago

Escalating this issue in light of https://github.com/tasts-robots/upkie_locomotion/pull/29