public double getJointAngle(HandJointName jointName) { double[] source; switch (jointName.getFinger(robotSide)) { case INDEX : source = indexJoints; break; case MIDDLE : source = middleJoints; break; default : source = thumbJoints; } int index = jointName.getHandJointAngleIndex(); if (index == -1) { return 0; } return source[index]; }
public HandJointAngleProvider(FullRobotModel fullRobotModel, HandModel handModel) { this.handModel = handModel; if (handModel == null) { PrintTools.warn("Hand model is null."); } else { for (RobotSide side : RobotSide.values) { final HashMap<HandJointName, OneDoFJoint> joints = new HashMap<HandJointName, OneDoFJoint>(); packets.put(side, new AtomicReference<HandJointAnglePacket>()); for (HandJointName jointName : handModel.getHandJointNames()) { joints.put(jointName, fullRobotModel.getOneDoFJointByName(jointName.getJointName(side))); } handJoints.put(side, joints); } } }
public static double unpackJointAngle(HandJointAnglePacket handJointAnglePacket, HandJointName jointName) { int index = jointName.getIndex(RobotSide.fromByte(handJointAnglePacket.getRobotSide())); if (index == -1) { return 0; } return handJointAnglePacket.getJointAngles().get(index); }
public HandJointAngleProvider(FullRobotModel fullRobotModel, HandModel handModel) { this.handModel = handModel; if (handModel == null) { PrintTools.warn("Hand model is null."); } else { for (RobotSide side : RobotSide.values) { final HashMap<HandJointName, OneDoFJointBasics> joints = new HashMap<HandJointName, OneDoFJointBasics>(); packets.put(side, new AtomicReference<HandJointAnglePacket>()); for (HandJointName jointName : handModel.getHandJointNames()) { joints.put(jointName, fullRobotModel.getOneDoFJointByName(jointName.getJointName(side))); } handJoints.put(side, joints); } } }
public HandJointAngleProvider(FullRobotModel fullRobotModel, HandModel handModel) { this.handModel = handModel; if (handModel == null) { PrintTools.warn("Hand model is null."); } else { for (RobotSide side : RobotSide.values) { final HashMap<HandJointName, OneDoFJoint> joints = new HashMap<HandJointName, OneDoFJoint>(); packets.put(side, new AtomicReference<HandJointAnglePacket>()); for (HandJointName jointName : handModel.getHandJointNames()) { joints.put(jointName, fullRobotModel.getOneDoFJointByName(jointName.getJointName(side))); } handJoints.put(side, joints); } } }
OneDegreeOfFreedomJoint fingerJoint = simulatedRobot.getOneDegreeOfFreedomJoint(jointEnum.getJointName(robotSide)); if (fingerJoint != null) hasRobotiqHand.put(robotSide, true);
OneDegreeOfFreedomJoint fingerJoint = simulatedRobot.getOneDegreeOfFreedomJoint(jointEnum.getJointName(robotSide)); if (fingerJoint != null) hasRobotiqHand.put(robotSide, true);