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

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

09 Aug 2025 05:15PM UTC coverage: 75.676% (+1.6%) from 74.056%
#247

push

github

srs-mate
feat(config): implement serialization of environment

21 of 26 new or added lines in 8 files covered. (80.77%)

11 existing lines in 4 files now uncovered.

980 of 1295 relevant lines covered (75.68%)

10.84 hits per line

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

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

3
import io.github.srs.model.entity.*
4
import io.github.srs.model.entity.dynamicentity.Robot
5
import io.github.srs.model.entity.dynamicentity.actuator.{ Actuator, Wheel as ActWheel }
6
import io.github.srs.model.entity.dynamicentity.sensor.{ ProximitySensor, Sensor }
7
import io.github.srs.model.environment.Environment
8

9
object SimulationDefaults:
10

×
11
  val duration: Option[Int] = None
12
  val seed: Option[Long] = None
8✔
13

5✔
14
  object SimulationConfig:
UNCOV
15
    val maxCount = 10_000
×
UNCOV
16

×
17
  object Environment:
18
    val defaultWidth: Int = 10
3✔
19
    val minWidth: Int = 1
8✔
20
    val maxWidth: Int = 500
4✔
21

4✔
22
    val defaultHeight: Int = 10
23
    val minHeight: Int = 1
4✔
24
    val maxHeight: Int = 500
4✔
25

4✔
26
    val defaultEntities: Set[Entity] = Set.empty
27
    val maxEntities: Int = 200
10✔
28

5✔
29
  object StaticEntity:
UNCOV
30

×
31
    object Obstacle:
32
      val defaultPosition: Point2D = (0.0, 0.0)
3✔
33
      val defaultOrientation: Orientation = Orientation(0.0)
12✔
34
      val defaultWidth: Double = 1.0
10✔
35
      val defaultHeight: Double = 1.0
4✔
36

5✔
37
    object Light:
38
      val defaultPosition: Point2D = (0.0, 0.0)
3✔
39
      val defaultOrientation: Orientation = Orientation(0.0)
12✔
40
      val defaultRadius: Double = 0.05
10✔
41
      val defaultIlluminationRadius: Double = 1.0
4✔
42
      val defaultIntensity: Double = 1.0
4✔
43
      val defaultAttenuation: Double = 1.0
4✔
44

5✔
45
    object Boundary:
46
      val defaultPosition: Point2D = (0.0, 0.0)
3✔
47
      val defaultOrientation: Orientation = Orientation(0.0)
12✔
48
      val defaultWidth: Double = 1.0
10✔
49
      val defaultHeight: Double = 1.0
4✔
50

5✔
51
  end StaticEntity
52

53
  object DynamicEntity:
54
    val zeroSpeed: Double = 0.0
3✔
55
    val minSpeed: Double = -1.0
8✔
56
    val maxSpeed: Double = 1.0
4✔
57
    val halfSpeed: Double = 0.5
4✔
58

5✔
59
    object Actuator:
UNCOV
60

×
61
      object DifferentialWheelMotor:
62
        val defaultWheel: ActWheel = ActWheel()
3✔
63

22✔
64
        object Wheel:
65
          val defaultSpeed: Double = 1.0
3✔
66
          val defaultShape: ShapeType.Circle = ShapeType.Circle(0.1)
8✔
67

7✔
68
    object Sensor:
UNCOV
69

×
70
      object ProximitySensor:
71
        val defaultOffset: Double = 0.0
3✔
72
        val defaultDistance: Double = 0.5
8✔
73
        val defaultRange: Double = 5.0
4✔
74

5✔
75
    object Robot:
76
      import SimulationDefaults.DynamicEntity.Robot.defaultShape.radius
3✔
77

78
      val defaultPosition: Point2D = (0.0, 0.0)
79
      val defaultShape: ShapeType.Circle = ShapeType.Circle(0.5)
12✔
80
      val defaultOrientation: Orientation = Orientation(0.0)
6✔
81
      val defaultActuators: Seq[Actuator[Robot]] = Seq.empty
10✔
82
      val defaultSensors: Vector[Sensor[Robot, Environment]] = Vector.empty
11✔
83

10✔
84
      val stdProximitySensors: Vector[Sensor[Robot, Environment]] = Vector(
85
        ProximitySensor(Orientation(0.0), radius, 5.0),
6✔
86
        ProximitySensor(Orientation(45.0), radius, 5.0),
24✔
87
        ProximitySensor(Orientation(90.0), radius, 5.0),
16✔
88
        ProximitySensor(Orientation(135.0), radius, 5.0),
16✔
89
        ProximitySensor(Orientation(180.0), radius, 5.0),
16✔
90
        ProximitySensor(Orientation(225.0), radius, 5.0),
16✔
91
        ProximitySensor(Orientation(270.0), radius, 5.0),
16✔
92
        ProximitySensor(Orientation(315.0), radius, 5.0),
16✔
93
      )
16✔
94

3✔
95
      // TODO: Add light sensors when implemented
96
      val stdLightSensors: Vector[Sensor[Robot, Environment]] = Vector.empty
97
    end Robot
11✔
98
  end DynamicEntity
99
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