Skip to content
Snippets Groups Projects
Commit 8f8ca56a authored by FrankR's avatar FrankR
Browse files

SRSConversion: Added logging of orientation

parent b7ec7753
No related branches found
No related tags found
No related merge requests found
......@@ -84,9 +84,9 @@ public class Administration {
public static void transformToRootCoordinates(Placing placingToBeTransformed) {
if (isNotRootPosition(placingToBeTransformed.getPosition())) {
ReferenceSystem nextTransformationGoal_SRS = placingToBeTransformed.getPosition().getReferenceSystem();
LOG.info("INDFRO-DEBUG: (before) ReferenceSystem: " + placingToBeTransformed.getPosition().getReferenceSystem().getId() + "; Position: " + PositionMonitoring.logPosition(placingToBeTransformed));
SRSConversion.switchSRS(placingToBeTransformed, nextTransformationGoal_SRS); // assumption: not only position is changed but also ReferenceSystem-object is updated
LOG.info("INDFRO-DEBUG: (after) ReferenceSystem: " + placingToBeTransformed.getPosition().getReferenceSystem().getId() + "; Position: " + PositionMonitoring.logPosition(placingToBeTransformed));
LOG.info("INDFRO-DEBUG: (before) ReferenceSystem: " + placingToBeTransformed.getPosition().getReferenceSystem().getId() + "; Position: " + PositionMonitoring.logPosition(placingToBeTransformed) + "; Orientation: " + PositionMonitoring.logOrientation(placingToBeTransformed));
SRSConversion.switchSRS(placingToBeTransformed, nextTransformationGoal_SRS); // assumption: not only position is changed but also ReferenceSystem-object of the placingToBeTransformed is updated
LOG.info("INDFRO-DEBUG: (after) ReferenceSystem: " + placingToBeTransformed.getPosition().getReferenceSystem().getId() + "; Position: " + PositionMonitoring.logPosition(placingToBeTransformed) + "; Orientation: " + PositionMonitoring.logOrientation(placingToBeTransformed));
LOG.info("INDFRO-DEBUG:");
transformToRootCoordinates(placingToBeTransformed); // recursion stops when placing.getPosition() has been transformed in a ROOT-position
}
......@@ -181,9 +181,9 @@ public class Administration {
private static void transformPlacingSuccessively(Placing placingToBeTransformed, List<ReferenceSystem> transformationTargets) {
for (ReferenceSystem transTarget : transformationTargets){
LOG.info("INDFRO-DEBUG: (before) ReferenceSystem: " + placingToBeTransformed.getPosition().getReferenceSystem().getId() + "; Position: " + PositionMonitoring.logPosition(placingToBeTransformed));
LOG.info("INDFRO-DEBUG: (before) ReferenceSystem: " + placingToBeTransformed.getPosition().getReferenceSystem().getId() + "; Position: " + PositionMonitoring.logPosition(placingToBeTransformed) + "; Orientation: " + PositionMonitoring.logOrientation(placingToBeTransformed));
SRSConversion.switchSRS(placingToBeTransformed, transTarget);
LOG.info("INDFRO-DEBUG: (after) ReferenceSystem: " + placingToBeTransformed.getPosition().getReferenceSystem().getId() + "; Position: " + PositionMonitoring.logPosition(placingToBeTransformed));
LOG.info("INDFRO-DEBUG: (after) ReferenceSystem: " + placingToBeTransformed.getPosition().getReferenceSystem().getId() + "; Position: " + PositionMonitoring.logPosition(placingToBeTransformed) + "; Orientation: " + PositionMonitoring.logOrientation(placingToBeTransformed));
}
}
}
......@@ -421,7 +421,7 @@ public class PositionMonitoring {
String agentId = lObject.getAgent().getId();
LOG.info("SDF: Received: sensorType: " + sensorType + " timestamp: " + timestamp + " now: " + LocalDateTime.now() + " sensorId: " + sensorId + " agentId: " + agentId);
LOG.info("INDFRO:");
LOG.info("INDFRO: Received: sensorType: " + sensorType + "; position: " + logPosition(posEvent.getPlacing()) + "; timestamp: " + timestamp + "; sensorId: " + sensorId + "; agentId: " + agentId);
LOG.info("INDFRO: Received: sensorType: " + sensorType + "; position: " + logPosition(posEvent.getPlacing()) + "; orientation: " + logOrientation(posEvent.getPlacing()) + "; timestamp: " + timestamp + "; sensorId: " + sensorId + "; agentId: " + agentId);
}
public static String logPosition(Placing placing) {
......@@ -429,6 +429,11 @@ public class PositionMonitoring {
return "(x: " + point.getX() + ", y: " + point.getY() + ", z: " + point.getZ() + ")";
}
public static String logOrientation(Placing placing) {
Quaternion orientation = (Quaternion) placing.getOrientation();
return "(x: " + orientation.getX() + ", y: " + orientation.getY() + ", z: " + orientation.getZ() + ", w: " + orientation.getW() + ")";
}
/**
* An event-filter may hot handle a position event if the filter should respect the results of
* sensor data fusion (e.g., wrt accuracy-criterium) and the result is negative for this event,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment