Completed: / exercises

HW3. Virtual Sensors

Due date: 2026-02-05 23:59.
Recommended Resources:

3D Preimage Visualization

In this part of the assignment, you will explore preimages of virtual sensors for a planar mobile robot with heading.
Rather than reasoning purely algebraically, you will use an interactive visualization tool to build geometric intuition about how different sensor mappings partition the state space. You are strongly encouraged to interact with the visualizer extensively before answering the questions that follow below:
3DPreimageVisualizer-5sensors

Problem Setup

For questions in this part of the homework, consider a point-sized mobile robot moving in a planar environment:
E \subset \mathbb{R}^2, \\\
which is either:
E = [-1,1]^2, \\\
E = {(x,y)\in\mathbb{R}^2 \mid x^2+y^2 \le 1}. \\\
The robot state is:
x = (x,y,\theta) \in X = E \times S^1, \\\
where πœƒ ∈ 𝑆¹ denotes the robot’s heading.
A virtual sensor is modeled as a mapping:
h : X \to Y, \\\
where the observation space π‘Œ βŠ‚ ℝ depends on the sensor definition.

Sensor Models

The visualizer implements the following sensor mappings:
h_1(x,y,\theta) = \operatorname{dist}((x,y), \partial E). \\\
β„Ž_2(x,y,\theta)= \inf \{ t > 0 | (x,y) + t(\cos \theta,\sin \theta) \notin E. \}. \\\
Here, inf denotes the infimum of a set, which means: the greatest value that is less than or equal to every element of the set. In this context, β„Žβ‚‚(π‘₯, 𝑦, πœƒ) represents the distance from position (π‘₯, 𝑦) along heading πœƒ, at which the robot is about to leave the environment 𝐸.
h_3(x,y,\theta)= h_2(x,y,\theta+\pi). \\\
h_4(x,y,\theta) = h_2(x,y,\theta) + h_3(x,y,\theta). \\\
h_5(x,y,\theta) = \min\{ h_2(x,y,\theta+\alpha), h_2(x,y,\theta-\alpha) \}.

⚠️ Note About the Visualizer

As seen in previous assignments, numerically computing roots of real-valued functions is subject to sampling limitations and numerical error. For the same reasons, this visualizer provides only a rough approximation of a preimage. It may miss some valid states or include extra ones.
Therefore, while the visualizer is useful for building intuition, use it as guidance while still applying analytical reasoning to answer the following questions correctly.

Visualizer Recommended Use

%βœ…β„Žβ‚β»ΒΉ(0) = βˆ‚πΈ Γ— 𝑆¹. %βŒβ„Žβ‚β»ΒΉ(0) = 𝐸 Γ— 𝑆¹. %βœ…β„Žβ‚β»ΒΉ(1) = {(0, 0)} Γ— 𝑆¹. %βŒβ„Žβ‚β»ΒΉ(1) = {(π‘₯,𝑦) ∣ π‘₯Β² + 𝑦² = 1} Γ— 𝑆¹. %βœ…β„Žβ‚β»ΒΉ(2) = βˆ…. %βœ…β„Žβ‚β»ΒΉ(1/2) = {(π‘₯,𝑦,πœƒ) ∣ π‘₯Β² + 𝑦² = 1/4}. %βœ…The dimension of preimage β„Žβ‚β»ΒΉ(1/2) is 2. %βœ…The range of β„Žβ‚ is exactly [0,1]. %❌The dimension of all preimages is 2. %βœ… The set {(π‘₯,𝑦,πœƒ) ∣ β„Žβ‚(π‘₯,𝑦,πœƒ) > 0} equals int(𝐸) Γ— 𝑆¹, in which int(𝐸) denotes all points strictly inside 𝐸, not on the boundary. %βœ… βˆ€ πœƒβ‚ β‰  πœƒβ‚‚, if (π‘₯, 𝑦, πœƒβ‚) ∈ β„Žβ‚β»ΒΉ, then (π‘₯, 𝑦, πœƒβ‚‚) ∈ β„Žβ‚β»ΒΉ.

Question 1

