• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Scala-Robotics-Simulator / PPS-22-srs / #104

26 Jul 2025 09:36AM UTC coverage: 76.435% (+8.6%) from 67.873%
#104

Pull #13

github

sceredi
docs: add scaladoc to ray
Pull Request #13: feat: implement proximity sensor

105 of 113 new or added lines in 8 files covered. (92.92%)

2 existing lines in 2 files now uncovered.

253 of 331 relevant lines covered (76.44%)

11.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.91
/src/main/scala/io/github/srs/model/entity/dynamicentity/sensor/SensorSuite.scala
1
package io.github.srs.model.entity.dynamicentity.sensor
2

3
import io.github.srs.model.entity.dynamicentity.DynamicEntity
4
import io.github.srs.model.environment.Environment
5

6
/**
7
 * Represents a suite of sensors available for a dynamic entity.
8
 */
9
trait SensorSuite:
10
  /**
5✔
11
   * A sequence of proximity sensors that can sense the environment.
12
   *
13
   * Each sensor in this sequence is capable of detecting objects within its range.
14
   */
15
  val proximitySensors: Vector[ProximitySensor[DynamicEntity, Environment]]
16

17
  /**
18
   * Senses the environment using the entity's sensors.
19
   *
20
   * @param entity
21
   *   the dynamic entity that is sensing the environment.
22
   * @param env
23
   *   the environment in which the entity is operating.
24
   * @return
25
   *   a collection of sensor readings.
26
   */
27
  def sense(entity: DynamicEntity, env: Environment): SensorReadings =
28
    SensorReadings(
4✔
29
      proximity = proximitySensors.map(s => SensorReading(s, s.sense(entity)(env))),
1✔
30
    )
13✔
31
end SensorSuite
32

33
object SensorSuite:
NEW
34

×
35
  /**
36
   * Creates a new `SensorSuite` with the specified proximity sensors.
37
   *
38
   * @param proximitySensors
39
   *   a variable number of `ProximitySensor` instances to include in the suite.
40
   * @return
41
   *   a new instance of `SensorSuite` containing the provided proximity sensors.
42
   */
43
  def apply(
44
      proximitySensors: ProximitySensor[DynamicEntity, Environment]*,
9✔
45
  ): SensorSuite =
46
    new SensorSuiteImpl(proximitySensors.toVector)
47

16✔
48
  def empty: SensorSuite =
49
    SensorSuite()
4✔
50

13✔
51
  private class SensorSuiteImpl(
52
      override val proximitySensors: Vector[ProximitySensor[DynamicEntity, Environment]],
6✔
53
  ) extends SensorSuite
3✔
54
end SensorSuite
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc