Public Member Functions | |
void | currentSpeed (double speed) |
DistanceView (Context context) | |
DistanceView (Context context, AttributeSet attrs) | |
GraphName | getDefaultNodeName () |
void | lockZoom () |
void | onError (Node node, Throwable throwable) |
void | onNewMessage (final LaserScan message) |
void | onShutdown (Node node) |
void | onShutdownComplete (Node node) |
void | onStart (ConnectedNode connectedNode) |
boolean | onTouch (View v, MotionEvent event) |
void | setTopicName (String topicName) |
void | setZoomMode (ZoomMode mode) |
void | unlockZoom () |
Private Member Functions | |
double | calculateDistance (float x1, float y1, float x2, float y2) |
Private Attributes | |
double | contactDistance |
DistanceRenderer | distanceRenderer |
String | laserTopic |
double | normalizedZoomValue |
An OpenGL view that displayed data from a laser scanner (or similar sensors like a kinect). This view can zoom in/out based in one of three modes. The user can change the zoom level through a pinch/reverse-pinch, the zoom level can auto adjust based on the speed of the robot, and the zoom level can also auto adjust based on the distance to the closest object around the robot.
Definition at line 46 of file DistanceView.java.
org.ros.android.view.DistanceView.DistanceView | ( | Context | context | ) | [inline] |
Initialize the rendering surface.
context |
Definition at line 74 of file DistanceView.java.
org.ros.android.view.DistanceView.DistanceView | ( | Context | context, |
AttributeSet | attrs | ||
) | [inline] |
Definition at line 78 of file DistanceView.java.
double org.ros.android.view.DistanceView.calculateDistance | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2 | ||
) | [inline, private] |
Definition at line 240 of file DistanceView.java.
void org.ros.android.view.DistanceView.currentSpeed | ( | double | speed | ) | [inline] |
Updates the current speed in distanceRenderer which then can adjust the zoom level in velocity mode.
speed | The linear velocity of the robot. |
Definition at line 198 of file DistanceView.java.
Implements org::ros::node::NodeMain.
Definition at line 101 of file DistanceView.java.
void org.ros.android.view.DistanceView.lockZoom | ( | ) | [inline] |
Prevents changes to the zoom level.
Definition at line 180 of file DistanceView.java.
void org.ros.android.view.DistanceView.onError | ( | Node | node, |
Throwable | throwable | ||
) | [inline] |
Implements org::ros::node::NodeListener.
Definition at line 142 of file DistanceView.java.
void org.ros.android.view.DistanceView.onNewMessage | ( | final LaserScan | message | ) | [inline] |
Definition at line 146 of file DistanceView.java.
void org.ros.android.view.DistanceView.onShutdown | ( | Node | node | ) | [inline] |
Implements org::ros::node::NodeListener.
Definition at line 132 of file DistanceView.java.
void org.ros.android.view.DistanceView.onShutdownComplete | ( | Node | node | ) | [inline] |
Implements org::ros::node::NodeListener.
Definition at line 136 of file DistanceView.java.
void org.ros.android.view.DistanceView.onStart | ( | ConnectedNode | connectedNode | ) | [inline] |
Implements org::ros::node::NodeListener.
Definition at line 106 of file DistanceView.java.
boolean org.ros.android.view.DistanceView.onTouch | ( | View | v, |
MotionEvent | event | ||
) | [inline] |
Definition at line 203 of file DistanceView.java.
void org.ros.android.view.DistanceView.setTopicName | ( | String | topicName | ) | [inline] |
Sets the topic that the distance view node should subscribe to.
topicName | Name of the ROS topic. |
Definition at line 96 of file DistanceView.java.
void org.ros.android.view.DistanceView.setZoomMode | ( | ZoomMode | mode | ) | [inline] |
Sets the zoom mode to one of the modes in ZoomMode.
mode | The zoom mode that must be set. |
Definition at line 173 of file DistanceView.java.
void org.ros.android.view.DistanceView.unlockZoom | ( | ) | [inline] |
Unlocks the zoom allowing it to be changed.
Definition at line 187 of file DistanceView.java.
double org.ros.android.view.DistanceView.contactDistance [private] |
Distance between 2 contacts on the view (in pixels). Used while zooming in/out.
Definition at line 57 of file DistanceView.java.
An instance of DistanceRenderer that implements GLSurfaceView.Renderer and is used to render the distance view.
Definition at line 67 of file DistanceView.java.
String org.ros.android.view.DistanceView.laserTopic [private] |
Topic for the distance scans that this view subscribes to.
Definition at line 52 of file DistanceView.java.
double org.ros.android.view.DistanceView.normalizedZoomValue [private] |
Zoom value between 1 and 0. 1 represents maximum zoom in and 0 maximum zoom out.
Definition at line 62 of file DistanceView.java.