You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/manual/tuto/cp_robotics/lesson_e_tiles.rst
+83-26Lines changed: 83 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Lesson E: Tile-based localization
5
5
6
6
Main authors: `Simon Rohou <https://www.simon-rohou.fr/research/>`_, `Maël Godard <https://godardma.github.io>`_
7
7
8
-
This lesson addresses a state-estimation problem arising in indoor mobile robotics. A differential-drive robot evolves on a floor covered with square tiles of known width :math:`L`. Unlike range-based localization, we do not rely on external landmarks. Instead, the floor itself provides sparse exteroceptive information: each time the passive support caster crosses a grout line between two tiles, a shock appears in the accelerometer signal and can be detected after a simple filtering stage.
8
+
This lesson addresses a state-estimation problem arising in indoor mobile robotics. A differential-drive robot evolves on a floor covered with square tiles of known width :math:`L`. Unlike range-based localization, we do not rely on external landmarks. Instead, the floor itself provides sparse exteroceptive information: each time the passive support caster crosses a grout line between two tiles, a shock appears in the gyroscope data and can be detected after a simple filtering stage.
9
9
10
10
The platform considered here is a `TurtleBot Burger <https://emanual.robotis.com/docs/en/platform/turtlebot3/overview/>`_-like robot with two motorized wheels and one passive caster. Wheel odometers provide two signals :math:`u[0](\cdot)` and :math:`u[1](\cdot)`, from which the signed longitudinal speed can be reconstructed.
11
11
In addition, we assume that a heading sensor provides bounded measurements. The tile-crossing instants are already extracted from accelerometers data and provided in a ``txt`` file. The objective is to combine these data in order to re-estimate the robot position over time.
@@ -58,7 +58,7 @@ The wheel odometers provide two wheel-angle trajectories :math:`u[0](\cdot)` and
In practice, the heading is measured directly and these measurements will be preferred to the one obtained by integrating :math:`\dot x_3`, in order to avoid drift. The planar kinematics of the axle midpoint is therefore modeled by
61
+
In practice, the heading is provided and these measurements will be preferred to the one obtained by integrating :math:`\dot x_3`, in order to avoid drift. The planar kinematics of the axle midpoint is therefore modeled by
62
62
63
63
.. math::
64
64
:label: eq-tile-f
@@ -67,6 +67,10 @@ In practice, the heading is measured directly and these measurements will be pre
67
67
\qquad
68
68
\dot x_2(t)=x_4(t)\sin\big(x_3(t)\big).
69
69
70
+
71
+
The passive caster (support wheel)
72
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
73
+
70
74
The passive caster is located on the longitudinal axis of the robot, behind the axle in the robot frame. Its position in the world frame is thus
71
75
72
76
.. math::
@@ -90,27 +94,35 @@ The passive caster is located on the longitudinal axis of the robot, behind the
90
94
91
95
A useful practical remark is that the robot crosses tile joints more sharply when driving backward. In that case, the passive caster becomes the leading contact point with respect to the direction of motion, so the shock induced by a grout line is generally more pronounced and easier to detect. In this dataset, the integration is therefore performed with a reverse speed, i.e. :math:`x_4(t)` is mostly negative. This does not change the geometry of the robot: the caster is still given by Eq. :eq:`eq-tile-caster`, but it becomes the first element of the robot to meet the joint along the direction of motion.
92
96
97
+
98
+
The tile floor
99
+
^^^^^^^^^^^^^^
100
+
93
101
The floor is modeled as an infinite square tiling of width :math:`L`. The set of grout lines is the union of vertical lines :math:`x=kL` and horizontal lines :math:`y=kL`, for all :math:`k\in\mathbb{Z}`. If :math:`t_i` is one of the extracted detection times, the caster position must satisfy
where :math:`\varepsilon_L>0` accounts for tile and grout imperfections, as well as small geometric mismatches between the ideal square grid model and the actual floor.
103
111
112
+
113
+
Tile-crossing events
114
+
^^^^^^^^^^^^^^^^^^^^
115
+
104
116
The fact that the filtered shock is detected slightly after the physical crossing is treated separately at the temporal level: in practice, the contraction will be applied at a time slightly before :math:`t_i`.
105
117
106
118
A convenient implicit formulation uses the modulo operator:
This is the observation model we will encode with a contractor.
116
128
@@ -153,15 +165,13 @@ Initialization and data loading
153
165
> Name: codac
154
166
Version: 2.0.0.dev28
155
167
156
-
The required version for this tutorial is 2.0.0.dev28 or later.
157
-
158
-
The following instructions are given in Python, but feel free to use C++ or Matlab if you prefer.
168
+
The required version for this tutorial is ``2.0.0.dev28`` or later.
159
169
160
170
161
171
.. admonition:: Exercise
162
172
163
-
**E.1. Imports and data paths.**
164
-
Start with the imports below. We explicitly import ``builtins`` because ``from codac import *`` shadows Python's ``min`` and ``max``.
173
+
**E.1. Imports.**
174
+
Start with the imports below.
165
175
166
176
.. tabs::
167
177
@@ -179,7 +189,7 @@ The following instructions are given in Python, but feel free to use C++ or Matl
179
189
:language: c++
180
190
:start-after: [E-q1-beg]
181
191
:end-before: [E-q1-end]
182
-
:dedent:2
192
+
:dedent:0
183
193
184
194
.. group-tab:: Matlab
185
195
@@ -190,7 +200,7 @@ The following instructions are given in Python, but feel free to use C++ or Matl
190
200
:dedent: 0
191
201
192
202
**E.2. Loading sampled trajectories.**
193
-
Load the binary ``.cdc`` files into sampled trajectories. We resample the wheel odometry on the same temporal support as ``pos``.
203
+
Load the binary ``.cdc`` files into sampled trajectories. We further resample the wheel odometry on the same temporal support as ``pos``.
194
204
195
205
.. tabs::
196
206
@@ -238,7 +248,7 @@ The following instructions are given in Python, but feel free to use C++ or Matl
238
248
:language: c++
239
249
:start-after: [E-q3-beg]
240
250
:end-before: [E-q3-end]
241
-
:dedent:2
251
+
:dedent:0
242
252
243
253
.. group-tab:: Matlab
244
254
@@ -248,9 +258,61 @@ The following instructions are given in Python, but feel free to use C++ or Matl
248
258
:end-before: [E-q3-end]
249
259
:dedent: 0
250
260
261
+
.. tabs::
262
+
263
+
.. group-tab:: Python
264
+
265
+
.. literalinclude:: src/lesson_E.py
266
+
:language: py
267
+
:start-after: [E-q3b-beg]
268
+
:end-before: [E-q3b-end]
269
+
:dedent: 0
270
+
271
+
.. group-tab:: C++
272
+
273
+
.. literalinclude:: src/lesson_E.cpp
274
+
:language: c++
275
+
:start-after: [E-q3b-beg]
276
+
:end-before: [E-q3b-end]
277
+
:dedent: 2
278
+
279
+
.. group-tab:: Matlab
280
+
281
+
.. literalinclude:: src/lesson_E.m
282
+
:language: matlab
283
+
:start-after: [E-q3b-beg]
284
+
:end-before: [E-q3b-end]
285
+
:dedent: 0
286
+
251
287
252
288
**E.4. Drawing the map.**
253
-
Write a function ``draw_map(X, L)`` that draws the infinite grid, clipped to a bounding box ``X``. As in the reference example, two tiles are highlighted in green.
289
+
Write a function ``draw_map(X,L)`` that draws the infinite grid, clipped to a bounding box ``X``. As in the reference example, two tiles are highlighted in green.
290
+
291
+
.. tabs::
292
+
293
+
.. group-tab:: Python
294
+
295
+
.. literalinclude:: src/lesson_E.py
296
+
:language: py
297
+
:start-after: [E-q4b-beg]
298
+
:end-before: [E-q4b-end]
299
+
:dedent: 0
300
+
301
+
.. group-tab:: C++
302
+
303
+
.. literalinclude:: src/lesson_E.cpp
304
+
:language: c++
305
+
:start-after: [E-q4b-beg]
306
+
:end-before: [E-q4b-end]
307
+
:dedent: 2
308
+
309
+
.. group-tab:: Matlab
310
+
311
+
.. literalinclude:: src/lesson_E.m
312
+
:language: matlab
313
+
:start-after: [E-q4b-beg]
314
+
:end-before: [E-q4b-end]
315
+
:dedent: 0
254
316
255
317
.. tabs::
256
318
@@ -268,7 +330,7 @@ The following instructions are given in Python, but feel free to use C++ or Matl
268
330
:language: c++
269
331
:start-after: [E-q4-beg]
270
332
:end-before: [E-q4-end]
271
-
:dedent:2
333
+
:dedent:0
272
334
273
335
.. group-tab:: Matlab
274
336
@@ -284,9 +346,9 @@ The following instructions are given in Python, but feel free to use C++ or Matl
You may introduce one analytic function for the first coordinate and one for the second one, as in the previous lessons, and then combine :ref:`the corresponding contractors <sec-ctc-analytic-ctcinverse>` with a union. A union of contractors is represented by the ``CtcUnion`` class, and can be called directly using the operator ``|``.
292
354
@@ -458,7 +520,7 @@ The recorded heading and wheel-odometry trajectories are loaded from the files i
0 commit comments