Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
org.ros.android.view.DistanceRenderer Class Reference

List of all members.

Public Member Functions

void currentSpeed (double speed)
void loadPreferences (Context context)
void lockZoom ()
void onDrawFrame (GL10 gl)
void onSurfaceChanged (GL10 gl, int w, int h)
void onSurfaceCreated (GL10 gl, EGLConfig arg1)
void savePreferences (Context context)
void setNormalizedZoom (float normalizedZoomValue)
void setRotation (float theta)
void setZoomMode (ZoomMode mode)
void unlockZoom ()
void updateRange (List< Float > range, float maxRange, float minRange, float minTh, float thIncrement, float minDistToObject)

Private Member Functions

void setZoom (float distanceFromCenter)

Private Attributes

SharedPreferences.Editor editor
DistancePoints rangeLines
SharedPreferences sharedPreferences
float theta
float zoom = MAX_DISTANCE_ZOOM
boolean zoomLocked
ZoomMode zoomMode = ZoomMode.CLUTTER_ZOOM_MODE

Static Private Attributes

static final float DISTANCE_VIEW_FIELD_OF_VIEW = 60f
static final String DISTANCE_VIEW_ZOOM_LOCK_KEY = "DISTANCE_VIEW_ZOOM_LOCK"
static final String DISTANCE_VIEW_ZOOM_MODE_KEY = "DISTANCE_VIEW_ZOOM_MODE"
static final double DISTANCE_VIEW_ZOOM_MULTIPLIER
static final String DISTANCE_VIEW_ZOOM_VALUE_KEY = "DISTANCE_VIEW_ZOOM_VALUE"
static final float MAX_DISTANCE_ZOOM = -13.856406465f
static final float MAX_FOV_DISTANCE = 8f
static final float MIN_DISTANCE_ZOOM = -5.196152424f
static final float MIN_FOV_DISTANCE = 3f

Detailed Description

The OpenGL renderer that creates and manages the surface.

Author:
munjaldesai@google.com (Munjal Desai)

Definition at line 35 of file DistanceRenderer.java.


Member Function Documentation

void org.ros.android.view.DistanceRenderer.currentSpeed ( double  speed) [inline]

If zoomMode if set to VELOCITY_ZOOM_MODE, zoom is changed based on the normalized linear velocity.

Parameters:
speedLinear velocity between 1 and -1;

Definition at line 195 of file DistanceRenderer.java.

void org.ros.android.view.DistanceRenderer.loadPreferences ( Context  context) [inline]

Reads the settings stored in sharedPreferences and applies them.

Parameters:
contextThe context of the application calling this.

Definition at line 235 of file DistanceRenderer.java.

Prevent the zoom level to be changed.

Definition at line 177 of file DistanceRenderer.java.

Definition at line 130 of file DistanceRenderer.java.

void org.ros.android.view.DistanceRenderer.onSurfaceChanged ( GL10  gl,
int  w,
int  h 
) [inline]

Definition at line 113 of file DistanceRenderer.java.

void org.ros.android.view.DistanceRenderer.onSurfaceCreated ( GL10  gl,
EGLConfig  arg1 
) [inline]

Definition at line 124 of file DistanceRenderer.java.

void org.ros.android.view.DistanceRenderer.savePreferences ( Context  context) [inline]

Saves the existing settings in sharedPreferences via the editor.

Parameters:
contextThe context of the application calling this.

Definition at line 257 of file DistanceRenderer.java.

void org.ros.android.view.DistanceRenderer.setNormalizedZoom ( float  normalizedZoomValue) [inline]

Updates the zoom distance based on the normalized value if the zoomMode is set to CUSTOM_ZOOM_MODE.

Parameters:
normalizedZoomValueThe zoom value between 0 and 1.

Definition at line 161 of file DistanceRenderer.java.

void org.ros.android.view.DistanceRenderer.setRotation ( float  theta) [inline]

Rotate the entire display.

Parameters:
thetaThe amount in degrees by which the display should be rotated.

Definition at line 150 of file DistanceRenderer.java.

void org.ros.android.view.DistanceRenderer.setZoom ( float  distanceFromCenter) [inline, private]

Calculate the height of the camera based on the desired field of view.

Parameters:
distanceFromCenterThe region around the robot (in meters) that must be visible.

Definition at line 271 of file DistanceRenderer.java.

Sets the zoom mode.

Definition at line 170 of file DistanceRenderer.java.

Allow the zoom level to be changed.

