roneos
Operating System for the r-one robot
 All Data Structures Files Functions Variables Typedefs Groups
bump_sensor.h File Reference

Reads bump sensor information and includes helper functions for processing this data. More...

Go to the source code of this file.

Functions

uint8 bumpSensorsGetBits ()
 Get bump sensor bits. More...
 
int16 bumpSensorsGetBearing ()
 Get bump sensor bearing. More...
 
uint8 bumpSensorsWhichHit ()
 Returns an integer identifying from which direction the robot was hit. More...
 

Detailed Description

Reads bump sensor information and includes helper functions for processing this data.

Since
July 22, 2010
Author
James McLurkin

Function Documentation

int16 bumpSensorsGetBearing ( )

Get bump sensor bearing.

Returns
the bump sensor bearing
uint8 bumpSensorsGetBits ( )

Get bump sensor bits.

Returns
the bump sensor bits
uint8 bumpSensorsWhichHit ( )

Returns an integer identifying from which direction the robot was hit.

0 - Hit from front 1 - Hit from left 2 - Hit from right 3 - Hit from behind

If the robot is not being hit, returns -1.

Returns
An integer corresponding to the robot bump sensor that is active.