/** * Retrieves the Joint specified in the RobotRequest. * @param req RobotRequest specifying a Joint * @return Joint specified in the RobotRequest */ protected Joint getRequestedJoint(RobotRequest req){ Integer jIdInt = req.getRequestIndex(); if(jIdInt == null){ throw new NullPointerException(); } Joint.Id jId = new Joint.Id(jIdInt); Robot.Id rId = req.getRobotId(); JointId jointId = new Robot.JointId(rId, jId); Joint j = getRobot().getJoint(jointId); if(j == null){ throw new NullPointerException(); } return j; }