What is a robot

Robotics Software Engineering · Lecture slides

Ingenuity

Ingenuity standing on the ground on Mars

Photo: NASA/JPL-Caltech/ASU, taken by the Perseverance rover on April 5, 2021

A helicopter on Mars

  • Ingenuity flew on Mars from 2021 to 2024
  • It was built to make up to 5 flights, and it made 72
  • Mars is too far away to fly it by remote control
  • Before each flight, the team sent it a list of waypoints
  • Then it flew by itself

How does it know where it is?

  1. GPS
  2. A map of the ground, loaded before the flight
  3. The team on Earth tracks it and tells it
  4. It adds up its own motion from its sensors

What it has to work with

  • A motion sensor: how it speeds up and turns, 500 times a second
  • A laser: its height above the ground, 50 times a second
  • A camera that looks down: 30 pictures a second
  • No GPS, and no map

From the sensors to the rotors

A robot is a collection of services, each with different jobs.

What does control do between two pictures?

  1. It waits for the next picture
  2. It sends 30 commands a second, one for each picture
  3. It repeats its last command
  4. It carries the estimate forward with the motion sensor

Each service runs at its own rate

  • The camera: 30 a second
  • The laser: 50 a second
  • The motion sensor and control: 500 a second
  • Between pictures, the motion sensor carries the estimate forward

Two computers

  • The flight computer is a small chip with no operating system
  • It runs the mode commander, guidance, and control, 500 times a second
  • The navigation computer is a phone processor that runs Linux
  • It runs the picture processing and navigation

Why is control not on the faster computer?

  1. The phone processor cannot run 500 times a second
  2. Linux can hold a program up for a moment, and control cannot be late
  3. To save power
  4. Control was written first

Which services there are, and where each one runs, was decided for this machine.

Flight 6: the plan

  • Climb to 10 meters
  • Fly 150 meters southwest, at 4 meters a second
  • Then 15 meters south, and 50 meters northeast
  • Land

What the camera sends to navigation

  • A picture of the ground
  • The time the picture was taken

One of its pictures, from flight 6

The ground from above, with the helicopter's shadow in the middle

Photo: NASA/JPL-Caltech, taken by Ingenuity's navigation camera on May 22, 2021

54 seconds into the flight

  • One picture is lost
  • Every picture after it arrives with the wrong time
  • The pictures themselves are good

What does the helicopter do?

  1. Nothing: one lost picture in 30 a second does not matter
  2. It drops, because navigation stops working
  3. It swings back and forth
  4. It notices the fault and lands at once

A picture with the wrong time

If the time is wrong by one picture

distance=speed×time=4 m/s×130 s≈0.13 m\begin{aligned} \text{distance} &= \text{speed} \times \text{time} \\[2ex] &= 4\ \text{m/s} \times \tfrac{1}{30}\ \text{s} \\[2ex] &\approx 0.13\ \text{m} \end{aligned}

What happened

  • It tilted more than 20 degrees, back and forth
  • The rotors were driven hard, and the power it drew spiked
  • It kept flying
  • It landed about 5 meters from where it was sent

What saved it?

  1. A second camera took over
  2. The team took control from Earth
  3. It restarted navigation in the air
  4. It was built to stop using pictures before it lands

Two decisions, made years before

  • Control stays stable when the timing is off
  • Navigation stops using pictures in the last part of the descent

Navigation did what it was written to do. What it was given was wrong.

Mars Climate Orbiter

Three people in clean suits working on the spacecraft

Photo: NASA, taken during tests on May 27, 1998

Two programs on the ground, 1999

  • One program wrote down each push of the thrusters
  • A second program read it, to work out the path to Mars
  • They had agreed on newton-seconds
  • The first program wrote pound-force seconds

How close it came to Mars

Both programs ran without an error. They did not agree on what the numbers meant.

Stanley

A blue car with five laser scanners on its roof

Photo: DARPA, at the 2005 Grand Challenge

The desert race, 2005

  • A car with no driver, in a race across the desert
  • 195 teams entered, 23 raced, and 5 finished
  • Stanley won, in 6 hours and 54 minutes
  • Its average speed was 19 miles an hour

How many programs drove Stanley?

  1. 1
  2. 3, one for each computer
  3. About 30
  4. About 300

The same jobs, divided another way

  • Stanley: about 30 programs, with none in charge
  • Ingenuity: 5 services, on 2 computers
  • In both, each one runs at its own rate

Stanley and the wrong time

  • Stanley put the time on every piece of data
  • Its lasers sometimes sent the wrong time
  • Then it saw obstacles that were not there

Three kinds of decisions

  • What the services are: 30 programs, or 5
  • What passes between them: a picture and its time, a push and its units
  • How each one is implemented: the rest of this course

None of the three has one right answer. A choice that suits one robot is often wrong for another.

Summary

  • A robot is a collection of services, each with different jobs
  • Every robot has the same jobs
  • An interface is what two services agree on about their data
  • Two programs that each work can still fail together

Before the next class

  • Read the lesson "What is a robot"
  • Work its four practice problems on paper
  • Bring your drawing for "An arm at a belt"

Sources

Arrow keys to step and move · N for notes · F to fill the screen