cz.cuni.amis.pogamut.usar2004.agent.module.sensor
Class SensorLaser

Package class diagram package SensorLaser
java.lang.Object
  extended by cz.cuni.amis.pogamut.usar2004.agent.module.sensor.SuperSensor
      extended by cz.cuni.amis.pogamut.usar2004.agent.module.sensor.SensorLaser

public class SensorLaser
extends SuperSensor

Sensor message representative for Laser sensor.

Author:
vejmanm

Field Summary
static SensorType type
           
 
Fields inherited from class cz.cuni.amis.pogamut.usar2004.agent.module.sensor.SuperSensor
lastMessage, sensorType
 
Constructor Summary
SensorLaser()
          Ctor.
 
Method Summary
 ClosestObstacle getClosestObstacleCourse()
          Devides Laser ranges in half and sums both halves.
 double getClosestObstacleDistance()
          Iterates through Laser ranges and returns the min value.
 double getFOV()
          FOV is the sensor’s field of view in radians.
 DriveDirection getMostOpenDirection(int backwardsTreshold)
          Devides Laser ranges to thirds and sums up each third.
 double getNMidAvg(int numOfRays)
          Computes avarage value from set of double values obtained from sector of Laser ranges from the middle of the list.
 double getNMidAvg(int numOfRays, int offset)
          Computes avarage value from set of double values obtained from sector of Laser ranges defined by numOfRays(count) and offset.
 double getRangeAt(int index)
          LaserRanges is a series of range values in meters.
 List<Double> getRanges()
          LaserRanges is a series of range values in meters.
 int getRangesSize()
          Returns size of Laser range list.
 double getResolution()
          It is the sensor’s resolution in radians.
 
Methods inherited from class cz.cuni.amis.pogamut.usar2004.agent.module.sensor.SuperSensor
getName, getSensorType, getTime, getType, isReady, updateMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

public static final SensorType type
Constructor Detail

SensorLaser

public SensorLaser()
Ctor. Sensor type describes particular subject about which we want to know about. It is used to distinguish incoming message from the server.

Method Detail

getClosestObstacleCourse

public ClosestObstacle getClosestObstacleCourse()
Devides Laser ranges in half and sums both halves. If left is larger, than the obstacle is on the Right. On the Left otherwise.

Returns:
Returns Left or right based on Laser range values.

getClosestObstacleDistance

public double getClosestObstacleDistance()
Iterates through Laser ranges and returns the min value.

Returns:
Returns Closest range in meters from all Laser rays.

getMostOpenDirection

public DriveDirection getMostOpenDirection(int backwardsTreshold)
Devides Laser ranges to thirds and sums up each third. Based on these sums it determines where is the most open space.

Parameters:
backwardsTreshold - If range in front is smaller than this value it is clear there is wall in front of the robot. Therefore it Returns Backwards.
Returns:
Returns direction that is most pleasant spacewise.

getResolution

public double getResolution()
It is the sensor’s resolution in radians. With FOV, we can calculate the number of the data in the Range segment.

Returns:
Returns resolution of the sensor.

getFOV

public double getFOV()
FOV is the sensor’s field of view in radians.

Returns:
Returns field of view in radians.

getRangeAt

public double getRangeAt(int index)
LaserRanges is a series of range values in meters.

Parameters:
index -
Returns:
Returns double value representing distance in meters at specified index.

getRangesSize

public int getRangesSize()
Returns size of Laser range list.

Returns:
Returns size of Laser range list.

getRanges

public List<Double> getRanges()
LaserRanges is a series of range values in meters.

Returns:
Returns List of double values representing distance in meters.

getNMidAvg

public double getNMidAvg(int numOfRays)
Computes avarage value from set of double values obtained from sector of Laser ranges from the middle of the list.

Parameters:
numOfRays - Number of records around the middle one to compute the avarage distance from.
Returns:
Avarage distance computed from rays around the middle.

getNMidAvg

public double getNMidAvg(int numOfRays,
                         int offset)
Computes avarage value from set of double values obtained from sector of Laser ranges defined by numOfRays(count) and offset.

Parameters:
numOfRays - Number of records around the middle one to compute the avarage distance from.
offset - Number of rays to skip before computing.
Returns:
Returns avarage value from laser ranges defined by specific sector.


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.