Definition at line 184 of file DistanceRenderer.java.

void org.ros.android.view.DistanceRenderer.updateRange ( List< Float >  range,
float  maxRange,
float  minRange,
float  minTh,
float  thIncrement,
float  minDistToObject 
) [inline]

The new range values are forwarded to rangeLines and if zoomMode is set to CLUTTER_ZOOM_MODE then zoom is based on the distance to the closest object around the robot.

Parameters:
rangeNew set of range values.
maxRangeMaximum range to be considered valid.
minRangeMinimum range to be considered valid.
minThThe starting theta for the range values.
thIncrementThe delta between incremental range scans.
minDistToObjectThe distance to the closest object.

Definition at line 219 of file DistanceRenderer.java.


Member Data Documentation

The field of view of the camera in degrees.

Definition at line 64 of file DistanceRenderer.java.

final String org.ros.android.view.DistanceRenderer.DISTANCE_VIEW_ZOOM_LOCK_KEY = "DISTANCE_VIEW_ZOOM_LOCK" [static, private]

The key used to save the state of zoomLocked in shared preferences.

Definition at line 76 of file DistanceRenderer.java.

final String org.ros.android.view.DistanceRenderer.DISTANCE_VIEW_ZOOM_MODE_KEY = "DISTANCE_VIEW_ZOOM_MODE" [static, private]

The key used to save the state of zoomMode in shared preferences.

Definition at line 80 of file DistanceRenderer.java.

Initial value:
 1 / Math.tan(Math
      .toRadians(DISTANCE_VIEW_FIELD_OF_VIEW / 2))

Value to be multiplied with the opposite side (distance from the center of the view that must be visible) of the triangle to get the adjacent side of the triangle (distance of the camera from the origin).

Definition at line 70 of file DistanceRenderer.java.

final String org.ros.android.view.DistanceRenderer.DISTANCE_VIEW_ZOOM_VALUE_KEY = "DISTANCE_VIEW_ZOOM_VALUE" [static, private]

The key used to save the state of zoom in shared preferences.

Definition at line 84 of file DistanceRenderer.java.

SharedPreferences.Editor org.ros.android.view.DistanceRenderer.editor [private]

Definition at line 110 of file DistanceRenderer.java.

final float org.ros.android.view.DistanceRenderer.MAX_DISTANCE_ZOOM = -13.856406465f [static, private]

Similar concept as MIN_DISTANCE_ZOOM.

Definition at line 60 of file DistanceRenderer.java.

final float org.ros.android.view.DistanceRenderer.MAX_FOV_DISTANCE = 8f [static, private]

The same as MIN_FOV_DISTANCE except limits the maximum area around the robot that will be shown.

Definition at line 48 of file DistanceRenderer.java.

final float org.ros.android.view.DistanceRenderer.MIN_DISTANCE_ZOOM = -5.196152424f [static, private]

The distance from the origin (0,0,0) on the z-axis for the camera to be placed to see { MIN_FOV_DISTANCE} around the robot.X The value is calculated based on simple trigonometry ( { MIN_FOV_DISTANCE} /tan(30)). 60 degrees being the field of view of the camera. This is used to save some computation, since this boundary condition occurs often.

Definition at line 56 of file DistanceRenderer.java.

final float org.ros.android.view.DistanceRenderer.MIN_FOV_DISTANCE = 3f [static, private]

The minimum distance that must be visible in the distance view. A value of { MIN_FOV_DISTANCE} indicates that the distance view will at least show objects within MIN_FOV_DISTANCE/2 meters above, below, to the left, and to the right of the robot.

Definition at line 43 of file DistanceRenderer.java.

Instance of the helper class that draws the sensor values.

Definition at line 88 of file DistanceRenderer.java.

Definition at line 109 of file DistanceRenderer.java.

The amount of rotation (in degrees) applied to the camera.

TODO: This must be updated based on the current pan of the front facing camera used to navigate.

Definition at line 95 of file DistanceRenderer.java.

The amount of zoom. The value for zoom represents the distance between the camera and the plane on which the points are rendered.

Definition at line 100 of file DistanceRenderer.java.

True when zooming is disabled and false otherwise.

Definition at line 108 of file DistanceRenderer.java.

The current mode of zoom for the view.

Definition at line 104 of file DistanceRenderer.java.


The documentation for this class was generated from the following file:


android_core
Author(s): Damon Kohler
autogenerated on Thu Aug 27 2015 12:11:33