upkie / vulp

Robot/simulation switch for the mjbots stack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Re-sending of previous commands

stephane-caron opened this issue · comments

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

  • Stop
  • Shutdown
  • Act

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.

Escalating this issue in light of upkie/upkie#29