RobotLib  1
A set of software wrappers for Rovio, Roomba and NXT robots written in C#.
 All Classes Namespaces Functions Variables Enumerations Properties Pages
Classes | Public Member Functions | Public Attributes | Properties | List of all members
Roomba.Sensors Class Reference

A convenience class for accessing Roomba's sensors. More...

Inheritance diagram for Roomba.Sensors:
Roomba.Component

Classes

class  Bump
 The state of the bump sensors: false = no bump, true = bump. More...
 
class  Button
 The state of the four Roomba buttons: false = button not pressed, true = button pressed. More...
 
class  Cliff
 The state of the cliff sensors: false = no cliff, true = cliff. More...
 
class  DirtDetector
 The current dirt detection level (0-255) of the dirt detector. Higher values indicate higher levels of dirt detected. More...
 
class  MotorOvercurrent
 The state of the five motors’ overcurrent sensors: false = no overcurrent, true = overcurrent. More...
 
class  Wheeldrop
 The state of the Wheeldrop sensors: false = wheel up, true = wheel dropped. More...
 

Public Member Functions

 Sensors (Robot _robot)
 The constructor.
 
void Update (SensorPacket packet)
 Update the sensor state.
 
- Public Member Functions inherited from Roomba.Component
 Component (Robot _robot)
 The constructor.
 

Public Attributes

Bump Bumps
 Bump sensors.
 
Wheeldrop Wheeldrops
 Wheeldrop sensors.
 
Cliff Cliffs
 Cliff sensors.
 
MotorOvercurrent MotorOvercurrents
 Motor Overcurrent sensors.
 
DirtDetector DirtDetectors
 Dirt Detector sensors.
 
Button Buttons
 Buttons.
 
- Public Attributes inherited from Roomba.Component
bool AutoUpdate = true
 Automatic update option for methods requesting more than one piece of information.
 

Properties

bool Wall [get]
 The state of the wall sensor: false = no wall, true = wall.
 
bool VirtualWall [get]
 The state of the virtual wall sensor: false = no wall, true = wall.
 
int RemoteControlCommand [get]
 The command number of the remote control command currently being received by Roomba. A value of 255 indicates that no remote control command is being received.
 
int Distance [get]
 The distance that Roomba has traveled in millimeters since the distance it was last requested. This is the same as the sum of the distance traveled by both wheels divided by two. Positive values indicate travel in the forward direction; negative in the reverse direction. If the value is not polled frequently enough, it will be capped at its minimum or maximum. (16 bit signed integer)
 
int Angle [get]
 The angle that Roomba has turned through since the angle was last requested. The angle is expressed as the difference in the distance traveled by Roomba’s two wheels in millimeters, specifically the right wheel distance minus the left wheel distance, divided by two. This makes counter-clockwise angles positive and clockwise angles negative. This can be used to directly calculate the angle that Roomba has turned through since the last request. Since the distance between Roomba’s wheels is 258mm, the equations for calculating the angles in familiar units are: Angle in radians = (2 * difference) / 258 Angle in degrees = (360 * difference) / (258 * Pi). If the value is not polled frequently enough, it will be capped at its minimum or maximum. (16 bit signed integer)
 
ChargingState ChargingState [get]
 Get charging state of the robot.
 
int Voltage [get]
 The voltage of Roomba’s battery in millivolts (mV).
 
int Current [get]
 The current in milliamps (mA) flowing into or out of Roomba’s battery. Negative currents indicate current is flowing out of the battery, as during normal running. Positive currents indicate current is flowing into the battery, as during charging.
 
int Temperature [get]
 The temperature of Roomba’s battery in degrees Celsius.
 
int Charge [get]
 The current charge of Roomba’s battery in milliamp-hours (mAh). The charge value decreases as the battery is depleted during running and increases when the battery is charged.
 
int Capacity [get]
 The estimated charge capacity of Roomba’s battery. When the Charge value reaches the Capacity value, the battery is fully charged.
 

Additional Inherited Members

- Protected Attributes inherited from Roomba.Component
Robot robot
 The robot class, accessible by all dervied classes.
 

Detailed Description

A convenience class for accessing Roomba's sensors.

Constructor & Destructor Documentation

Roomba.Sensors.Sensors ( Robot  _robot)

The constructor.

Member Function Documentation

void Roomba.Sensors.Update ( SensorPacket  packet)

Update the sensor state.

Parameters
packet

Member Data Documentation

Bump Roomba.Sensors.Bumps

Bump sensors.

Button Roomba.Sensors.Buttons

Buttons.

Cliff Roomba.Sensors.Cliffs

Cliff sensors.

DirtDetector Roomba.Sensors.DirtDetectors

Dirt Detector sensors.

MotorOvercurrent Roomba.Sensors.MotorOvercurrents

Motor Overcurrent sensors.

Wheeldrop Roomba.Sensors.Wheeldrops

Wheeldrop sensors.

Property Documentation

int Roomba.Sensors.Angle
get

The angle that Roomba has turned through since the angle was last requested. The angle is expressed as the difference in the distance traveled by Roomba’s two wheels in millimeters, specifically the right wheel distance minus the left wheel distance, divided by two. This makes counter-clockwise angles positive and clockwise angles negative. This can be used to directly calculate the angle that Roomba has turned through since the last request. Since the distance between Roomba’s wheels is 258mm, the equations for calculating the angles in familiar units are: Angle in radians = (2 * difference) / 258 Angle in degrees = (360 * difference) / (258 * Pi). If the value is not polled frequently enough, it will be capped at its minimum or maximum. (16 bit signed integer)

int Roomba.Sensors.Capacity
get

The estimated charge capacity of Roomba’s battery. When the Charge value reaches the Capacity value, the battery is fully charged.

int Roomba.Sensors.Charge
get

The current charge of Roomba’s battery in milliamp-hours (mAh). The charge value decreases as the battery is depleted during running and increases when the battery is charged.

ChargingState Roomba.Sensors.ChargingState
get

Get charging state of the robot.

int Roomba.Sensors.Current
get

The current in milliamps (mA) flowing into or out of Roomba’s battery. Negative currents indicate current is flowing out of the battery, as during normal running. Positive currents indicate current is flowing into the battery, as during charging.

int Roomba.Sensors.Distance
get

The distance that Roomba has traveled in millimeters since the distance it was last requested. This is the same as the sum of the distance traveled by both wheels divided by two. Positive values indicate travel in the forward direction; negative in the reverse direction. If the value is not polled frequently enough, it will be capped at its minimum or maximum. (16 bit signed integer)

int Roomba.Sensors.RemoteControlCommand
get

The command number of the remote control command currently being received by Roomba. A value of 255 indicates that no remote control command is being received.

int Roomba.Sensors.Temperature
get

The temperature of Roomba’s battery in degrees Celsius.

bool Roomba.Sensors.VirtualWall
get

The state of the virtual wall sensor: false = no wall, true = wall.

int Roomba.Sensors.Voltage
get

The voltage of Roomba’s battery in millivolts (mV).

bool Roomba.Sensors.Wall
get

The state of the wall sensor: false = no wall, true = wall.


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