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

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

20 Aug 2025 10:04AM UTC coverage: 71.169% (+9.7%) from 61.478%
#316

push

github

srs-mate
refactor(sensor): remove distance, remove range from light sensor

33 of 33 new or added lines in 2 files covered. (100.0%)

11 existing lines in 3 files now uncovered.

1096 of 1540 relevant lines covered (71.17%)

10.08 hits per line

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

92.41
/src/main/scala/io/github/srs/utils/SimulationDefaults.scala
1
package io.github.srs.utils
2

3
import java.util.UUID
4

5
import cats.effect.IO
6
import io.github.srs.model.entity.*
7
import io.github.srs.model.entity.dynamicentity.Robot
8
import io.github.srs.model.entity.dynamicentity.action.Action
9
import io.github.srs.model.entity.dynamicentity.actuator.{ Actuator, Wheel as ActWheel }
10
import io.github.srs.model.entity.dynamicentity.behavior.BehaviorTypes.Rule
11
import io.github.srs.model.entity.dynamicentity.behavior.Rules
12
import io.github.srs.model.entity.dynamicentity.sensor.{ ProximitySensor, Sensor, SensorReadings }
13
import io.github.srs.model.environment.Environment
14
import io.github.srs.model.entity.dynamicentity.sensor.LightSensor
15

16
object SimulationDefaults:
UNCOV
17

×
18
  val duration: Option[Int] = None
19
  val seed: Option[Long] = None
8✔
20
  val debugMode = true
4✔
21

3✔
22
  object SimulationConfig:
23
    val maxCount = 10_000
×
UNCOV
24

×
25
  object Environment:
26
    val defaultWidth: Int = 10
3✔
27
    val minWidth: Int = 1
8✔
28
    val maxWidth: Int = 500
4✔
29

4✔
30
    val defaultHeight: Int = 10
31
    val minHeight: Int = 1
4✔
32
    val maxHeight: Int = 500
4✔
33

4✔
34
    val defaultEntities: Set[Entity] = Set.empty
35
    val maxEntities: Int = 200
10✔
36

5✔
37
  object StaticEntity:
UNCOV
38

×
39
    object Obstacle:
40
      val defaultId: UUID = UUID.fromString("00000000-0000-0000-0000-000000000000")
3✔
41
      val defaultPosition: Point2D = (0.0, 0.0)
13✔
42
      val defaultOrientation: Orientation = Orientation(0.0)
8✔
43
      val defaultWidth: Double = 1.0
10✔
44
      val defaultHeight: Double = 1.0
4✔
45

5✔
46
    object Light:
47
      val defaultId: UUID = UUID.fromString("00000000-0000-0000-0000-000000000001")
3✔
48
      val defaultPosition: Point2D = (0.0, 0.0)
13✔
49
      val defaultOrientation: Orientation = Orientation(0.0)
8✔
50
      val defaultRadius: Double = 0.05
10✔
51
      val defaultIlluminationRadius: Double = 1.0
4✔
52
      val defaultIntensity: Double = 1.0
4✔
53
      val defaultAttenuation: Double = 1.0
4✔
54

5✔
55
    object Boundary:
56
      val defaultPosition: Point2D = (0.0, 0.0)
3✔
57
      val defaultOrientation: Orientation = Orientation(0.0)
12✔
58
      val defaultWidth: Double = 1.0
10✔
59
      val defaultHeight: Double = 1.0
4✔
60

5✔
61
  end StaticEntity
62

63
  object DynamicEntity:
64
    val zeroSpeed: Double = 0.0
3✔
65
    val minSpeed: Double = -1.0
8✔
66
    val maxSpeed: Double = 1.0
4✔
67
    val halfSpeed: Double = 0.5
4✔
68

5✔
69
    object Actuator:
UNCOV
70

×
71
      object DifferentialWheelMotor:
72
        val defaultWheel: ActWheel = ActWheel()
3✔
73

22✔
74
        object Wheel:
75
          val defaultSpeed: Double = 1.0
3✔
76
          val defaultShape: ShapeType.Circle = ShapeType.Circle(0.1)
8✔
77

7✔
78
    object Sensor:
UNCOV
79

×
80
      object ProximitySensor:
81
        val defaultOffset: Double = 0.0
3✔
82
        val defaultDistance: Double = 0.5
8✔
83
        val defaultRange: Double = 5.0
2✔
84

5✔
85
    object Robot:
86
      import SimulationDefaults.DynamicEntity.Robot.defaultShape.radius
3✔
87

88
      val defaultId: UUID = UUID.fromString("00000000-0000-0000-0000-000000000002")
89
      val defaultPosition: Point2D = (0.0, 0.0)
13✔
90
      val defaultShape: ShapeType.Circle = ShapeType.Circle(0.5)
8✔
91
      val defaultOrientation: Orientation = Orientation(0.0)
6✔
92
      val defaultActuators: Seq[Actuator[Robot]] = Seq.empty
10✔
93
      val defaultSensors: Vector[Sensor[Robot, Environment]] = Vector.empty
11✔
94

10✔
95
      val stdProximitySensors: Vector[Sensor[Robot, Environment]] = Vector(
96
        ProximitySensor(Orientation(0.0), radius),
6✔
97
        ProximitySensor(Orientation(45.0), radius),
23✔
98
        ProximitySensor(Orientation(90.0), radius),
15✔
99
        ProximitySensor(Orientation(135.0), radius),
15✔
100
        ProximitySensor(Orientation(180.0), radius),
15✔
101
        ProximitySensor(Orientation(225.0), radius),
15✔
102
        ProximitySensor(Orientation(270.0), radius),
15✔
103
        ProximitySensor(Orientation(315.0), radius),
15✔
104
      )
15✔
105

3✔
106
      val stdLightSensors: Vector[Sensor[Robot, Environment]] = Vector(
107
        LightSensor(Orientation(0.0)),
6✔
108
        LightSensor(Orientation(45.0)),
20✔
109
        LightSensor(Orientation(90.0)),
12✔
110
        LightSensor(Orientation(135.0)),
12✔
111
        LightSensor(Orientation(180.0)),
12✔
112
        LightSensor(Orientation(225.0)),
12✔
113
        LightSensor(Orientation(270.0)),
12✔
114
        LightSensor(Orientation(315.0)),
12✔
115
      )
12✔
116

3✔
117
      val defaultBehavior: Rule[IO, SensorReadings, Action[IO]] = Rules.alwaysForward[IO]
118
    end Robot
14✔
119
  end DynamicEntity
120
end SimulationDefaults
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