In the visualizer, select the disk environment first. Then select sensor β„Žβ‚, which measures the distance to the closest boundary. For this environment, which statements are true about β„Žβ‚ and its preimages?
Select ALL that are true:
Warning: You have not logged in. You cannot answer.
%βœ… β„Žβ‚β»ΒΉ(0) = βˆ‚πΈ Γ— 𝑆¹. %❌ β„Žβ‚β»ΒΉ(0) = 𝐸 Γ— 𝑆¹. %βœ… β„Žβ‚β»ΒΉ(1) = {(0, 0)} Γ— 𝑆¹. %❌ β„Žβ‚β»ΒΉ(1) = [βˆ’1,1] Γ— {0} Γ— 𝑆¹. %βœ… β„Žβ‚β»ΒΉ(2) = βˆ…. %βœ… [βˆ’1, 1] Γ— {-1} Γ— 𝑆¹ βŠ‚ β„Žβ‚β»ΒΉ(0). %βŒβ„Žβ‚β»ΒΉ(1/2) = [βˆ’1/2, 1/2]Β² Γ— 𝑆¹. %βœ…The dimension of preimage β„Žβ‚β»ΒΉ(1/2) is 2. %βœ…The range of β„Žβ‚ is exactly [0,1]. %❌The dimension of all preimages is 2. %βœ… The set {(π‘₯,𝑦,πœƒ) ∣ β„Žβ‚(π‘₯,𝑦,πœƒ) > 0} equals int(𝐸) Γ— 𝑆¹, in which int(𝐸) denotes all points strictly inside 𝐸, not on the boundary. %βœ… βˆ€ πœƒβ‚ β‰  πœƒβ‚‚, if (π‘₯, 𝑦, πœƒβ‚) ∈ β„Žβ‚β»ΒΉ, then (π‘₯, 𝑦, πœƒβ‚‚) ∈ β„Žβ‚β»ΒΉ.

Question 2

Now, select the square environment for the same sensor β„Žβ‚.
For this environment, select ALL of the statements that are true about β„Žβ‚ and its preimages:
Warning: You have not logged in. You cannot answer.
%❌ β„Žβ‚‚β»ΒΉ(0) = βˆ‚πΈ Γ— 𝑆¹. %❌ β„Žβ‚‚β»ΒΉ(0) = 𝐸 Γ— 𝑆¹. %❌ β„Žβ‚‚β»ΒΉ(1) = {(0, 0)} Γ— 𝑆¹. %βœ… {(0, 0)} Γ— 𝑆¹ βŠ‚ β„Žβ‚‚β»ΒΉ(𝟣). %βœ… β„Žβ‚‚β»ΒΉ(1) can be expressed as the union over πœƒ ∈ 𝑆¹ of planar circular arcs, each of which is located in a plane parallel to the (π‘₯,𝑦)-plane. %❌ β„Žβ‚‚β»ΒΉ(2) = βˆ…. %βœ… β„Žβ‚‚β»ΒΉ(1/2) can be expressed as the union over πœƒ ∈ 𝑆¹ of planar circular arcs, each of which is located in a plane parallel to the (π‘₯,𝑦)-plane. %βœ… The range of β„Žβ‚‚ is exactly [0,2]. %❌ The dimension of all preimages is 2. %❌ The set {(π‘₯,𝑦,πœƒ) ∣ β„Žβ‚‚(π‘₯,𝑦,πœƒ) > 0} equals int(𝐸) Γ— 𝑆¹, in which int(𝐸) denotes all points strictly inside 𝐸, not on the boundary. %❌ βˆ€ πœƒβ‚ β‰  πœƒβ‚‚, if (π‘₯, 𝑦, πœƒβ‚) ∈ β„Žβ‚‚β»ΒΉ, then (π‘₯, 𝑦, πœƒβ‚‚) ∈ β„Žβ‚‚β»ΒΉ.

Question 3

In the visualizer, for the disk environment, select sensor β„Žβ‚‚, which measures the distance to the boundary along the robot heading.
For this environment, which statements about β„Žβ‚‚ and its preimages are true?
Note:
  • Think of β„Žβ‚‚ as the maximum distance the robot can move in direction πœƒ while remaining in 𝐸.
  • When the robot is exactly on the boundary, the distance along heading is not always 0, and this case must be reasoned about analytically.
  • The visualizer can miss (or add) some cases due to numerical sampling limitations.
