Skip to main content

Module 1 — Motion models and reference frames

EDU-ROB-201 · Module 1 of 4 · Estimated effort: 2 hours including practice

Before you begin: Basic Python, algebra, vectors and introductory electronics concepts. Use the course environment and downloads.

Outcomes​

Define a planar robot pose with units; predict one discrete motion step; distinguish model assumptions from physical behaviour.

Explain and demonstrate​

A simple mobile-robot model describes pose as x, y and heading theta. In this lesson x points right, y points up, heading is measured counterclockwise in radians and speed is metres per second. A forward-Euler update uses the current heading to calculate displacement over a time step: x changes by speed × cos(theta) × dt, y by speed × sin(theta) × dt, and theta by angular speed × dt.

This is a teaching model. It ignores wheel slip, acceleration limits, localization error and collision geometry. For straight motion from the origin with heading zero, speed 1 m/s and dt 2 s, the new pose is (2, 0, 0). If angular speed is nonzero, a long Euler step approximates a curved path poorly. Reducing the step can improve the numerical approximation, but it does not remove the physical assumptions.

Worked example: name the quantities​

QuantityMeaningUnitExample
x, yPosition in world framemetres0, 0
thetaHeading from positive xradians0
speedForward body speedmetres/second1
angular speedHeading change rateradians/second0
dtStep durationseconds2

A body frame moves with the robot, while the world frame remains fixed for this scenario. The trigonometric terms convert forward body motion into world-coordinate displacement. Naming the frame prevents a learner from treating “forward” as always increasing world x.

Lab — predict and trace motion​

Setup: Download lab.py. Use only the Python simulation; do not connect motors, hardware interfaces or physical robots.

  1. Predict the straight-motion pose, then run python lab.py motion. Expect (2.0, 0.0, 0).
  2. Call step with heading approximately pi/2 and zero angular speed. Predict displacement along positive y; allow small floating-point residuals near zero.
  3. Compare one 1-second turning step with ten 0.1-second steps using the same speed and angular speed. Record the different positions and explain the approximation.
  4. Add a zero-speed case. Check that position remains fixed while heading may still change.
  5. Prepare a trace table with initial pose, inputs, duration and resulting pose for each case.

Fault injection: Pass 90 as a heading while treating it as degrees. Explain the unexpected direction; convert degrees to radians before rerunning. Expected observations: Units and integration interval affect results even when the code executes without error.

Evidence: Trace table, units, model assumptions and a short learner explanation. Cleanup: Retain the offline fixture only; no devices or services were provisioned.

Common pitfalls and teaching decisions​

A simulator can produce an apparently precise number from an unrealistic model. Do not describe that output as a measured physical result. For a learner struggling with trigonometry, begin with headings 0 and pi/2 before introducing arbitrary angles. Provide the coordinate table as an alternative to a plotted trajectory.

Retrieval and reflection​

Does a smaller time step make the model physically complete?

No. It can reduce integration error while leaving slip, sensing and actuator limitations unmodelled.

Why is a frame declaration necessary?

Position and direction depend on the reference frame. Body-forward movement is converted into world displacement using the heading.

Official references​

ROS coordinate conventions, REP 103 · Python trigonometric functions. This fixture is not a ROS installation or a physical robot controller.

Ask about facilitated enrolment