Back to all lessons

LESSON 04 / 06

NextFTC command-based programming

Organize robot actions as commands and mechanisms that are easier to compose and test.

Learning Objectives

  • Explain why command-based structure helps
  • Separate mechanism responsibilities from orchestration
  • Use the official NextFTC documentation as the API source of truth

Explanation

Command-based programming gives a robot a vocabulary of actions: a mechanism owns its hardware behavior, while commands describe when and how that behavior should run. This course uses the architecture conceptually; consult the versioned NextFTC documentation for exact interfaces and method names before writing implementation code.

Example

// Conceptual pseudocode—not a copy of a NextFTC API
command = moveArmTo(target);
command.then(closeClaw);
scheduler.run(command);

Try It

Break a ‘pick up and place’ routine into mechanisms and high-level commands. Mark which steps can run sequentially and which could run together.

Documentation