/** * Get both angles at the same time. * * <p>NOTE: This function combine dJointGetPUAngle1 and dJointGetPUAngle2 together * and try to avoid redundant calculation * * @param joint The Prismatic universal joint for which we want to calculate the angles * @param angle1 The angle between the body1 and the axis 1 * @param angle2 The angle between the body2 and the axis 2 */ //ODE_API // void dJointGetPUAngles (dJoint j, double *angle1, double *angle2); public static void dJointGetPUAngles (DPUJoint joint, RefDouble angle1, RefDouble angle2) { angle1.d = joint.getAngle1(); angle2.d = joint.getAngle2(); }
/** * Get time derivative of angle1. * @param j j * @return r */ //ODE_API public static double dJointGetPUAngle1Rate (DPUJoint j) { return j.getAngle1Rate(); }
/** * Get time derivative of angle2. * @param j j * @return r */ //ODE_API public static double dJointGetPUAngle2Rate (DPUJoint j) { return j.getAngle2Rate(); }
} else if (joint instanceof DPUJoint) { DPUJoint pu = (DPUJoint) (joint); pu.setParam (PARAM_N.dParamLoStop1, -aLimit); pu.setParam (PARAM_N.dParamHiStop1, aLimit); pu.setParam (PARAM_N.dParamLoStop2, -aLimit); pu.setParam (PARAM_N.dParamHiStop2, aLimit); pu.setParam (PARAM_N.dParamLoStop3, -lLimit); pu.setParam (PARAM_N.dParamHiStop3, lLimit); } else if (joint instanceof DPUJoint) { DPUJoint pu = (DPUJoint) (joint); System.out.println("Position =" + pu.getPosition()); System.out.println("Position Rate=" + pu.getPositionRate()); System.out.println("Angle1 =" + pu.getAngle1()); System.out.println("Angle1 Rate=" + pu.getAngle1Rate()); System.out.println("Angle2 =" + pu.getAngle2()); System.out.println("Angle2 Rate=" + pu.getAngle2Rate());
/** * Set the axis for the first axis or the universal articulation. * @param j j * @param x x * @param y y * @param z z */ //ODE_API public static void dJointSetPUAxis1 (DPUJoint j, double x, double y, double z) { j.setAxis1(x, y, z); }
/** * Get the second axis of the Universal component of the joint. * @param j j * @param result r */ //ODE_API public static void dJointGetPUAxis2 (DPUJoint j, DVector3 result) { j.getAxis2(result); }
/** * Get the prismatic axis. * * <p>NOTE: This function was added for convenience it is the same as * dJointGetPUAxis3 * @param j j * @param result r */ //ODE_API public static void dJointGetPUAxisP (DPUJoint j, DVector3 result) { j.getAxisP(result); }
/** * Get angle. * @param j j * @return r */ //ODE_API public static double dJointGetPUAngle2 (DPUJoint j) { return j.getAngle2(); }
/** * Get the PR linear position's time derivative * @param j j * @return r */ //ODE_API public static double dJointGetPUPositionRate (DPUJoint j) { return j.getPositionRate(); }
/** * Get the first axis of the universal component of the joint * @param j j * @param result r */ //ODE_API public static void dJointGetPUAxis1 (DPUJoint j, DVector3 result) { j.getAxis1(result); }
/** * Get angle. * @param j j * @return r */ //ODE_API public static double dJointGetPUAngle1 (DPUJoint j) { return j.getAngle1(); }
/** * Get the PU linear position (i.e. the prismatic's extension) * * When the axis is set, the current position of the attached bodies is * examined and that position will be the zero position. * * The position is the "oriented" length between the * position = (Prismatic axis) dot_product [(body1 + offset) - (body2 + anchor2)] * @param j j * @return r */ //ODE_API public static double dJointGetPUPosition (DPUJoint j) { return j.getPosition(); }
} else if (joint instanceof DPUJoint) { DPUJoint pu = (DPUJoint) (joint); pu.setParam (PARAM_N.dParamLoStop1, -aLimit); pu.setParam (PARAM_N.dParamHiStop1, aLimit); pu.setParam (PARAM_N.dParamLoStop2, -aLimit); pu.setParam (PARAM_N.dParamHiStop2, aLimit); pu.setParam (PARAM_N.dParamLoStop3, -lLimit); pu.setParam (PARAM_N.dParamHiStop3, lLimit); } else if (joint instanceof DPUJoint) { DPUJoint pu = (DPUJoint) (joint); std_cout("Position =",pu.getPosition() ,"\n"); std_cout("Position Rate=",pu.getPositionRate() ,"\n"); std_cout("Angle1 =",pu.getAngle1() ,"\n"); std_cout("Angle1 Rate=",pu.getAngle1Rate() ,"\n"); std_cout("Angle2 =",pu.getAngle2() ,"\n"); std_cout("Angle2 Rate=",pu.getAngle2Rate() ,"\n");
/** * Set the axis for the prismatic articulation. * @param j j * @param x x * @param y y * @param z z */ //ODE_API public static void dJointSetPUAxis3 (DPUJoint j, double x, double y, double z) { j.setAxis1(x, y, z); }
/** * Get the second axis of the Universal component of the joint. * @param j j * @param result r */ //ODE_API public static void dJointGetPUAxis2 (DPUJoint j, DVector3 result) { j.getAxis2(result); }
/** * Get the prismatic axis. * * <p>NOTE: This function was added for convenience it is the same as * dJointGetPUAxis3 * @param j j * @param result r */ //ODE_API public static void dJointGetPUAxisP (DPUJoint j, DVector3 result) { j.getAxisP(result); }