Warning: You have not logged in. You cannot answer.
%❌ β„Žβ‚‚β»ΒΉ(0) = βˆ‚πΈ Γ— 𝑆¹. %❌ β„Žβ‚‚β»ΒΉ(0) = 𝐸 Γ— 𝑆¹. %❌ β„Žβ‚‚β»ΒΉ(1) = {(0, 0)} Γ— 𝑆¹. %❌ {(0, 0)} Γ— 𝑆¹ βŠ‚ β„Žβ‚‚β»ΒΉ(𝟣). %βœ… β„Žβ‚‚β»ΒΉ(1) can be expressed as the union over πœƒ ∈ 𝑆¹ of line segments, each of which is located in a plane parallel to the (π‘₯,𝑦)-plane. %❌ β„Žβ‚‚β»ΒΉ(2) = βˆ…. %βœ… β„Žβ‚‚β»ΒΉ(1/2) can be expressed as the union over πœƒ ∈ 𝑆¹ of line segments, each of which is located in a plane parallel to the (π‘₯,𝑦)-plane. %❌ The range of β„Žβ‚‚ is exactly [0,1]. %❌ The dimension of all preimages is 2.

Question 4

In the visualizer, for the square environment, select sensor β„Žβ‚‚, which measures the distance to the boundary along the robot heading.
For this environment, which statements are true about β„Žβ‚‚ and its preimages?
Warning: You have not logged in. You cannot answer.
%❌ β„Žβ‚„β»ΒΉ(0) = βˆ‚πΈ Γ— 𝑆¹. %βœ… β„Žβ‚„β»ΒΉ(0) = βˆ…. %❌ β„Žβ‚„β»ΒΉ(2) = βˆ…. %βœ… {(0, 0)} Γ— 𝑆¹ βŠ‚ β„Žβ‚„β»ΒΉ(2). %βœ… The set {(π‘₯,𝑦,πœƒ) ∣ β„Žβ‚„(π‘₯,𝑦,πœƒ) = 2} consists exactly of states for which the line through (π‘₯,𝑦) in direction πœƒ passes through the origin. %❌ β„Žβ‚„ is independent of πœƒ (i.e., changing πœƒ does not change the value). %❌ For every (π‘₯,𝑦) ∈ 𝐸 and every πœƒ ∈ 𝑆¹, we have β„Žβ‚„(π‘₯,𝑦,πœƒ) β‰₯ 1. %❌ The set {(π‘₯,𝑦,πœƒ) ∣ β„Žβ‚„(π‘₯,𝑦,πœƒ) > 0} equals int(𝐸) Γ— 𝑆¹. %βœ… β„Žβ‚„β»ΒΉ(1) can be expressed as the union over πœƒ ∈ 𝑆¹ of line segments, each of which is located in a plane parallel to the (π‘₯,𝑦)-plane.

Question 5

In the visualizer, for the disk environment, select sensor β„Ž4, which measures the corridor width along the heading.
For this environment, which statements are true about β„Ž4 and its preimages?
Warning: You have not logged in. You cannot answer.
%❌ β„Žβ‚ ∼ β„Žβ‚‚. %❌ β„Žβ‚‚ ∼ β„Žβ‚ƒ. %❌ β„Žβ‚‚ ∼ β„Žβ‚„. %❌ β„Žβ‚‚ βͺ° β„Žβ‚ƒ. %❌ β„Žβ‚ƒ βͺ° β„Žβ‚‚. %❌ β„Žβ‚‚ βͺ° β„Žβ‚. %❌ β„Žβ‚ βͺ° β„Žβ‚‚. %❌ β„Žβ‚„ βͺ° β„Žβ‚. %❌ β„Žβ‚„ βͺ° β„Žβ‚‚. %❌ β„Žβ‚„ βͺ° β„Žβ‚ƒ. % βœ… Sensors β„Žβ‚, β„Žβ‚‚, β„Žβ‚ƒ, β„Žβ‚„ are incomparable.

Question 6

