Sensor Commands

rv.ranger_measurement()

Command:

.ranger_measurment()

Command
Syntax:

.ranger_measurement()

Python
Code
Samples:

r = rv.ranger_measurement()

Range:

N/A

Describe:

The front-facing ultrasonic distance sensor. Returns measurements in meters. ~10.00 meters means no obstacle was detected.

Result:

Returns value in Meters.

Type or
Addressable
Component:

Sensor

Note: This Rover sensor command is executed immediately.

 

rv.color_measurement():

Command:

.color_measurement()

Command
Syntax:

.color_measurement()

Python
Code
Samples:

c = rv.color_measurement()

Range:

1 thru 9

Describe:

Bottom-mounted color sensor detects the color of the surface. Can also detect gray-level scale of black (0) to white (255).

Result:

Returns current color sensor information.

The return value is in the 1 – 9 range which maps to the colors below:

Color

Return value

Red

1

Green

2

Blue

3

Cyan

4

Magenta

5

Yellow

6

Black

7

White

8

Gray 9

Type or
Addressable
Component:

Sensor

Note: This Rover sensor command is executed immediately.

 

rv.red_measurement()

Command:

.red_measurement()

Command
Syntax:

.red_measurement()

Python
Code
Samples:

r = rv.red_measurement()

Range:

0 - 255

Describe:

Detect intensity of individual red components of surface. The results are in 0-255 range.

Result:

Returns current color sensor "red" value.

Type or
Addressable
Component:

Sensor

Note: This Rover sensor command is executed immediately.

 

rv.green_measurement()

Command:

.green_measurement()

Command
Syntax:

.green_measurement()

Python
Code
Samples:

g = rv.green_measurement()

Range:

0 - 255

Describe:

Detect intensity of individual green components of surface. The results are in 0-255 range.

Result:

Returns current color sensor "green" value.

Error:

 

Type or
Addressable
Component:

Sensor

Note: This Rover sensor command is executed immediately.

 

rv.blue_measurement():

Command:

.blue_measurement()

Command
Syntax:

.blue_measurement()

Python
Code
Samples:

b = rv.blue_measurement()

Range:

0 - 255

Describe:

Detect intensity of individual blue components of surface. The results are in 0-255 range.

Result:

Returns current color sensor "blue" value.

Error:

 

Type or
Addressable
Component:

Sensor

Note: This Rover sensor command is executed immediately.

 

rv.gray_measurement():

Command:

.gray_measurement()

Command
Syntax:

.gray_measurement()

Python
Code
Samples:

gray = rv.gray_measurement()

Range:

0 - 255

Describe:

Detect intensity of individual gray components of surface. The results are in 0-255 range.

Result:

Returns current color sensor "gray" value.

Error:

 

Type or
Addressable
Component:

Sensor

Note: This Rover sensor command is executed immediately.

 

rv.encoders_gyro_measurement()

Command:

.encoders_gyro_measurement()

Command
Syntax:

.encoders_gyro_measurement()

Python
Code
Samples:

L1 = rv.encoders_gyro_measurement()

Range:

N/A

Describe:

The left and right encoder, coupled with the gyro and operating time information.

Result:

List of values of current left and right encoder, coupled with gyro and operating time information.

Type or
Addressable
Component:

Control

Note: This Rover READ command is executed immediately.

 

rv.gyro_measurement

Command:

.gyro_measurement()

Command
Syntax:

.gyro_measurement()

Python
Code
Samples:

rv.gyro_measurement()

Range:

N/A

Describe:

The gyroscope is used to maintain the heading of Rover while it’s in motion. It can also be used to measure the change in angle during turns.

The gyroscope is ready to use after the CONNECT RV command is processed.

The GYRO object shall be usable even when the RV is not in motion.

 

Result:

Returns current gyro sensor angular deviation from 0.0, reading partially drift-offset compensated.

Type or
Addressable
Component:

Control

Note: This Rover READ command is executed immediately.