private SimulationConstructionSet createNewSCSWithEmptyRobot(String robotName) { return new SimulationConstructionSet(new Robot(robotName), parameters); }
@Test// timeout = 30000 public void testSimulationConstructionSetWithARobot() { Robot robot = new Robot("NullRobot"); SimulationConstructionSet scs = new SimulationConstructionSet(robot, parameters); Thread thread = new Thread(scs); thread.start(); sleep(pauseTimeForGUIs); scs.closeAndDispose(); }
private SimulationConstructionSet constructRewindableSimulationConstructionSet() { Robot robot = new Robot("Test"); RobotController controller = new RewindableController(robot); robot.setController(controller); return constructSimulationConstructionSet(robot, controller); }
private SimulationConstructionSet constructDifficultToDetectNonRewindableSimulationConstructionSet() { Robot robot = new Robot("Test"); RobotController controller = new DifficultToDetectNonRewindableController(robot); robot.setController(controller); return constructSimulationConstructionSet(robot, controller); }
private SimulationConstructionSet constructEasilyDetectableNonRewindableSimulationConstructionSet() { Robot robot = new Robot("Test"); RobotController controller = new EasilyDetectableNonRewindableController(robot); robot.setController(controller); return constructSimulationConstructionSet(robot, controller); }
public static void main(String[] args) { SimulationConstructionSet scs = new SimulationConstructionSet(new Robot("robot")); scs.addStaticLinkGraphics(new TwoBollardEnvironment(0.75).getTerrainObject3D().getLinkGraphics()); scs.setGroundVisible(false); scs.startOnAThread(); } }
@BeforeEach public void setUp() { offset = new Vector3D(1.0, 2.0, 3.0); robot = new Robot("testRobot"); kinematicPoint = new KinematicPoint("testPoint", offset, robot.getRobotsYoVariableRegistry()); }
public static void main(String[] args) { Robot nullRobot = new Robot("FootstepVisualizerRobot"); ImmutablePair<List<Footstep>, List<ContactablePlaneBody>> footstepsAndContactablePlaneBodies = generateDefaultFootstepList(); visualizeFootsteps(nullRobot, footstepsAndContactablePlaneBodies.getLeft(), footstepsAndContactablePlaneBodies.getRight()); }
private void setupSCS() { SimulationTestingParameters simulationTestingParameters = SimulationTestingParameters.createFromSystemProperties(); simulationTestingParameters.setKeepSCSUp(visualize); Robot robot = new Robot("Dummy"); yoTime = robot.getYoTime(); scs = new SimulationConstructionSet(robot, simulationTestingParameters); }
private void doATestWithJustAnSCS() throws SimulationExceededMaximumTimeException { // BambooTools.reportTestStartedMessage(simulationTestingParameters.getShowWindows()); SimulationConstructionSetParameters simulationConstructionSetParameters = new SimulationConstructionSetParameters(); simulationConstructionSetParameters.setCreateGUI(true); simulationConstructionSetParameters.setShowSplashScreen(false); simulationConstructionSetParameters.setShowWindows(true); SimulationConstructionSet scs = new SimulationConstructionSet(new Robot("TEST"), simulationConstructionSetParameters); scs.startOnAThread(); ThreadTools.sleep(4000); scs.closeAndDispose(); // BambooTools.reportTestFinishedMessage(simulationTestingParameters.getShowWindows()); }
public ValkyrieDataFileNamespaceRenamer() { SimulationConstructionSet scs = new SimulationConstructionSet(new Robot("null")); YoVariableRegistry rootRegistry = scs.getRootRegistry(); NameSpaceRenamer valkyrieNameSpaceRenamer = new ValkyrieNameSpaceRenamer(); ChangeNamespacesToMatchSimButton changeNamespacesToMatchSimButton = new ChangeNamespacesToMatchSimButton("ChangeValkyrieNamespaces", rootRegistry, valkyrieNameSpaceRenamer); scs.addButton(changeNamespacesToMatchSimButton); NameSpaceRenamer stepprNameSpaceRenamer = new StepprNameSpaceRenamer(); ChangeNamespacesToMatchSimButton changeStepprNamespacesToMatchSimButton = new ChangeNamespacesToMatchSimButton("ChangeStepprNamespaces", rootRegistry, stepprNameSpaceRenamer); scs.addButton(changeStepprNamespacesToMatchSimButton); scs.startOnAThread(); }
@ContinuousIntegrationTest(estimatedDuration = 0.0) @Test(timeout=300000) public void testAddScsJointUsingIDJoint() { Joint scsRootJoint = RobotTools.addSCSJointUsingIDJoint(getRandomFloatingChain().getRootJoint(), new Robot("robot"), true); assertNotNull(scsRootJoint); } }
private Robot createRobot() { Robot robot = new Robot("RandomRobot"); PinJoint pinJoint = new PinJoint("TestPinJoint", new Vector3D(), robot, new Vector3D(0, 0, 1)); robot.addRootJoint(pinJoint); return robot; } }
@Test// timeout=300000 public void testChangeableOffset() { Robot robot = new Robot("testRobot"); KinematicPoint kinematicPoint = new KinematicPoint("kp_test", robot.getRobotsYoVariableRegistry()); Vector3D offset = new Vector3D(0.1, 0.2, 0.3); kinematicPoint.setOffsetJoint(offset); Vector3D offsetCopy = kinematicPoint.getOffsetCopy(); EuclidCoreTestTools.assertTuple3DEquals(offset, offsetCopy, 1e-14); }
@ContinuousIntegrationTest(estimatedDuration = 0.0) @Test(timeout=300000) public void testGravityCompensationForChain() { Robot robot = new Robot("robot"); ReferenceFrame worldFrame = ReferenceFrame.getWorldFrame(); LinkedHashMap<RevoluteJoint, PinJoint> jointMap = new LinkedHashMap<RevoluteJoint, PinJoint>(); RigidBodyBasics elevator = new RigidBody("elevator", worldFrame); Vector3D[] jointAxes = {X, Y, Z, X}; double gravity = -9.8; createRandomChainRobotAndSetJointPositionsAndVelocities(robot, jointMap, worldFrame, elevator, jointAxes, gravity, false, false, random); createInverseDynamicsCalculatorAndCompute(elevator, gravity, worldFrame, false, false); copyTorques(jointMap); doRobotDynamics(robot); assertZeroAccelerations(jointMap); }
private Robot createSimpleRobotOne(String name) { Robot robot = new Robot(name); PinJoint joint1 = new PinJoint("joint", new Vector3D(0.0, 0.0, 0.0), robot, Axis.Y); Link link1 = link1(); joint1.setLink(link1); robot.addRootJoint(joint1); joint1.setInitialState(0.11, 0.22); joint1.setTau(33.3); return robot; }
private Robot createSimpleRobotTwo(String name) { Robot robot = new Robot(name); PinJoint joint2 = new PinJoint("joint", new Vector3D(0.0, 0.0, 0.0), robot, Axis.Y); Link link2 = link2(); joint2.setLink(link2); robot.addRootJoint(joint2); joint2.setInitialState(0.11, 0.22); joint2.setTau(33.3); return robot; }
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; }
@ContinuousIntegrationTest(estimatedDuration = 0.0) @Test(timeout = 30000, expected=RuntimeException.class) public void testSetMaxLessThanMin() { Robot robot = new Robot("Derivative"); YoVariableRegistry registry = new YoVariableRegistry("variables"); YoDouble position = new YoDouble("position", registry); robot.addYoVariableRegistry(registry); SimulationConstructionSet scs = new SimulationConstructionSet(robot, simulationTestingParameters); ValueDataCheckerParameters valueDataCheckerParameters = new ValueDataCheckerParameters(); YoVariableValueDataChecker yoVariableValueDataChecker = new YoVariableValueDataChecker(scs, position, robot.getYoTime(), valueDataCheckerParameters); double value = 10.0; yoVariableValueDataChecker.setMinimumValue(value); yoVariableValueDataChecker.setMaximumValue(value - 10.0); }
@ContinuousIntegrationTest(estimatedDuration = 0.0) @Test(timeout = 30000, expected=RuntimeException.class) public void testSetMinGreaterThanMax() { Robot robot = new Robot("Derivative"); YoVariableRegistry registry = new YoVariableRegistry("variables"); YoDouble position = new YoDouble("position", registry); robot.addYoVariableRegistry(registry); SimulationConstructionSet scs = new SimulationConstructionSet(robot, simulationTestingParameters); ValueDataCheckerParameters valueDataCheckerParameters = new ValueDataCheckerParameters(); YoVariableValueDataChecker yoVariableValueDataChecker = new YoVariableValueDataChecker(scs, position, robot.getYoTime(), valueDataCheckerParameters); double value = 10.0; yoVariableValueDataChecker.setMaximumValue(value); yoVariableValueDataChecker.setMinimumValue(value + 1.0); }