Spatialmathematics
A Tutorial on Spatial Mathematics
Install / Use
/learn @jhavl/SpatialmathematicsREADME
A Tutorial on Spatial Mathematics
By Jesse Haviland and Peter Corke
This repository contains a collection of Jupyter Notebooks exploring spatial mathematics and related applications. The notebooks are easily extensible to encourage experimentation.
Contents
- Synopsis
- Python Setup Guide
- Running Notebooks Locally
- Running Notebooks on Google Colab
- Acknowledgements
<a id='1'></a>
Synopsis
Spatial mathematics is an important and foundational concepts in robotics -- how to represent the position and orientation of things (robots, cameras, widgets) in two or three dimensions. These representations form the foundation of professional practice in robotics and AI. This tutorial also introduces mathematical graphs which, combined with these representations, can be used to describe relative positions of places and objects -- search algorithms applied to such graphs is foundational to most robot navigation tasks.
<br><a id='2'></a>
Python Setup Guide
The Notebooks are written using Python and we use several python packages. We recommend that you set up a virtual environment/Python environment manager. We provide a guide to setting up Conda below but feel free to use any alternative such as virtualenv or venv.
The Notebooks have been tested to run on Ubuntu, Windows and Mac OS with any currently supported version of Python (currently 3.7, 3.8 3.9 and 3.10).
Conda Environment Setup Guide
Download miniconda from here while choosing the link for your operating system and architecture.
Follow the Conda install instructions from here.
In the terminal, make a new conda environment. We called our environment smtutorial and recommend choosing Python version 3.10
conda create --name smtutorial python=3.10
We need to activate our environment to use it
conda activate smtutorial
Check out this link for a handy Conda command cheat sheet. There is also a ~30 minute Conda Tutorial available here.
Python Package Install Guide
We require several Python packages to run the Notebooks. You should activate the Conda environment before completing this stage.
We use IPython, Jupyter notebook, Robotics Toolbox for Python and associated packages
pip install ipython notebook "roboticstoolbox-python>=1.0.2" sympy
<br>
<a id='3'></a>
Running Notebooks Locally
We have tested the Notebooks in the default Jupyter Notebook web interface and the VSCode Notebook extension.
Clone the Repository
Firstly, you must clone the repository
git clone https://github.com/jhavl/spatialmathematics.git
cd dkt
Running in the Jupyter Notebook Web Interface
In terminal, activate the conda environment, navigate to the repository folder and run
conda activate smtutorial
cd "path_to_repo/spatialmathematics"
jupyter-notebook
Running in the VSCode Interface
Download and install VSCode from here.
Add the Python extension, see this link (if not already installed).
Add the Jupyter extension, see this link (if not already installed).
From VSCode, select Open Folder... and navigate to and select the repository folder. You may be prompted to select if you trust the contents of the folder. Warning If you decline to trust the folder, it is unlikely that you will be able to run any of the Notebooks.
After selecting the folder, choose which Notebook you would like to run from the Explorer menu on the left side of the screen.
Once a Notebook is open, you must select the kernel from the Select Kernel button in the top right side of the screen. Choose the conda environment we created earlier smtutorial (Python 3.10.X).
<a id='4'></a>
Running Notebooks on Google Colab
For the fastest and smoothest experience, it is recommended to run the Notebooks locally. However, most Notebooks can be run online on the Google Colab platform.
<br><a id='6'></a>
Acknowledgements
This tutorial is supported by the Queensland University of Technology Centre for Robotics (QCR).
<img src="https://github.com/jhavl/dkt/raw/main/img/qcr.png" width="500">Related Skills
node-connect
340.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
84.2kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
84.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
340.5kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
