What is a robot
Robotics Software Engineering · Lecture slides
Ingenuity
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?
- GPS
- A map of the ground, loaded before the flight
- The team on Earth tracks it and tells it
- 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?
- It waits for the next picture
- It sends 30 commands a second, one for each picture
- It repeats its last command
- 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?
- The phone processor cannot run 500 times a second
- Linux can hold a program up for a moment, and control cannot be late
- To save power
- 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
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?
- Nothing: one lost picture in 30 a second does not matter
- It drops, because navigation stops working
- It swings back and forth
- 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×301​ s≈0.13 m​
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?
- A second camera took over
- The team took control from Earth
- It restarted navigation in the air
- 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
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
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
- 3, one for each computer
- About 30
- 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
- Ingenuity's sixth flight, by its chief pilot (NASA, 2021)
- The flight control system of the Mars helicopter (Grip et al., 2019)
- The end of Ingenuity's mission (JPL, 2024)
- The Mars Climate Orbiter mishap report (NASA, 1999)
- Stanley, the robot that won the DARPA Grand Challenge (Thrun et al., 2006)