HW4. Triangulation and Temporal Filtering¶
Due date: 2026-02-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.%β
Setting π₯β,β = 0, π₯β,β = 0, leaving πβ unspecified, and fixing π£β = 0.2 results in four straight-line paths with different headings, all originating from the origin and forming a radial pattern.
%β
Setting π₯β,β = 0, π₯β,β = 0, πβ = 0Β°, and π£β = 0.1 results in exactly one straight-line path.
%β
Leaving π₯β,β and π₯β,β unspecified, fixing πβ = 90Β°, and fixing π£β = 0.5 results in parallel paths.
%β Leaving π₯β,β, π₯β,β, and πβ unspecified while fixing π£β = 0.5 results in a single cluster of paths emanating from the origin.
%β
Setting π₯β,β = 0, π₯β,β = 0, fixing πβ, and leaving π£β unspecified results in four paths with the same heading, only two of which reach the boundary at π‘ = 4.
%β
Leaving all initial conditions unspecified results in the maximum number of paths permitted by the sampling parameters.
%β
Fixing only π₯β,β and leaving π₯β,β, πβ, and π£β unspecified results in paths that all start on one line at time π‘ = 0.
%β
Setting π₯β,β = 1.5 and leaving all other initial conditions unspecified results in no possible paths.
%β
Fixing πβ while leaving π₯β,β, π₯β,β, and π£β unspecified guarantees that all paths will remain parallel.
%β A. Varying Ξπ‘ while keeping all other parameters fixed has no effect on the generated paths.
%β
D. Disabling Heading can change and enabling Speed can change results in straigh-line paths.
%β E. Enabling Heading can change and disabling Speed can change results in straigh-line paths.
%β
F. With π₯β,β = π₯β,β = 0, if both Heading can change and Speed can change are disabled, then heading max change or speed max change parameters have no effect.
%β
G. With π₯β,β = π₯β,β = 0, decreasing the heading max change per step reduces the number of turns paths can take.
%β H. With π₯β,β = π₯β,β = 0, increasing the speed max change per step increases the number of turns paths can take.
%β
Increasing the speed max change per step has no effect on the generated paths unless the maximum speed π£βββ is increased.
%β J. Changing motion model parameters can reduce the number of surviving trajectories, even if no sensor measurements are applied.
%β
A. The measurement ββ = 0.8, πβ = 0.4 has the same preimage as ββ = 0, πβ = 0.6, ββ = 0, πβ = 0.6.
%β
B. The measurement ββ = 1.0, πβ = 0.2 has the same preimage as ββ = 0, πβ = 0.2, ββ = 0, πβ = 0.2.
%β C. The measurement ββ = 0.5, πβ = 0.1 has the same preimage as ββ = 0, πβ = 0.5, ββ = 0, πβ = 0.5.
%β D. The measurement ββ = 0.7, πβ = 0.3 has the same preimage as ββ = 0, πβ = 0.3, ββ = 0, πβ = 0.3.
%β E. The measurement ββ = 0.4, πβ = 0.4 has the same preimage as ββ = 0, πβ = 0.6, ββ = 0, πβ = 0.6.
%β F. The measurement ββ = 0.2, πβ = 0.1 has the same preimage as ββ = 0, πβ = 0.9, ββ = 0, πβ = 0.9.
%β G. For any π β (0, 1), the measurement ββ = π, πβ = 1 β π is equivalent to ββ = 0, πβ = 1 β π, ββ = 0, πβ = 1 β π.
%β H. No combination of strip sensors can exactly reproduce the preimage of a distance-to-boundary sensor.
%β A. Enabling Heading can change alone is guaranteed to generate at least one surviving path.
%β C. Enabling Heading can change and increasing max heading change per step will generate at least one surviving path.
%β E. Increasing the maximum speed, π£βββ, alone will generate at least one surviving path.
%β
Increasing the number of heading samples and increasing the maximum speed, π£βββ, increases the likelihood that at least one path reaches πβ.
%β
Enabling Heading can change and increasing the maximum speed π£βββ increases the likelihood that at least one path reaches πβ.
%β
G. When Heading can change is disabled, increasing the number of heading samples alone can never produce survivors unless the maximum speed, π£βββ, is also increased.
%β H. When Heading can change is enabled, increasing only the π₯β/π₯β grid samples can produce surviving paths even if the maximum speed remains π£βββ = 0.5.
%β
I. When Heading can change is enabled, increasing maximum speed, π£βββ, alone is sufficient to produce survivors.
%β
J. When Heading can change is disabled, increasing both the maximum speed, π£βββ, and the number of heading samples is sufficient to produce surviving paths.
% initial xβ,β: (blank)
% initial xβ,β: (blank)
% initial heading ΞΈβ: (blank)
% initial speed vβ: (blank)
% xβ/xβ grid points: 20
% heading samples: 40
% speed samples: 20
% v_max: 10
% time step Ξt: 0.1
% heading can change: ON
% speed can change: ON
% max heading change ΞΞΈ/Ξt (deg): 20
% max speed change Ξv/Ξt: 1
% initial xβ,β: (blank)
% initial xβ,β: (blank)
% initial heading ΞΈβ: (blank)
% initial speed vβ: (blank)
% xβ/xβ grid points: 10
% heading samples: 30
% speed samples: 30
% v_max: 30
% time step Ξt: 0.05
% heading can change: ON
% speed can change: ON
% max heading change ΞΞΈ/Ξt (deg): 50
% max speed change Ξv/Ξt: 3
Part 2: Analytical Problems¶
%T: βββ»ΒΉ(π¦) = {(π₯β, π₯β, π₯β) β π β£ π₯βΒ² + π₯βΒ² + (π₯β β 6)Β² = π¦Β²}.
% F: If (π¦β,π¦β) = (3, sqrt(45)), then Ξ(π¦β, π¦β) = {π β π β£ π₯βΒ² + π₯βΒ² = 9}.
%F: The triangulation Ξ(π¦β,2) is a point for all π¦β β [1,2].
%T: The triangulation Ξ(3,3) is a single point.
%T: βββ»ΒΉ(π¦) = {(π₯β, π₯β, π₯β) β π β£ π₯βΒ² + π₯βΒ² + π₯βΒ² = π¦Β²}.
%F: If (π¦β, π¦β) = (3, sqrt(45)), then Ξ(π¦β,π¦β) = {π β π β£ π₯βΒ² + π₯βΒ² + π₯βΒ² = 36 and π₯β = 0}.
%T: βββ»ΒΉ(0) = {(0, 0, 0)}.
%F: βββ»ΒΉ(2) is a circle of radius 2, centered at (0, 0, 6).
%T: If (π¦β, π¦β) = (3, sqrt(45)), then Ξ(π¦β, π¦β) = {π₯ β π β£ π₯βΒ² + π₯βΒ² = 9 and π₯β = 0}.
%T: The triangulation Ξ(3, π¦β) is a circle for all π¦β β [4, 5].
% T: The preimage for the accelerometer is βββ»ΒΉ(πβ) = ββΆ Γ {πβ}.
%F: Through careful calibration, it is possible to calculate velocity using πβ and πβ, taken at the same time instant.
% T: βββ»ΒΉ(πβ) = {πβ} Γ ββΆ.
% F: If ββ(π) = (0,0,0), then the sensor is stationary (not moving).
%T: The triangulation is Ξ(πβ,πβ) = {πβ} Γ βΒ³ Γ {πβ}.
% F: Triangulation Ξ(πβ,πβ) uniquely determines the velocity.
%T: The GPS unit, defined by sensor mapping ββ, could be implemented by simultaneously estimating the distances to four, non-coplanar, stationary landmarks at known locations.
% T: If ββ(π) = (0,0,0), then the acceleration could be (β1,1,β1).
% F: βββ»ΒΉ(πβ) = ββΆ.
%T: If a third sensor is introduced so that ββ(π) = πΜ, then Ξ(πβ,πβ,πβ) = {(πβ,πβ,πβ)}.
% F If π¦Μ = (π, π, π, π, π, π, π, π, π), then πβ(π¦Μ) = π
β.
% T If π¦Μ = (π, π, π, π, π, π, π, π), then πβ(π¦Μ) = π
β.
% F There exists a trajectory π₯Μ β πΏΜ in which the intruder travels from π
β to π
β without ever entering π
β
.
% T If π¦Μ = (π,π,π,π), then πβ(π¦Μ) = π
β βͺ π
β βͺ π
β βͺ π
β βͺ π
β
.
% T If π¦Μ = (π), then π»β»ΒΉ(π¦Μ) is the set of all trajectories π₯Μ β πΏΜ in which the intruder either starts in π
β and moves into π
β
, or starts in π
β
and moves into π
β.
% T If π¦Μ = (π, π, π, π, π, π), then π»β»ΒΉ(π¦Μ) is the set of all trajectories π₯Μ β πΏΜ in which the intruder starts in π
β
, moves into π
β, and then stays in π
β until the end of time.
% T If π¦Μ = (π,π), then π»β»ΒΉ(π¦Μ) = β
and πβ(π¦Μ) = β
.
% F Suppose there are two intruders who never touch each other. If π¦Μ = (π,π), then π»β»ΒΉ(π¦Μ) is the set of trajectories in which they swap between π
β
and π
β (one moves from π
β
to π
β, and the other moves from π
β to π
β
).
% F If πβ(π¦Μ) = π
β βͺ π
β βͺ π
β
and then π is observed, the intruder must be in π
β.
% F There is a limit to how many beams the intruder can cross before time π‘ = 100 is reached.
Authors¶
Anna LaValle, Steven M. LaValle.
Give feedback on this content
Leave your comments below: