Unit 02

Writing a Command

By the end of this unit you can write each part of a command, say why each line lives where it does, and commit a movement command that gives up safely when it gets stuck.

Robotics Programming · members' unit

Writing a Command is behind a locked door

Units in Robotics Programming are for people taking the course. Getting in takes a link or a key — signing in on its own doesn't do it.

What's in this unit · 19 min read

  1. Somewhere to put your own code
  2. Getting code onto the actual robot
  3. One real command, all the way through
  4. The constructor: what never changes
  5. initialize(): what depends on the moment
  6. execute(): a little work, then return
  7. isFinished(): arrived, or out of patience
  8. end(): leave it safe, and say how it went
  9. Why Artemis wraps the library’s turn
  10. Your first real command

39 quick checksannotated specimensteppercode exercises

1 Sign in

With your school Google account. This is how your work reaches the gradebook — it doesn't open the unit by itself.

2 Get in

Open the class link your teacher posted — that's the usual way, and it enrolls you on the spot. Or paste an access key if you were handed one.

Or buy it

Reading on your own, with no class? The course can be yours.

A key unlocks this browser and keeps your progress here; signing in keeps it with you across devices. Either way the key itself is only ever checked as a hash. Manage all of this on your account, read what signing in stores, or go back to Robotics Programming.

Sources