Skip to content

Commit

Permalink
Added toString methods for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbourelly999 committed Aug 8, 2023
1 parent 99038aa commit 66769eb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ public boolean equals(Object obj) {
return true;
}

@Override
public String toString() {
return "Detector [sensorId=" + sensorId + ", type=" + type + ", orientation=" + orientation + ", location="
+ location + "]";
}




}
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ public boolean equals(Object obj) {
return true;
}

@Override
public String toString() {
return "Orientation [yaw=" + yaw + ", pitch=" + pitch + ", roll=" + roll + "]";
}





}
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,15 @@ public void testGetterSetterConstructor() {
assertEquals(new Orientation(22, 33, 44), sensor.getOrientation());
assertEquals(CartesianPoint.xy(45,67), sensor.getLocation());
}
@Test
public void testToString() {
Detector sensor = new Detector("something", DetectorType.SEMANTIC_LIDAR, new Orientation(23.0, 0, 0),
CartesianPoint.xyz(1, 2, 3));
String sensoString = "Detector [sensorId=something, type=SEMANTIC_LIDAR, "
+ "orientation=Orientation [yaw=23.0, pitch=0.0, roll=0.0], "
+ "location=CartesianPoint{x=1.00,y=2.00,z=3.00}]";
assertEquals(sensoString, sensor.toString());
}
}


0 comments on commit 66769eb

Please sign in to comment.