Localisation debugging tools
Localisation is complicated, combining probability and geometry for coordinate transformation in looping code, where effects can stack up into unexpected behavior. We are going to need some tools to help us debug this system.
In this section, we will build some debugging aids.
Debugging encoders
We don't want to question if the encoder output is good while debugging localisation. So the first debugging aid will be a page to display simple encoder information.
At the end of Chapter 11, Programming Encoders with Python, the Inventor HAT service was publishing the right encoder distance and speed on the topic sensors/encoders/data. We can subscribe to a web page and display all the details.
Create the file robot_control/encoder_debug.html. We start with our usual block and title lead-in:
{% extends "robot_control/page.html.j2" %}
{% block title %}Encoder debug{% endblock %}
{% block content %}
Then we are going to create a table to display the...