private void printFootSensorsOffset() { java.text.NumberFormat doubleFormat = new java.text.DecimalFormat(" 0.00;-0.00"); String offsetString = ""; DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd_HHmmss"); Calendar calendar = Calendar.getInstance(); String timestamp = dateFormat.format(calendar.getTime()); offsetString += "Copy the following in ValkyrieSensorInformation:\n"; for (RobotSide robotSide : RobotSide.values) { String side = robotSide.getCamelCaseNameForStartOfExpression(); offsetString += " SpatialForceVector " + side + "FootForceSensorTareOffset_" + timestamp + " = new SpatialForceVector(null, new double[] {"; offsetString += doubleFormat.format(footTorquesRawFiltered.get(robotSide).getX()) + ", "; offsetString += doubleFormat.format(footTorquesRawFiltered.get(robotSide).getY()) + ", "; offsetString += doubleFormat.format(footTorquesRawFiltered.get(robotSide).getZ()) + ", "; offsetString += doubleFormat.format(footForcesRawFiltered.get(robotSide).getX()) + ", "; offsetString += doubleFormat.format(footForcesRawFiltered.get(robotSide).getY()) + ", "; offsetString += doubleFormat.format(footForcesRawFiltered.get(robotSide).getZ()) + "});\n"; } offsetString += "\n footForceSensorTareOffsets = new SideDependentList<SpatialForceVector>(leftFootForceSensorTareOffset_" + timestamp + ", rightFootForceSensorTareOffset_" + timestamp + ");"; System.out.println(offsetString); }
private void printFootSensorsOffset() { java.text.NumberFormat doubleFormat = new java.text.DecimalFormat(" 0.00;-0.00"); String offsetString = ""; DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd_HHmmss"); Calendar calendar = Calendar.getInstance(); String timestamp = dateFormat.format(calendar.getTime()); offsetString += "Copy the following in ValkyrieSensorInformation:\n"; for (RobotSide robotSide : RobotSide.values) { String side = robotSide.getCamelCaseNameForStartOfExpression(); offsetString += " SpatialForceVector " + side + "FootForceSensorTareOffset_" + timestamp + " = new SpatialForceVector(null, new double[] {"; offsetString += doubleFormat.format(footTorquesRawFiltered.get(robotSide).getX()) + ", "; offsetString += doubleFormat.format(footTorquesRawFiltered.get(robotSide).getY()) + ", "; offsetString += doubleFormat.format(footTorquesRawFiltered.get(robotSide).getZ()) + ", "; offsetString += doubleFormat.format(footForcesRawFiltered.get(robotSide).getX()) + ", "; offsetString += doubleFormat.format(footForcesRawFiltered.get(robotSide).getY()) + ", "; offsetString += doubleFormat.format(footForcesRawFiltered.get(robotSide).getZ()) + "});\n"; } offsetString += "\n footForceSensorTareOffsets = new SideDependentList<SpatialForceVector>(leftFootForceSensorTareOffset_" + timestamp + ", rightFootForceSensorTareOffset_" + timestamp + ");"; System.out.println(offsetString); }