HW4. Triangulation and Temporal Filtering¶
Due date: 2026-06-13 23:59.
Recommended Resources:
- SF: Sensing and Filtering, Steven M. LaValle, PDF
- Recorded Lectures and Slides
Part 1: Problems Using Visualizer¶
In the first part of the homework, you will explore trajectory filtering and spatial triangulation for a mobile robot using an interactive visualization tool. Rather than reasoning only analytically, you will observe how sets of sampled trajectories evolve over time under a motion model and how sensor measurements prune those sets via intersections of preimages.
State Space and Environment¶
The robot moves in a square planar environment:
E = [-1,1] \times [-1,1] \subset \mathbb{R}^2 .
\\\
The robot state includes position, heading, speed, and time:
(x_1, x_2, \theta, s, t) \in X, \quad
(x_1,
x_2)
\in E,
\\\
in which:
- π β πΒΉ is the heading (direction of motion),
- π β₯ 0 is the speed along the heading.
Time¶
Time is discretized into measurement stages:
t \in \{0,1,2,3,4\}.
\\\
At each time stage:
- Starting from the sampled initial states at time π‘ = 0, trajectories are propagated forward using the motion model.
- Available sensor measurements at that time are applied to prune inconsistent trajectories.
- Only surviving trajectories are propagated into the next stage.
Initial Conditions¶
At time π‘ = 0, you may set up the initial conditions, resulting in the robotβs initial state being either known or partially/fully unknown. You may set up:
- Initial π₯β and π₯β values as
π₯β,βandπ₯β,β. - Initial heading
πβ. - Initial speed,
π β.
The visualization tool generates an initial set of states by sampling:
- positions (π₯β, π₯β) on a uniform grid in πΈ,
- headings π from a finite set of angles,
- speeds π from a finite set of values.
If no initial conditions are specified, the resulting samples represent complete uncertainty over the state space, and, therefore, over the possible trajectories. The visualizer only shows the (π₯β, π₯β, π‘) projections of the trajectories. To visualize the paths that the robot executes, you need to further project the trajectories onto the (π₯β, π₯β)-plane.
Motion Model¶
Each sampled state generates a candidate trajectory evolving over time. Between measurement stages, time can be further discretized into Ξπ‘ intervals, and each trajectory evolves according to:
\begin{bmatrix}
x_1 \\
x_2 \\
t
\end{bmatrix}_{k+1} =
\begin{bmatrix}
x_1 \\
x_2 \\
t
\end{bmatrix}_{k}
+
\begin{bmatrix}
π _k \cos \theta_k \\
π _k \sin \theta_k \\
1
\end{bmatrix}
\Delta t .
\\\
with optional bounded changes at each Ξπ‘ for:
- heading π,
- speed π .
Sensors¶
At each time stage, the following geometric sensors may report measurements.
1. Distance-to-Boundary Sensor¶
This nondeterministic sensor reports the distance from the robotβs position to the closest boundary of the environment:
h_1(x_1, x_2, \theta, π , t, d) = \min\{1 - |x_1|, 1 - |x_2|\} + π, \qquad π β [β\varepsilon_1, \varepsilon_1].
\\\
Geometrically, the preimage of this sensor is a thick band parallel to the boundary of the square.
2. Vertical π₯β-Strip Sensor¶
This sensor constrains the π₯β-coordinate:
h_2(x_1, x_2,\theta,π ,t,d) = x_1 + d, \qquad d \in [-\varepsilon_2,\varepsilon_2].
\\\
Its preimage is a vertical strip in the (π₯β, π₯β)-plane.
3. Horizontal π₯β-Strip Sensor¶
This sensor constrains the π₯β-coordinate:
h_3(x_1, x_2,\theta,π ,t,d) = x_2 + d, \qquad d \in [-\varepsilon_3,\varepsilon_3].
\\\
The corresponding preimage is a horizontal strip in the (π₯β, π₯β)-plane.
Triangulation and Trajectory Filtering¶
At a given time stage, any subset of sensors may be active.
Let the available measurements at a given time stage π‘ be denoted by π¦β, π¦β, and π¦β, corresponding to sensors ββ, ββ, and ββ, respectively. The set of states consistent with all available measurements is given by the intersection of the corresponding preimages:
\Delta(y_1, y_2, y_3) =
H_1^{-1}(y_{1})
\, \cap \,
H_2^{-1}(y_{2})
\, \cap \,
H_3^{-1}(y_{3}).
\\\
πβ β E denotes the projection of consistent states at time π‘ onto position space. That is, πβ consists of all position pairs (π₯β, π₯β) for which there exists a state with position (π₯β, π₯β) that lies in the intersection of the preimages. Therefore, πβ represents the region in πΈ at time stage π‘ consistent with sensing.
A trajectory is kept at time stage π‘ if its position (π₯β(π‘), π₯β(π‘)) lies in πβ. Trajectories that violate any measurement constraint are permanently discarded/filtered out.
Visualization¶
The visualization tool takes as input a set of parameters that define the initial conditions, sampling resolution, and motion model of the robot. These parameters determine which candidate trajectories are generated and how they evolve over time before being pruned by sensor measurements. The parameters are listed below:
Initial Conditions:π₯β,β: Initial value of the robotβs π₯β-position at time π‘ = 0 (if unspecified, all grid positions are used).π₯β,β: Initial value of the robotβs π₯β-position at time π‘ = 0 (if unspecified, all grid positions are used).πβ: Initial heading angle at time π‘ = 0 (if unspecified, all sampled headings are used).π β: Initial speed at time π‘ = 0 (if unspecified, all sampled speeds are used).SamplingParameters:π₯β/π₯β grid points: Number of grid points used to discretize the environment πΈ for initial position sampling.heading samples: Number of discrete heading values used to sample possible directions of motion.speed samples: Number of discrete speed values used to sample possible magnitudes of motion.π βββ: Maximum allowable speed used when sampling speeds and applying speed changes.Motion Model:time step, Ξπ‘: Time increment used to propagate trajectories between measurement stages.heading can change: Enables or disables random bounded changes in heading during propagation.speed can change: Enables or disables random bounded changes in speed during propagation.max heading change, Ξπ/Ξπ‘: Maximum change in heading allowed per time step when heading variation is enabled.max speed change, Ξπ /Ξπ‘: Maximum change in speed allowed per time step when speed variation is enabled.Measurements at time stages π‘ = {0, 1, 2, 3, 4}: For each time stage π‘, the following inputs may be provided:ββ (dist): Measurement reported by the distance-to-boundary sensor, specifying the robotβs distance to the closest boundary of the environment at time π‘.ββ (π₯β-strip): Measurement reported by the vertical strip sensor, constraining the robotβs π₯β-coordinate at time π‘.ββ (xβ-strip): Measurement reported by the horizontal strip sensor, constraining the robotβs π₯β-coordinate at time π‘.Measurement tolerancesfor each of the sensors can also be specified as πβ, πβ, and πβ.
Operating the Visualizer¶
Initialize: Resets the visualizer by resampling the initial set of trajectories at time π‘ = 0 using the current parameter values and clearing all previous propagation and pruning results.Next Stage (propagate + prune): Advances the motion model by one time stage by propagating all currently surviving trajectories forward in time and then removing any trajectories that violate the sensor constraints at the new stage, rendering:- a horizontal plane at the current time π‘.
- individual sensor preimages (faint colored regions).
- πβ, the projection of the intersection of all active preimages (highlighted region).
- surviving trajectories in (π₯β, π₯β, π‘) space, such that (π₯β, π₯β) β πβ.
Run All: Automatically executes all remaining stages from the current time until the final stage, repeatedly applying propagation followed by pruning at each stage.Reset to Defaults: Restores all visualizer parameters to their default values but does not automatically resample trajectories or restart the simulation. To apply the restored defaults, the visualizer must be reinitialized using Initialize.Quit: Closes the visualization tool.
This helps visually interpret:
- which regions of space are consistent with the measurements.
- how sensing interacts with the motion model and dynamics.
- how triangulation emerges from intersecting geometric constraints.
- what paths the robot can execute in the environment, satisfying the initial conditions, motion model, and the sensor measurements.
Note: Any change to parametersβwhether manual or via
Reset to Defaults β takes effect only after clicking Initialize.Part 2: Analytical Problems¶
Authors¶
Anna LaValle, Steven M. LaValle.
Give feedback on this content
Leave your comments below: