private void callSCSMethodSimulateOneRecordStepNow(SimulationConstructionSet scs) { try { scs.simulateOneRecordStepNow(); } catch (UnreasonableAccelerationException e) { e.printStackTrace(); } }
private void callSCSMethodSimulateOneRecordStep(SimulationConstructionSet scs) { try { scs.simulateOneRecordStep(); } catch (UnreasonableAccelerationException e) { e.printStackTrace(); } }
private void callSCSMethodSimulateOneTimeStep(SimulationConstructionSet scs) { try { scs.simulateOneTimeStep(); } catch (UnreasonableAccelerationException e) { e.printStackTrace(); } }
private Robot createSimpleRobot() { Robot robot0 = new Robot("robot"); FloatingJoint floatingJoint0 = new FloatingJoint("floatingJoint", new Vector3D(), robot0); Link link0 = new Link("body"); link0.setMass(1.0); link0.setMomentOfInertia(0.1, 0.1, 0.1); floatingJoint0.setLink(link0); robot0.addRootJoint(floatingJoint0); return robot0; }
private SimulationConstructionSet createNewSCSWithEmptyRobot(String robotName) { return new SimulationConstructionSet(new Robot(robotName), parameters); }
public void cropFirstPoint() { scs.cropBuffer(); scs.gotoInPointNow(); scs.stepForwardNow(1); scs.setInPoint(); scs.cropBuffer(); }
private void addForcePoint() { externalForcePoint = new ExternalForcePoint("handForcePoint", scsRobotArm.getLink("hand").getComOffset(), scsRobotArm); scsRobotArm.getLink("hand").getParentJoint().addExternalForcePoint(externalForcePoint); }
private void assertSCSContainsTheVariables(SimulationConstructionSet scs, String[] variablesNames) { YoVariableRegistry registry = scs.getRootRegistry(); String[] variableNamesFromSCS = getAllVariableNamesFromRegistry(registry); assertArrayOfStringsContainsTheStrings(variableNamesFromSCS, variablesNames); }
private double getExpectedFinalTime(SimulationConstructionSet scs) { double initialTime = scs.getRobots()[0].getTime(); double recordFreq = scs.getRecordFreq(); double DT = scs.getDT(); return initialTime + recordFreq * DT; }
private void setPosition(FloatingJoint cubeJoint, double x, double y, double z) { cubeJoint.setPosition(x, y, z); cubeJoint.getRobot().update(); } }
public LinkComIDActionListener(DataBuffer dataBuffer, Robot robot) { this.dataBuffer = dataBuffer; this.robot = robot; ArrayList<OneDegreeOfFreedomJoint> joints = new ArrayList<>(); robot.getAllOneDegreeOfFreedomJoints(joints); this.linkNames = new String[joints.size()]; for (int i = 0; i < linkNames.length; i++) { linkNames[i] = joints.get(i).getLink().getName(); } }
@Override public void setMomentOfInertia(double Ixx, double Iyy, double Izz) { wheelLink.setMomentOfInertia(Ixx, Iyy, Izz); }
private void createSimulationRewoundListenerAndAttachToSCS(SimulationConstructionSet scs) { RewoundListener simulationRewoundListener = createSimulationRewoundListener(); scs.attachSimulationRewoundListener(simulationRewoundListener); }
public void setLinearVelocity(Vector3D linearVelocityInWorld) { qrCodeJoint.setVelocity(linearVelocityInWorld); } }
@Override public void createdNewVariables(YoVariableList newVariables) { scs.addVarList(newVariables); }
@Override public GroundProfile3D getGroundProfile3D() { return baseModel.getGroundProfile3D(); }
private void addForcePoint() { externalForcePoint1 = new ExternalForcePoint("hand1ForcePoint", scsRobotArm.getLink("hand1").getComOffset(), scsRobotArm); externalForcePoint2 = new ExternalForcePoint("hand2ForcePoint", scsRobotArm.getLink("hand2").getComOffset(), scsRobotArm); scsRobotArm.getLink("hand1").getParentJoint().addExternalForcePoint(externalForcePoint1); scsRobotArm.getLink("hand2").getParentJoint().addExternalForcePoint(externalForcePoint2); }
@Override public void setMomentOfInertia(double Ixx, double Iyy, double Izz) { link.setMomentOfInertia(Ixx, Iyy, Izz); }
private void addForcePoint() { externalForcePoint = new ExternalForcePoint("handForcePoint", scsRobotArm.getLink("hand").getComOffset(), scsRobotArm); scsRobotArm.getLink("hand").getParentJoint().addExternalForcePoint(externalForcePoint); }
private void addForcePoint() { externalForcePoint1 = new ExternalForcePoint("hand1ForcePoint", scsRobotArm.getLink("hand1").getComOffset(), scsRobotArm); externalForcePoint2 = new ExternalForcePoint("hand2ForcePoint", scsRobotArm.getLink("hand2").getComOffset(), scsRobotArm); scsRobotArm.getLink("hand1").getParentJoint().addExternalForcePoint(externalForcePoint1); scsRobotArm.getLink("hand2").getParentJoint().addExternalForcePoint(externalForcePoint2); }