Consider the sensors β„Žβ‚, β„Žβ‚‚, β„Žβ‚ƒ, β„Žβ‚„. Which statements are true?
Warning: You have not logged in. You cannot answer.
%❌ β„Žβ‚‚β‚ƒ βͺ° β„Žβ‚. %❌ β„Žβ‚ βͺ° β„Žβ‚‚β‚ƒ. %βœ… β„Žβ‚‚β‚ƒ βͺ° β„Žβ‚‚. %❌ β„Žβ‚‚ βͺ° β„Žβ‚‚β‚ƒ. %βœ… β„Žβ‚‚β‚ƒ βͺ° β„Žβ‚ƒ. %❌ β„Žβ‚ƒ βͺ° β„Žβ‚‚β‚ƒ. %βœ… β„Žβ‚‚β‚ƒ βͺ° β„Žβ‚„. %❌ β„Žβ‚„ βͺ° β„Žβ‚‚β‚ƒ.

Question 7

Consider the sensors β„Žβ‚, β„Žβ‚‚, β„Žβ‚ƒ, β„Žβ‚„ and the additional (vector-valued) sensor:
h_{23}(x,y,\theta)=\big(h_2(x,y,\theta), \, h_3(x,y,\theta)\big). \\\
Which statements are TRUE? (Select all that are true.)
Warning: You have not logged in. You cannot answer.
%❌ β„Žβ‚…β»ΒΉ(0) = βˆ‚πΈ Γ— 𝑆¹. %❌ β„Žβ‚…β»ΒΉ(0) = 𝐸 Γ— 𝑆¹. %βœ… {(0, 0)} Γ— 𝑆¹ βŠ‚ β„Žβ‚…β»ΒΉ(1). %βœ… β„Žβ‚…β»ΒΉ(1) can be expressed as the union over πœƒ ∈ 𝑆¹ of planar circular arcs. %βœ… β„Žβ‚…β»ΒΉ(1/2) can be expressed as the union over πœƒ ∈ 𝑆¹ of planar circular arcs. %❌ The range of β„Žβ‚… is exactly [0, 1]. %❌ β„Žβ‚… is independent of πœƒ. %❌ The set {(π‘₯,𝑦,πœƒ) ∣ β„Žβ‚…(π‘₯,𝑦,πœƒ) > 0} equals int(𝐸) Γ— 𝑆¹. %βœ… β„Žβ‚…β»ΒΉ(1) = β„Žβ‚‚β»ΒΉ(1) ∩ β„Žβ‚ƒβ»ΒΉ(1) for 𝛼 = 90Β°. %βœ… β„Žβ‚…β»ΒΉ(1) = β„Žβ‚‚β»ΒΉ(1) for 𝛼 = 0Β°.

Question 8

In the visualizer, select the disk environment and sensor β„Žβ‚…, the two-ray aperture sensor with an aperture angle 𝛼 ∈ [0Β°, 90Β°].
For this environment, which statements are true about β„Žβ‚… and its preimages for all such 𝛼?
Select ALL that are true:
Warning: You have not logged in. You cannot answer.
%βœ… β„Žβ‚… ∼ β„Žβ‚‚, for 𝛼 = 0Β°. %❌ β„Žβ‚… ∼ β„Žβ‚ƒ, for 𝛼 = 0Β°. %βœ… β„Žβ‚… βͺ° β„Žβ‚‚, for 𝛼 = 0Β°. %βœ… β„Žβ‚‚ βͺ° β„Žβ‚…, for 𝛼 = 0Β°. %❌ β„Žβ‚… ∼ β„Žβ‚ƒ, for 𝛼 = 90Β°. %❌ β„Žβ‚… ∼ β„Žβ‚‚, for 𝛼 = 90Β°. %❌ β„Žβ‚… βͺ° β„Žβ‚ƒ, for 𝛼 = 90Β°. %❌ β„Žβ‚ƒ βͺ° β„Žβ‚…, for 𝛼 = 90Β°. %❌ β„Žβ‚… ∼ β„Žβ‚„, for 𝛼 = 90Β°. %❌ β„Žβ‚„ βͺ° β„Žβ‚…, for 𝛼 = 90Β°.

Question 9

