public RemoteJoint(RemoteRobot robot, JointDefinition def){
if(robot == null || def == null){
throw new NullPointerException();
}
myRobot = robot;
myJointId = def.getJointId();
myRobotJointId = new Robot.JointId(myRobot.getRobotId(), myJointId);
myName = def.getName();
myDefaultPosition = def.getDefaultPosition();
myCachedGoalPosition = def.getGoalPosition();
myEnabledFlag = def.getEnabled();
myRange = new DoubleRange(0.0, 1.0);
myProperties = new HashMap<String, JointProperty>();
for(JointPropDefinition p : def.getJointProperties()){
JointProperty<Double> prop = new RemoteJointProperty<Double>(
p.getPropertyName(), p.getDisplayName(),
Double.class, p.getInitialValue(),
new DoubleRange(p.getMinValue(), p.getMaxValue()));
myProperties.put(p.getPropertyName(), prop);
}
}