public void setSteeringAngleInDegrees(double steeringAngle) { steeringWheelPinJoint.setQ(steeringAngle); } }
private static PinJoint nextPinJoint(long seed, Robot rob) { Random random = new Random(seed); String jname = "randomPinJoint" + random.nextInt(); Vector3DReadOnly offset = EuclidCoreRandomTools.nextVector3D(random); Axis jaxis = Axis.values[random.nextInt(Axis.values.length)]; PinJoint pinJoint = new PinJoint(jname, offset, rob, jaxis); pinJoint.setQ(random.nextDouble()); pinJoint.setQd(random.nextDouble()); return pinJoint; }
public SinglePendulumRobot(String name, double initialQ, double initialQd) { super(name); pinJoint = new PinJoint(name + "Joint", new Vector3D(), this, axis); Link link = new Link(name + "Link"); link.setMass(mass); link.setMomentOfInertia(Ixx, 0.0, 0.0); link.setComOffset(0.0, 0.0, -0.5 * length); pinJoint.setLink(link); pinJoint.setDamping(damping); addRootJoint(pinJoint); pinJoint.setQ(initialQ); pinJoint.setQd(initialQd); }
public void setYaw(double yaw) { doorHingePinJoint.setQ(yaw); }
public DoublePendulumRobot(String name, double initialQFirstJoint, double initialQdFirstJoint, double initialQSecondJoint, double initialQdSecondJoint) { super(name); pinJoint1 = new PinJoint(name + "Joint1", new Vector3D(), this, axis); Link link1 = new Link(name + "Link1"); link1.setMass(mass1); link1.setMomentOfInertia(Ixx1CoM, 0.0, 0.0); link1.setComOffset(0.0, 0.0, - lengthCoM1); pinJoint1.setLink(link1); pinJoint1.setDamping(damping1); pinJoint2 = new PinJoint(name + "Joint2", new Vector3D(0.0, 0.0, -length1), this, axis); Link link2 = new Link(name + "Link2"); link2.setMass(mass2); link2.setMomentOfInertia(Ixx2CoM, 0.0, 0.0); link2.setComOffset(0.0, 0.0, - lengthCoM2); pinJoint2.setLink(link2); pinJoint2.setDamping(damping2); pinJoint1.addJoint(pinJoint2); pinJoint1.setQ(initialQFirstJoint); pinJoint1.setQd(initialQdFirstJoint); pinJoint2.setQ(initialQSecondJoint); pinJoint2.setQd(initialQdSecondJoint); addRootJoint(pinJoint1); }
public void setHandleAngle(double theta) { handlePinJoint.setQ(theta); }
public CartPoleRobot(String name, double initialCartVelocity, double initialPoleAngle, double initialPoleAngularVelocity) { super(name); sliderJoint = new SliderJoint(name + "CartJoint", new Vector3D(), this, Axis.X); sliderJoint.setDamping(cartDamping); Link cartLink = new Link(name + "CartLink"); cartLink.setMass(cartMass); sliderJoint.setLink(cartLink); pinJoint = new PinJoint(name + "PoleJoint", new Vector3D(), this, Axis.Y); pinJoint.setDamping(poleDamping); Link poleLink = new Link(name + "PoleLink"); poleLink.setMass(poleMass); poleLink.setComOffset(0.0, 0.0, - poleLength); pinJoint.setLink(poleLink); sliderJoint.setQd(initialCartVelocity); pinJoint.setQ(initialPoleAngle); pinJoint.setQd(initialPoleAngularVelocity); sliderJoint.addJoint(pinJoint); addRootJoint(sliderJoint); }
public void setElbowPosition(double value) { elbowJoint.setQ(value); }
public void setUpperPosition(double value) { upperJoint.setQ(value); }
public void copyRevoluteJointConfigurationToPinJoints() { for (RobotArmJointParameters armJoint : allJointNames) { double q = robotArmRevoluteJoints.get(armJoint).getQ(); robotArmPinJoints.get(armJoint).setQ(q); } }
public void copyRevoluteJointConfigurationToPinJoints() { for (RobotArmJointParameters armJoint : allJointNames) { double q = robotArmRevoluteJoints.get(armJoint).getQ(); robotArmPinJoints.get(armJoint).setQ(q); } }
public void setClosePercentage(double percentage) { valveClosePercentage.set(percentage); valvePinJoint.setQ(valveNumberOfPossibleTurns* 2 * Math.PI * percentage/100 ); } }
public void setPosition(double angle) { getPinJoint().setQ(angle); }
@Override public void initialize() { this.kp.set(100.0); this.kd.set(10.0); doublePendulum.getJ1().setQ(0.1); }
@Test// timeout=300000 public void testOffsetAtCenterOfMassWithCantileveredBeam() throws UnreasonableAccelerationException { double massOne = 7.21; Robot robot = new Robot("JointWrenchSensorTest"); PinJoint pinJointOne = createPinJointWithHangingMass("pinJointOne", massOne, Axis.Y, robot); Vector3D comOffsetFromJointOne = new Vector3D(); pinJointOne.getLink().getComOffset(comOffsetFromJointOne); JointWrenchSensor jointWrenchSensorOne = new JointWrenchSensor("jointWrenchSensorOne", comOffsetFromJointOne, robot); pinJointOne.addJointWrenchSensor(jointWrenchSensorOne); assertTrue(jointWrenchSensorOne == pinJointOne.getJointWrenchSensor()); robot.addRootJoint(pinJointOne); pinJointOne.setQ(Math.PI/2.0); pinJointOne.setTau(massOne * robot.getGravityZ() * comOffsetFromJointOne.getZ()); robot.doDynamicsAndIntegrate(0.0001); double jointAcceleration = pinJointOne.getQDDYoVariable().getDoubleValue(); assertEquals(0.0, jointAcceleration, 1e-7); Vector3D expectedJointForce = new Vector3D(-massOne * robot.getGravityZ(), 0.0, 0.0); Vector3D expectedJointTorque = new Vector3D(); assertJointWrenchEquals(jointWrenchSensorOne, expectedJointForce, expectedJointTorque); }
assertJointWrenchSensorConsistency(robot, jointWrenchSensorTwo); pinJointOne.setQ(Math.PI); robot.doDynamicsButDoNotIntegrate();
joint3.setQ(Math.PI); robot.update();