public DataBuffer getDataBuffer() { return scs.getDataBuffer(); }
public DataBuffer getDataBuffer() { return scs.getDataBuffer(); }
public DataBuffer getDataBuffer() { return scs.getDataBuffer(); }
public TorqueSpeedDataExporter(SimulationConstructionSet scs, Robot robot, Class<?> rootClassForDirectory, String subdirectoryName) { this.scs = scs; this.robot = robot; this.subdirectoryName = subdirectoryName; this.graphCreator = new TorqueSpeedDataExporterGraphCreator(robot, scs.getDataBuffer()); this.excelWorkbookCreator = new DataExporterExcelWorkbookCreator(robot, scs.getDataBuffer()); this.rootClassForDirectory = rootClassForDirectory; }
public AbstractDataExporter(SimulationConstructionSet scs, String name, YoDouble timeYoVariable, Class<?> rootClassForDirectory, String subdirectoryName) { this.scs = scs; this.name = name; this.subdirectoryName = subdirectoryName; this.graphCreator = new DataExporterGraphCreator(timeYoVariable, scs.getDataBuffer()); // this.excelWorkbookCreator = new DataExporterExcelWorkbookCreator(robot, scs.getDataBuffer()); this.rootClassForDirectory = rootClassForDirectory; }
private boolean getWrapBufferFromSCS(SimulationConstructionSet scs) { return scs.getDataBuffer().getWrapBuffer(); }
private int getMaxBufferSizeFromSCS(SimulationConstructionSet scs) { return scs.getDataBuffer().getMaxBufferSize(); }
private int getInOutBufferLengthFromSCS(SimulationConstructionSet scs) { return scs.getDataBuffer().getBufferInOutLength(); }
private int getBufferSizeFromSCS(SimulationConstructionSet scs) { return scs.getDataBuffer().getBufferSize(); }
@ContinuousIntegrationTest(estimatedDuration = 1.0) @Test(timeout = 30000) public void testDataExporterGraphCreator() throws IOException { SimulationConstructionSet sim = createSimulation(); TorqueSpeedDataExporterGraphCreator graphCreator = new TorqueSpeedDataExporterGraphCreator(sim.getRobots()[0], sim.getDataBuffer()); File path = new File(System.getProperty("java.io.tmpdir")); Path tmpPath = Files.createTempDirectory(Paths.get(path.getAbsolutePath()), "test"); graphCreator.createJointTorqueSpeedGraphs(tmpPath.toFile(), "", true, true); int fileCount = tmpPath.toFile().listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.endsWith("jpg") || name.endsWith("pdf"); } }).length; assertTrue(fileCount > 1); tmpPath.toFile().deleteOnExit(); }
public static void main(String[] args) { final SimulationConstructionSet scs; // initialize SCS DRCRobotModel robotModel = new ValkyrieRobotModel(RobotTarget.REAL_ROBOT, false); final FloatingRootJointRobot robot =robotModel.createHumanoidFloatingRootJointRobot(false); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setDataBufferSize(65536); scs = new SimulationConstructionSet(robot, parameters); // add sysid button JButton button = new JButton("findCOM"); button.addActionListener(new LinkComIDActionListener(scs.getDataBuffer(), robot)); scs.addButton(button); scs.startOnAThread(); } }
public void computeTorqueOffsetsBasedOnAverages() { for (OneDoFJointBasics oneDoFJoint : oneDoFJoints) { YoDouble appliedTorque = controller.getAppliedTorqueYoVariable(oneDoFJoint); YoDouble estimatedTorque = controller.getEstimatedTorqueYoVariable(oneDoFJoint); YoDouble torqueOffset = controller.getTorqueOffsetVariable(oneDoFJoint); DataBuffer dataBuffer = simulationConstructionSet.getDataBuffer(); if (appliedTorque != null) { double appliedTorqueAverage = dataBuffer.computeAverage(appliedTorque); double estimatedTorqueAverage = dataBuffer.computeAverage(estimatedTorque); torqueOffset.add(appliedTorqueAverage - estimatedTorqueAverage); // System.out.println("appliedTorque variable " + appliedTorque.getName() + " average = " + appliedTorqueAverage); // System.out.println("estimatedTorque variable " + estimatedTorque.getName() + " average = " + estimatedTorqueAverage); // System.out.println("Setting " + torqueOffset.getName() + " to " + torqueOffset.getDoubleValue()); } } }
public void computeTorqueOffsetsBasedOnAverages() { for (OneDoFJoint oneDoFJoint : oneDoFJoints) { DoubleYoVariable appliedTorque = controller.getAppliedTorqueYoVariable(oneDoFJoint); DoubleYoVariable estimatedTorque = controller.getEstimatedTorqueYoVariable(oneDoFJoint); DoubleYoVariable torqueOffset = controller.getTorqueOffsetVariable(oneDoFJoint); DataBuffer dataBuffer = simulationConstructionSet.getDataBuffer(); if (appliedTorque != null) { double appliedTorqueAverage = dataBuffer.computeAverage(appliedTorque); double estimatedTorqueAverage = dataBuffer.computeAverage(estimatedTorque); torqueOffset.add(appliedTorqueAverage - estimatedTorqueAverage); // System.out.println("appliedTorque variable " + appliedTorque.getName() + " average = " + appliedTorqueAverage); // System.out.println("estimatedTorque variable " + estimatedTorque.getName() + " average = " + estimatedTorqueAverage); // System.out.println("Setting " + torqueOffset.getName() + " to " + torqueOffset.getDoubleValue()); } } }
public void initializeSimulation(SimulationConstructionSet scs) { scs.setDT(simulateDT, recordFrequency); if (drawGroundProfile) { scs.addStaticLinkGraphics(createGroundLinkGraphicsFromGroundProfile(groundProfile3D)); } if (SHOW_WORLD_COORDINATE_FRAME) { Graphics3DObject linkGraphics = new Graphics3DObject(); linkGraphics.addCoordinateSystem(0.3); scs.addStaticLinkGraphics(linkGraphics); } /* * This makes sure that the initial values of all YoVariables that are added to the scs (i.e. * at index 0 of the data buffer) are properly stored in the data buffer */ scs.getDataBuffer().copyValuesThrough(); }
double[] desiredICPXData = scs.getDataBuffer().getEntry(desiredICPX).getData(); double[] desiredICPYData = scs.getDataBuffer().getEntry(desiredICPY).getData(); double[] tValues = scs.getDataBuffer().getEntry(t).getData(); double dt = tValues[1] - tValues[0];
public void initializeSimulation(SimulationConstructionSet scs) { scs.setDT(simulateDT, recordFrequency); if (drawGroundProfile) { // boolean drawGroundBelow = false; // ArrayList<Graphics3DObject> groundLinkGraphics = commonTerrain.createLinkGraphics(drawGroundBelow); ArrayList<Graphics3DObject> groundLinkGraphics = createGroundLinkGraphicsFromGroundProfile(groundProfile3D); scs.addStaticLinkGraphics(groundLinkGraphics); } if (SHOW_WORLD_COORDINATE_FRAME) { Graphics3DObject linkGraphics = new Graphics3DObject(); linkGraphics.addCoordinateSystem(0.3); scs.addStaticLinkGraphics(linkGraphics); } /* * This makes sure that the initial values of all YoVariables that are added to the scs (i.e. at index 0 of the data buffer) * are properly stored in the data buffer */ scs.getDataBuffer().copyValuesThrough(); }
public void initializeSimulation(SimulationConstructionSet scs) { scs.setDT(simulateDT, recordFrequency); if (drawGroundProfile) { // boolean drawGroundBelow = false; // ArrayList<Graphics3DObject> groundLinkGraphics = commonTerrain.createLinkGraphics(drawGroundBelow); ArrayList<Graphics3DObject> groundLinkGraphics = createGroundLinkGraphicsFromGroundProfile(groundProfile3D); scs.addStaticLinkGraphics(groundLinkGraphics); } if (SHOW_WORLD_COORDINATE_FRAME) { Graphics3DObject linkGraphics = new Graphics3DObject(); linkGraphics.addCoordinateSystem(0.3); scs.addStaticLinkGraphics(linkGraphics); } /* * This makes sure that the initial values of all YoVariables that are added to the scs (i.e. at index 0 of the data buffer) * are properly stored in the data buffer */ scs.getDataBuffer().copyValuesThrough(); }
@Override public void starting(SimulationConstructionSet scs, Robot robot, YoVariableRegistry registry) { registry.addChild(sliderBoardRegistry); final SliderBoardConfigurationManager sliderBoardConfigurationManager = new SliderBoardConfigurationManager(scs); for (StepprStandPrepSetpoints setpoint : StepprStandPrepSetpoints.values) { StandPrepVariables variables = new StandPrepVariables(setpoint, registry); StepprJoint aJoint = setpoint.getJoints()[0]; sliderBoardConfigurationManager.setKnob(1, selectedJointPair, 0, StepprJoint.values.length); sliderBoardConfigurationManager.setSlider(1, variables.tau_d, -100.0, 100.0); sliderBoardConfigurationManager.setSlider(3, variables.damping, 0, 5 * aJoint.getRatio() * aJoint.getRatio()); sliderBoardConfigurationManager.saveConfiguration(setpoint.toString()); allSetpoints.put(setpoint, variables); } selectedJointPair.addVariableChangedListener(new VariableChangedListener() { @Override public void notifyOfVariableChange(YoVariable<?> v) { sliderBoardConfigurationManager.loadConfiguration(selectedJointPair.getEnumValue().toString()); } }); selectedJointPair.set(StepprStandPrepSetpoints.HIP_Y); StepprDashboard.createDashboard(scs, registry); scs.getDataBuffer().attachIndexChangedListener(this); }
GUISideCommandListener robotCommandListener = new GUISideCommandListener(scs.getDataBuffer(), scs.getRootRegistry(), guiUpdater, guiUpdater); RobotSocketConnection robotSocketConnection = new RobotSocketConnection(host, robotCommandListener, scs.getRootRegistry(), newDataListeners);
DataBuffer dataBuffer = scs.getDataBuffer();