public String getJavaName() { if (m_name != null) { // @dcalvert: Fix Java method naming from getSome_type() to getSomeType() if (m_name.contains("_")) { return FormattingTools.underscoredToCamelCase(m_name, true); } else { return StringUtils.capitalize(m_name); } } return null; }
public static void logMessagesAndShareOnSharedDriveIfAvailable(String filename) { String rootDirectoryToUse = determineEraseableBambooDataAndVideosRootDirectoryToUse(); String logFilename = rootDirectoryToUse + FormattingTools.getDateString() + "_" + FormattingTools.getTimeString() + "_" + filename; File file = new File(logFilename); logMessagesToFile(file); }
@Override public String toString() { String numberString = getFormattedDoubleYoVariable(yoDouble); String epsilonString = FormattingTools.getFormattedToSignificantFigures(epsilon, SIGNIFICANT_FIGURES_FOR_PRINT_OUT); String goalString = FormattingTools.getFormattedToSignificantFigures(goalValue, SIGNIFICANT_FIGURES_FOR_PRINT_OUT); return numberString + " (+/- " + epsilonString + ") == " + goalString; } };
public VideoPacketToImageFilesRecorder(Path workingDirectory) throws IOException { String dateString = FormattingTools.getDateString(); String timeStringWithSeconds = FormattingTools.getTimeStringWithSeconds(); this.workingDirectory = workingDirectory; Files.createDirectories(this.workingDirectory); this.sessionDirectory = this.workingDirectory.resolve(dateString + "_" + timeStringWithSeconds); Files.createDirectories(this.sessionDirectory); }
public AbstractBehavior(String robotName, String namePrefix, Ros2Node ros2Node) { this.robotName = robotName; this.ros2Node = ros2Node; behaviorName = FormattingTools.addPrefixAndKeepCamelCaseForMiddleOfExpression(namePrefix, getClass().getSimpleName()); registry = new YoVariableRegistry(behaviorName); yoBehaviorStatus = new YoEnum<BehaviorStatus>(namePrefix + "Status", registry, BehaviorStatus.class); hasBeenInitialized = new YoBoolean("hasBeenInitialized", registry); isPaused = new YoBoolean("isPaused" + behaviorName, registry); isAborted = new YoBoolean("isAborted" + behaviorName, registry); percentCompleted = new YoDouble("percentCompleted", registry); behaviorsServices = new ArrayList<>(); footstepPlanningToolboxSubGenerator = ROS2Tools.getTopicNameGenerator(robotName, ROS2Tools.FOOTSTEP_PLANNER_TOOLBOX, ROS2TopicQualifier.INPUT); footstepPlanningToolboxPubGenerator = ROS2Tools.getTopicNameGenerator(robotName, ROS2Tools.FOOTSTEP_PLANNER_TOOLBOX, ROS2TopicQualifier.OUTPUT); kinematicsToolboxSubGenerator = ROS2Tools.getTopicNameGenerator(robotName, ROS2Tools.KINEMATICS_TOOLBOX, ROS2TopicQualifier.INPUT); kinematicsToolboxPubGenerator = ROS2Tools.getTopicNameGenerator(robotName, ROS2Tools.KINEMATICS_TOOLBOX, ROS2TopicQualifier.OUTPUT); kinematicsPlanningToolboxSubGenerator = ROS2Tools.getTopicNameGenerator(robotName, ROS2Tools.KINEMATICS_PLANNING_TOOLBOX, ROS2TopicQualifier.INPUT); kinematicsPlanningToolboxPubGenerator = ROS2Tools.getTopicNameGenerator(robotName, ROS2Tools.KINEMATICS_PLANNING_TOOLBOX, ROS2TopicQualifier.OUTPUT); controllerSubGenerator = ControllerAPIDefinition.getSubscriberTopicNameGenerator(robotName); controllerPubGenerator = ControllerAPIDefinition.getPublisherTopicNameGenerator(robotName); behaviorSubGenerator = IHMCHumanoidBehaviorManager.getSubscriberTopicNameGenerator(robotName); behaviorPubGenerator = IHMCHumanoidBehaviorManager.getPublisherTopicNameGenerator(robotName); textToSpeechPublisher = createPublisher(TextToSpeechPacket.class, ROS2Tools.getDefaultTopicNameGenerator()); }
gridLinePencil.changeFrame(metersFrame); gridSize.changeFrame(metersFrame); String labelString = FormattingTools.getFormattedToPrecision(gridLinePencil.getX(), gridSize.getX(), 2); gridSize.changeFrame(pixelsFrame); gridLinePencil.changeFrame(pixelsFrame); gridLinePencil.changeFrame(metersFrame); gridSize.changeFrame(metersFrame); String labelString = FormattingTools.getFormattedToPrecision(gridLinePencil.getY(), gridSize.getY(), 2); gridSize.changeFrame(pixelsFrame); gridLinePencil.changeFrame(pixelsFrame);
public String getName() { return FormattingTools.underscoredToCamelCase(toString(), true); } }
String dateString = FormattingTools.getDateString(); String directoryName = rootDirectory + dateString + "/"; String timeString = FormattingTools.getTimeString(); String dateTimeString = dateString + "_" + timeString;
@Override public String toString() { String numberString = getFormattedDoubleYoVariable(yoDouble); String greaterThanString = FormattingTools.getFormattedToSignificantFigures(greaterThan, SIGNIFICANT_FIGURES_FOR_PRINT_OUT); return numberString + " > " + greaterThanString; } };
public String getPropertyNameForSelected() { return "select" + FormattingTools.underscoredToCamelCase(toString(), true); }
String timeStamp = FormattingTools.getDateString() + "_" + FormattingTools.getTimeString(); String tagName = timeStamp + "_" + name;
@Override public String toString() { String numberString = getFormattedDoubleYoVariable(yoDouble); String lessThanString = FormattingTools.getFormattedToSignificantFigures(lessThan, SIGNIFICANT_FIGURES_FOR_PRINT_OUT); return numberString + " < " + lessThanString; } };
public String getPropertyNameForEnable() { return "enable" + FormattingTools.underscoredToCamelCase(toString(), true); }
String timeStamp = FormattingTools.getDateString() + "_" + FormattingTools.getTimeString(); String tagName = timeStamp + "_" + robot.getName();
@Override public String toString() { String numberStringOne = getFormattedDoubleYoVariable(variableOne); String numberStringTwo = getFormattedDoubleYoVariable(variableTwo); String epsilonString = FormattingTools.getFormattedToSignificantFigures(epsilon, SIGNIFICANT_FIGURES_FOR_PRINT_OUT); return numberStringOne + " (+/- " + epsilonString + ") == " + numberStringTwo; } };
comboBoxValues[comboBoxIndex] = FormattingTools.underscoredToCamelCase(comboBoxValues[comboBoxIndex], true);
public static String getFormattedDoubleYoVariable(YoDouble yoDouble) { return yoDouble.getName() + ":" + FormattingTools.getFormattedToSignificantFigures(yoDouble.getDoubleValue(), SIGNIFICANT_FIGURES_FOR_PRINT_OUT); } }
public VehicleModelObjectVisualizer(ReferenceFrame vehicleFrame, VehicleModelObjects vehicleModelObjects, YoGraphicsListRegistry yoGraphicsListRegistry, YoVariableRegistry parentRegistry) { yoGraphicsList = new YoGraphicsList("vehicleObjects"); for (VehicleObject vehicleObject : VehicleObject.values()) { FramePose3D framePose = vehicleModelObjects.getFramePose(vehicleFrame, vehicleObject); String objectName = FormattingTools.underscoredToCamelCase(vehicleObject.toString(), false); ReferenceFrame objectFrame = new PoseReferenceFrame(objectName, framePose); objectFrame.update(); YoGraphicReferenceFrame yoGraphicReferenceFrame = new YoGraphicReferenceFrame(objectFrame, registry, true, objectFrameScale); yoGraphicsList.add(yoGraphicReferenceFrame); } YoGraphicReferenceFrame vehicleFrameViz = new YoGraphicReferenceFrame(vehicleFrame, registry, true, vehicleFrameScale); yoGraphicsList.add(vehicleFrameViz); yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList); parentRegistry.addChild(registry); }
@Override public String toString() { String minuendString = getFormattedDoubleYoVariable(minuend); String subtrahendString = getFormattedDoubleYoVariable(subtrahend); String differenceString = FormattingTools.getFormattedToSignificantFigures(difference, SIGNIFICANT_FIGURES_FOR_PRINT_OUT); return minuendString + " - " + subtrahendString + " > " + differenceString; } };