Consider the two-ray aperture sensor, β„Žβ‚…, with either the disk or the square environment. Consider two aperture angles 𝛼 = 0 and 𝛼 = 90Β°.
Select ALL statements that are true:
Warning: You have not logged in. You cannot answer.
%βœ…The sensor output β„Ž is independent of πœƒ. %βœ…For any environment 𝐸 ∈ {𝐸₁, 𝐸₂}, β„Ž(𝑝,πœƒ,𝐸) = 0 if and only if 𝑝 ∈ βˆ‚πΈ. %βŒβ„Žβ»ΒΉ(0) contains all states with 𝑝 ∈ βˆ‚πΈβ‚ βˆͺ βˆ‚πΈβ‚‚. %βœ…β„Žβ»ΒΉ(0) = (βˆ‚πΈβ‚ Γ— 𝑆¹ Γ— {𝐸₁}) βˆͺ (βˆ‚πΈβ‚‚ Γ— 𝑆¹ Γ— {𝐸₂}). %βœ…If β„Ž(𝑝,πœƒ,𝐸) = 1, then necessarily 𝑝 = (0, 0). %❌If β„Ž(𝑝,πœƒ,𝐸) = 1, then necessarily 𝐸 = 𝐸₁. %βœ…There exist two different states π‘₯₁ = (𝑝,πœƒ,𝐸₁) and π‘₯β‚‚ = (𝑝,πœƒ,𝐸₂) with the same 𝑝 and πœƒ such that β„Ž(π‘₯₁) β‰  β„Ž(π‘₯β‚‚). %❌ For every 𝑝 ∈ 𝐸₁ ∩ 𝐸₂, dist(𝑝, βˆ‚πΈβ‚) = dist(𝑝, βˆ‚πΈβ‚‚). %βœ… There exist 𝑝 ∈ 𝐸₁ βˆͺ 𝐸₂ such that dist(𝑝, βˆ‚πΈβ‚) = dist(𝑝, βˆ‚πΈβ‚‚). %βœ… For any state with 𝐸 = 𝐸₁, β„Ž(𝑝,πœƒ,𝐸₁) ≀ 1. And for any state with 𝐸 = 𝐸₂, β„Ž(𝑝,πœƒ,𝐸₂) ≀ 1.

Question 10

Let the environment be uncertain:
\mathcal{E} = \{E_1, E_2\}, \,\,\,\,\, E_1 = [-1,1]^2, \,\,\,\,\, E_2 = \{(x,y) \in \mathbb{R}^2 \mid x^2 + y^2 \le 1\}. \\\
State space:
X = (E_1 \cup E_2) \times S^1 \times \{E_1, E_2\}. \\\
Write a state as π‘₯ = (𝑝, πœƒ, 𝐸) with 𝑝 = (π‘₯, 𝑦). Define distance to the closest boundary of 𝐸:
d_E(p) = \operatorname{dist}(p, \partial E). \\\
And the virtual sensor:
h : X \to \mathbb{R}_{\ge 0}, \quad h(p,\theta,E) = d_E(p). \\\
Select ALL statements that are true:
Warning: You have not logged in. You cannot answer.

Multiple robots

Consider 10 point-sized mobile robots moving in a planar square environment
E = [-1,1]^2 \subset \mathbb{R}^2. \\\
Each robot has no heading and no internal degrees of freedom. The state of robot 𝑖 is given only by its position
p_i = (x_i,y_i) \in E, \quad \forall i \in \{1,\dots,10\}. \\\
The state space of the system is denoted by 𝑋.
A virtual sensor is modeled as a mapping:
h : X \to Y, \\\
where π‘Œ is the observation space.
Let the detection region be a fixed set 𝑉 βŠ‚ 𝐸. Define the following three sensor mappings:
h_6(x) = \begin{cases} 1, & \text{if } \,\, βˆƒi ∈ \{1, . . . , 10\}\,|\, p_i \in V,\\ 0, & \text{otherwise.} \end{cases} \\\
h_7(x) = \begin{cases} 1, & \text{if }\, βˆ€ i ∈ \{1, . . . , 10\},\,\, p_i \in V,\\ 0, & \text{otherwise.} \end{cases} \\\
h_8(x) = \bigl| \{ i ∈ \{1,...,10\} \mid p_i \in V \} \bigr|. \\\
%❌ 𝑋 = ℝ². %❌ 𝑋 = ℝ¹⁰. %❌ 𝑋 = ℝ³⁰. %βœ… 𝑋 βŠ‚ ℝ²⁰. %βœ… 𝑋 = 𝐸¹⁰ = 𝐸 Γ— 𝐸 Γ— β‹― Γ— 𝐸 (10 times). %❌ Each state in 𝑋 is a single point in the plane. %βœ… Each state in 𝑋 is a 10-tuple (𝑝₁,…,𝑝₁₀) with 𝑝ᡒ ∈ 𝐸. %❌ The state space 𝑋 depends on the detection region 𝑉.

