public static Point3D nextPoint3DWithEdgeCases(Random random, double probabilityForEdgeCase) { double x = RandomNumbers.nextDouble(random, probabilityForEdgeCase); double y = RandomNumbers.nextDouble(random, probabilityForEdgeCase); double z = RandomNumbers.nextDouble(random, probabilityForEdgeCase); return new Point3D(x, y, z); }
public static Point3D nextPoint3D(Random random, double min, double max) { double x = RandomNumbers.nextDouble(random, min, max); double y = RandomNumbers.nextDouble(random, min, max); double z = RandomNumbers.nextDouble(random, min, max); return new Point3D(x, y, z); }
public static Vector3D nextVector3D(Random random, double minX, double minY, double minZ, double maxX, double maxY, double maxZ) { double x = RandomNumbers.nextDouble(random, minX, maxX); double y = RandomNumbers.nextDouble(random, minY, maxY); double z = RandomNumbers.nextDouble(random, minZ, maxZ); return new Vector3D(x, y, z); }
public static Point3D nextPoint3D(Random random, double[] min, double[] max) { double x = RandomNumbers.nextDouble(random, min[0], max[0]); double y = RandomNumbers.nextDouble(random, min[1], max[1]); double z = RandomNumbers.nextDouble(random, min[2], max[2]); return new Point3D(x, y, z); }
public static Point3D nextPoint3D(Random random, double minX, double minY, double minZ, double maxX, double maxY, double maxZ) { double x = RandomNumbers.nextDouble(random, minX, maxX); double y = RandomNumbers.nextDouble(random, minY, maxY); double z = RandomNumbers.nextDouble(random, minZ, maxZ); return new Point3D(x, y, z); }
public static Point2D nextPoint2D(Random random, double maxAbsoluteX, double maxAbsoluteY) { double x = RandomNumbers.nextDouble(random, -maxAbsoluteX, maxAbsoluteX); double y = RandomNumbers.nextDouble(random, -maxAbsoluteY, maxAbsoluteY); return new Point2D(x, y); }
public static Point2D nextPoint2D(Random random, double minX, double minY, double maxX, double maxY) { double x = RandomNumbers.nextDouble(random, minX, maxX); double y = RandomNumbers.nextDouble(random, minY, maxY); return new Point2D(x, y); }
public static AxisAngle nextAxisAngle(Random random, double minMaxAngleRange) { // Generate uniformly random point on unit sphere (based on http://mathworld.wolfram.com/SpherePointPicking.html ) double height = RandomNumbers.nextDouble(random, -1.0, 1.0); double angle = RandomNumbers.nextDouble(random, -minMaxAngleRange, minMaxAngleRange); double radius = Math.sqrt(1.0 - height * height); return new AxisAngle(radius * Math.cos(angle), radius * Math.sin(angle), height, angle); }
private void recursivelyAddJointTorqueProfile(Joint joint) { joints.add(joint); amplitudes.add(RandomNumbers.nextDouble(random, 0.1, 1.0)); omegas.add(RandomNumbers.nextDouble(random, 0.5, 3.0)); for(Joint childJoint : joint.getChildrenJoints()) { recursivelyAddJointTorqueProfile(childJoint); } }
public void setRobotTorquesRandomly(Random random, double maxJointTorque) { ArrayList<OneDegreeOfFreedomJoint> oneDegreeOfFreedomJoints = new ArrayList<OneDegreeOfFreedomJoint>(); robot.getAllOneDegreeOfFreedomJoints(oneDegreeOfFreedomJoints); for (OneDegreeOfFreedomJoint oneDegreeOfFreedomJoint : oneDegreeOfFreedomJoints) { oneDegreeOfFreedomJoint.setTau(RandomNumbers.nextDouble(random, maxJointTorque)); } }
private double getRandomJointAngleInRange(Random random, OneDoFJointBasics joint) { double jointLimitUpper = joint.getJointLimitUpper(); double jointLimitLower = joint.getJointLimitLower(); return RandomNumbers.nextDouble(random, jointLimitLower, jointLimitUpper); }
private double[] generateRandomJointPositions(Random random, OneDoFJointBasics[] armJoints) { double[] desiredJointPositions = new double[armJoints.length]; for (int i = 0; i < armJoints.length; i++) { OneDoFJointBasics joint = armJoints[i]; desiredJointPositions[i] = RandomNumbers.nextDouble(random, joint.getJointLimitLower(), joint.getJointLimitUpper()); } return desiredJointPositions; }
public static Matrix3D nextMatrix3D(Random random, double maxAbsolute) { Matrix3D ret = new Matrix3D(); for (int row = 0; row < 3; row++) { for (int column = 0; column < 3; column++) { ret.setElement(row, column, RandomNumbers.nextDouble(random, maxAbsolute)); } } return ret; }
public static Point3D nextPoint3D(Random random, Tuple3DReadOnly min, Tuple3DReadOnly max) { double x = RandomNumbers.nextDouble(random, min.getX(), max.getX()); double y = RandomNumbers.nextDouble(random, min.getY(), max.getY()); double z = RandomNumbers.nextDouble(random, min.getZ(), max.getZ()); return new Point3D(x, y, z); }
public void generateRandomConfiguration() { for (RobotArmJointParameters armJoint : allJointNames) { double q = RandomNumbers.nextDouble(random, armJoint.getJointLowerLimit(), armJoint.getJointUpperLimit()); robotArmRevoluteJoints.get(armJoint).setQ(q); } }
public static Vector4D nextVector4D(Random random, Tuple4DReadOnly lowerBound, Tuple4DReadOnly upperBound) { Vector4D ret = new Vector4D(); ret.setX(RandomNumbers.nextDouble(random, lowerBound.getX(), upperBound.getX())); ret.setY(RandomNumbers.nextDouble(random, lowerBound.getY(), upperBound.getY())); ret.setZ(RandomNumbers.nextDouble(random, lowerBound.getZ(), upperBound.getZ())); ret.setS(RandomNumbers.nextDouble(random, lowerBound.getS(), upperBound.getS())); return ret; }
public static Vector3D nextVector3D(Random random, Tuple3DReadOnly boundary1, Tuple3DReadOnly boundary2) { Vector3D ret = new Vector3D(); ret.setX(RandomNumbers.nextDouble(random, boundary1.getX(), boundary2.getX())); ret.setY(RandomNumbers.nextDouble(random, boundary1.getY(), boundary2.getY())); ret.setZ(RandomNumbers.nextDouble(random, boundary1.getZ(), boundary2.getZ())); return ret; }
@ContinuousIntegrationTest(estimatedDuration = 0.0) @Test(timeout = 30000) public void test() { Random random = new Random(); double expectedValue = RandomNumbers.nextDouble(random, Double.MIN_VALUE, Double.MAX_VALUE); ConstantDoubleProvider constantDoubleProvider = new ConstantDoubleProvider(expectedValue); double actualValue = constantDoubleProvider.getValue(); assertEquals(expectedValue, actualValue, EPS); }
private void setRandomPositions(Random random, List<RevoluteJoint> revoluteJoints, double deltaThetaMax) { for (RevoluteJoint revoluteJoint : revoluteJoints) { revoluteJoint.setQ(revoluteJoint.getQ() + RandomNumbers.nextDouble(random, -deltaThetaMax, deltaThetaMax)); revoluteJoint.getFrameAfterJoint().update(); } } }
@ContinuousIntegrationTest(estimatedDuration = 37.6) @Test(timeout = 950000) public void testHeadYaw() throws SimulationExceededMaximumTimeException { BambooTools.reportTestStartedMessage(simulationTestingParameters.getShowWindows()); double trajectoryTime = 4.0; Vector3D axis = new Vector3D(0, 0, 1); double rotationAngle = MAX_ANGLE_TO_TEST_RAD * RandomNumbers.nextDouble(new Random(), 0.3, 1.0); HeadTrajectoryMessage message = createHeadOrientationPacket(axis, rotationAngle, trajectoryTime); testHeadOrientationBehavior(message, trajectoryTime + EXTRA_SIM_TIME_FOR_SETTLING); BambooTools.reportTestFinishedMessage(simulationTestingParameters.getShowWindows()); }