|  | @@ -22,7 +22,7 @@ import com.google.common.base.Preconditions;
 | 
	
		
			
				|  |  |  /**
 | 
	
		
			
				|  |  |   * @author damonkohler@google.com (Damon Kohler)
 | 
	
		
			
				|  |  |   */
 | 
	
		
			
				|  |  | -public class Configuration {
 | 
	
		
			
				|  |  | +public class Scip20DeviceConfiguration implements LaserScannerConfiguration {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    private String model;
 | 
	
		
			
				|  |  |    private int minimumMeasurment; // mm
 | 
	
	
		
			
				|  | @@ -35,13 +35,13 @@ public class Configuration {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    public static class Builder {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    private Configuration configuration;
 | 
	
		
			
				|  |  | +    private Scip20DeviceConfiguration configuration;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      public Builder() {
 | 
	
		
			
				|  |  | -      configuration = new Configuration();
 | 
	
		
			
				|  |  | +      configuration = new Scip20DeviceConfiguration();
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    public Configuration build() {
 | 
	
		
			
				|  |  | +    public LaserScannerConfiguration build() {
 | 
	
		
			
				|  |  |        return configuration;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -94,34 +94,38 @@ public class Configuration {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  private Configuration() {
 | 
	
		
			
				|  |  | +  private Scip20DeviceConfiguration() {
 | 
	
		
			
				|  |  |      // Use the Configuration.Builder to construct a Configuration object.
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    /**
 | 
	
		
			
				|  |  | -   * @return The laser's model.
 | 
	
		
			
				|  |  | +   * @return the laser's model
 | 
	
		
			
				|  |  |     */
 | 
	
		
			
				|  |  | +  @Override
 | 
	
		
			
				|  |  |    public String getModel() {
 | 
	
		
			
				|  |  |      return model;
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    /**
 | 
	
		
			
				|  |  | -   * @return The minimal range.
 | 
	
		
			
				|  |  | +   * @return the minimal range
 | 
	
		
			
				|  |  |     */
 | 
	
		
			
				|  |  | +  @Override
 | 
	
		
			
				|  |  |    public int getMinimumMeasurment() {
 | 
	
		
			
				|  |  |      return minimumMeasurment;
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    /**
 | 
	
		
			
				|  |  | -   * @return The maximal range.
 | 
	
		
			
				|  |  | +   * @return the maximal range
 | 
	
		
			
				|  |  |     */
 | 
	
		
			
				|  |  | +  @Override
 | 
	
		
			
				|  |  |    public int getMaximumMeasurement() {
 | 
	
		
			
				|  |  |      return maximumMeasurement;
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    /**
 | 
	
		
			
				|  |  | -   * @return The total number of range readings returned by the laser.
 | 
	
		
			
				|  |  | +   * @return the total number of range readings returned by the laser
 | 
	
		
			
				|  |  |     */
 | 
	
		
			
				|  |  | +  @Override
 | 
	
		
			
				|  |  |    public int getTotalSteps() {
 | 
	
		
			
				|  |  |      return totalSteps;
 | 
	
		
			
				|  |  |    }
 | 
	
	
		
			
				|  | @@ -131,8 +135,9 @@ public class Configuration {
 | 
	
		
			
				|  |  |     * area at the beginning of the scan range. Range readings are generated for
 | 
	
		
			
				|  |  |     * this area, they do not contain any useful information though.
 | 
	
		
			
				|  |  |     * 
 | 
	
		
			
				|  |  | -   * @return The index of the first meaningful range reading.
 | 
	
		
			
				|  |  | +   * @return the index of the first meaningful range reading
 | 
	
		
			
				|  |  |     */
 | 
	
		
			
				|  |  | +  @Override
 | 
	
		
			
				|  |  |    public int getFirstStep() {
 | 
	
		
			
				|  |  |      return firstStep;
 | 
	
		
			
				|  |  |    }
 | 
	
	
		
			
				|  | @@ -142,8 +147,9 @@ public class Configuration {
 | 
	
		
			
				|  |  |     * area at the end of the scan range. Range readings are generated for this
 | 
	
		
			
				|  |  |     * area, they do not contain any useful information though.
 | 
	
		
			
				|  |  |     * 
 | 
	
		
			
				|  |  | -   * @return The index of the last meaningful range reading.
 | 
	
		
			
				|  |  | +   * @return the index of the last meaningful range reading
 | 
	
		
			
				|  |  |     */
 | 
	
		
			
				|  |  | +  @Override
 | 
	
		
			
				|  |  |    public int getLastStep() {
 | 
	
		
			
				|  |  |      return lastStep;
 | 
	
		
			
				|  |  |    }
 | 
	
	
		
			
				|  | @@ -152,51 +158,58 @@ public class Configuration {
 | 
	
		
			
				|  |  |     * Returns the front step of the laser. The front step is the index of the
 | 
	
		
			
				|  |  |     * reading that is pointing directly forward.
 | 
	
		
			
				|  |  |     * 
 | 
	
		
			
				|  |  | -   * @return The index of the front step.
 | 
	
		
			
				|  |  | +   * @return the index of the front step
 | 
	
		
			
				|  |  |     */
 | 
	
		
			
				|  |  | +  @Override
 | 
	
		
			
				|  |  |    public int getFrontStep() {
 | 
	
		
			
				|  |  |      return frontStep;
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    /**
 | 
	
		
			
				|  |  | -   * @return The motor speed of the laser
 | 
	
		
			
				|  |  | +   * @return the motor speed of the laser
 | 
	
		
			
				|  |  |     */
 | 
	
		
			
				|  |  | +  @Override
 | 
	
		
			
				|  |  |    public int getStandardMotorSpeed() {
 | 
	
		
			
				|  |  |      return standardMotorSpeed;
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    /**
 | 
	
		
			
				|  |  | -   * @return The angle increment i.e. the angle between two successive points in
 | 
	
		
			
				|  |  | -   *         a scan.
 | 
	
		
			
				|  |  | +   * @return the angle increment i.e. the angle between two successive points in
 | 
	
		
			
				|  |  | +   *         a scan
 | 
	
		
			
				|  |  |     */
 | 
	
		
			
				|  |  | +  @Override
 | 
	
		
			
				|  |  |    public float getAngleIncrement() {
 | 
	
		
			
				|  |  |      return (float) ((2.0 * Math.PI) / getTotalSteps());
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    /**
 | 
	
		
			
				|  |  | -   * @return The minimum angle, i.e. the angle of the first step
 | 
	
		
			
				|  |  | +   * @return the minimum angle, i.e. the angle of the first step
 | 
	
		
			
				|  |  |     */
 | 
	
		
			
				|  |  | +  @Override
 | 
	
		
			
				|  |  |    public float getMinimumAngle() {
 | 
	
		
			
				|  |  |      return (getFirstStep() - getFrontStep()) * getAngleIncrement();
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    /**
 | 
	
		
			
				|  |  | -   * @return The maximum angle, i.e. the angle of the last step
 | 
	
		
			
				|  |  | +   * @return the maximum angle, i.e. the angle of the last step
 | 
	
		
			
				|  |  |     */
 | 
	
		
			
				|  |  | +  @Override
 | 
	
		
			
				|  |  |    public float getMaximumAngle() {
 | 
	
		
			
				|  |  |      return (getLastStep() - getFrontStep()) * getAngleIncrement();
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    /**
 | 
	
		
			
				|  |  | -   * @return The time increment between two successive points in a scan.
 | 
	
		
			
				|  |  | +   * @return the time increment between two successive points in a scan
 | 
	
		
			
				|  |  |     */
 | 
	
		
			
				|  |  | +  @Override
 | 
	
		
			
				|  |  |    public float getTimeIncrement() {
 | 
	
		
			
				|  |  |      return (float) (60.0 / ((double) getStandardMotorSpeed() * getTotalSteps()));
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    /**
 | 
	
		
			
				|  |  | -   * @return The time between two scans.
 | 
	
		
			
				|  |  | +   * @return the time between two scans
 | 
	
		
			
				|  |  |     */
 | 
	
		
			
				|  |  | +  @Override
 | 
	
		
			
				|  |  |    public float getScanTime() {
 | 
	
		
			
				|  |  |      return (float) (60.0 / (double) getStandardMotorSpeed());
 | 
	
		
			
				|  |  |    }
 |