Question 11

Which of the following statements about the state space 𝑋 are TRUE?
Warning: You have not logged in. You cannot answer.
%βœ… 𝑉 βŠ‚ 𝐸. %❌ 𝑉 = 𝐸. %❌ 𝑉 βŠ‚ ℝ²⁰. %βœ… A robot is in the detection region if and only if its position lies in 𝑉. %βœ… If a state π‘₯ ∈ 𝑉¹⁰, then β„Žβ‚†(π‘₯) = β„Žβ‚‡(π‘₯) = β„Žβ‚ˆ(π‘₯) = 1. %βœ…If a state π‘₯ ∈ 𝑉 Γ— 𝐸⁹, then at least one robot is guaranteed to be in 𝑉.

Question 12

Which of the following statements about the detection region 𝑉 are TRUE?
Warning: You have not logged in. You cannot answer.
%βœ… β„Žβ‚† detects whether at least one robot lies in 𝑉. %❌ β„Žβ‚† detects whether all robots lie in 𝑉. %❌ β„Žβ‚† counts the number of robots that lie in 𝑉. %βœ… β„Žβ‚†(𝒙) = 1 if and only if exactly one robot lies in 𝑉. %βœ…If a state π‘₯ ∈ 𝑉 Γ— 𝐸⁹, then β„Žβ‚†(π‘₯) = 1. %βœ… If a state π‘₯ ∈ 𝑉¹⁰, then β„Žβ‚†(π‘₯) = 1.

Question 13

Which of the following statements about sensor β„Žβ‚† are TRUE?
Warning: You have not logged in. You cannot answer.
%βœ… β„Žβ‚‡ detects whether all robots lie in 𝑉. %❌ β„Žβ‚‡ detects whether at least one robot lies in 𝑉. %❌ β„Žβ‚‡ counts the number of robots that lie in 𝑉. %❌If a state π‘₯ ∈ 𝑉 Γ— 𝐸⁹ then β„Žβ‚‡(π‘₯) = 1. %βœ… If a state π‘₯ ∈ 𝑉¹⁰, then β„Žβ‚‡(π‘₯) = 1. %❌ β„Žβ‚‡(𝒙) = 1 if and only if exactly one robot lies in 𝑉.

Question 14

Which of the following statements about sensor β„Žβ‚‡ are TRUE?
Warning: You have not logged in. You cannot answer.
%❌ β„Žβ‚ˆ(𝒙) ∈ {0,1} for all states. %❌ If a state π‘₯ ∈ 𝑉 Γ— 𝐸⁹ then β„Žβ‚ˆ(π‘₯) = 1. %βœ… If a state π‘₯ ∈ 𝑉¹⁰, then β„Žβ‚ˆ(π‘₯) = 10. %βŒβ„Žβ‚† ∼ β„Žβ‚‡. %βŒβ„Žβ‚‡ ∼ β„Žβ‚ˆ. %βŒβ„Žβ‚† βͺ° β„Žβ‚‡. %βŒβ„Žβ‚‡ βͺ° β„Žβ‚ˆ. %βœ…β„Žβ‚ˆ βͺ° β„Žβ‚†. %βœ…β„Žβ‚ˆ βͺ° β„Žβ‚‡.

Question 15

Which of the following statements about sensor β„Žβ‚ˆ are TRUE?
Warning: You have not logged in. You cannot answer.

Authors

Anna LaValle.
?