Elisa3
behaviors.h File Reference

Behaviors module. More...

#include "variables.h"
#include <math.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

void initBehaviors ()
 Initialize variables and functionalities (e.g. random generator) used in the behaviors.
void obstacleAvoidance (signed int *pwmLeft, signed int *pwmRight)
 Obstacle avoidance behavior based on a simplified force field method. It works for both forward and backward motion. The function need to be called before the speed controller and with a cadency of at least 122 Hz (motors pwm frequency).
char cliffDetected ()
 Cliff avoidance simple implementation in which the robot can be stopped when a cliff is detected with the ground sensors. The robot has to be calibrated in the surface in which it is moving in order for the behavior to work. The function need to be called before the speed controller and with a cadency of at least 122 Hz (motors pwm frequency). THE FUNCTION IS DEPRECATED: the behavior is directly inserted in the ADC interrupt service routine, thus this function is no more needed and should not be called anymore.
void enableObstacleAvoidance ()
 Enable obstacle avoidance behavior.
void disableObstacleAvoidance ()
 Disable obstacle avoidance behavior.
void enableCliffAvoidance ()
 Enable cliff avoidance behavior.
void disableCliffAvoidance ()
 Disable cliff avoidance behavior.

Detailed Description

Behaviors module.

Author:
Stefano Morgani <stefano@gctronic.com>
Version:
1.0
Date:
01.02.12

This module contains two basic low level behaviors: obstacle and cliff avoidance. Obstacle avoidance is accomplished using the 8 proximity sensors placed around the robot, whereas the cliff avoidance is based on the 4 ground sensors values.


Function Documentation

char cliffDetected ( )

Cliff avoidance simple implementation in which the robot can be stopped when a cliff is detected with the ground sensors. The robot has to be calibrated in the surface in which it is moving in order for the behavior to work. The function need to be called before the speed controller and with a cadency of at least 122 Hz (motors pwm frequency). THE FUNCTION IS DEPRECATED: the behavior is directly inserted in the ADC interrupt service routine, thus this function is no more needed and should not be called anymore.

Return values:
0cliff not detected
1cliff detected

Disable cliff avoidance behavior.

Returns:
none

Disable obstacle avoidance behavior.

Returns:
none

Enable cliff avoidance behavior.

Returns:
none

Enable obstacle avoidance behavior.

Returns:
none
void initBehaviors ( )

Initialize variables and functionalities (e.g. random generator) used in the behaviors.

Returns:
none
void obstacleAvoidance ( signed int *  pwmLeft,
signed int *  pwmRight 
)

Obstacle avoidance behavior based on a simplified force field method. It works for both forward and backward motion. The function need to be called before the speed controller and with a cadency of at least 122 Hz (motors pwm frequency).

Returns:
none
 All Files Functions Variables Defines