|
@@ -142,7 +142,7 @@ class OpticalSensor():
|
|
centerX_perc, distance_perc = values
|
|
centerX_perc, distance_perc = values
|
|
|
|
|
|
visible_width_at_y = self.target_distance / distance_perc
|
|
visible_width_at_y = self.target_distance / distance_perc
|
|
- x = self.x_offset - self.field_width/2 + visible_width_at_y * centerX_perc
|
|
|
|
|
|
+ x = self.x_offset + visible_width_at_y * (centerX_perc-0.5)
|
|
alpha = (self.fov/2) / 180 * math.pi
|
|
alpha = (self.fov/2) / 180 * math.pi
|
|
beta = (90 - self.fov/2) / 180 * math.pi
|
|
beta = (90 - self.fov/2) / 180 * math.pi
|
|
y = visible_width_at_y/2 / math.sin(alpha) * math.sin(beta)
|
|
y = visible_width_at_y/2 / math.sin(alpha) * math.sin(beta)
|