BehTurn

class mobrob_behcon.behaviours.beh_turn.BehTurn(name, degrees=90, rot_vel=0.2)[source]

The class BehTurn

This class is a child of the class Behaviour representing a behaviour which turns the robot a given angle.

Attributes

Methods

__init__(name[, degrees, rot_vel])

constructor

add_desire(desire)

Send desire to resolver.

error([code])

Raise an error about the behaviour.

fire()

The fire()-method, which is necessary in every Behaviour, will be called by resolver in every polling cycle.

normalize_angle(angle)

Function to normalize an given angle

set_current_beh_group(beh_group)

Set current active behaviourgroup

set_percept_space(percept_space)

Set the reference to percept_space

set_priority(priority)

Set current priority of the behaviour, can be changed during runtime

set_resolver(resolver)

Set the reference to resolver

success([code])

Set the behaviour as successful ended.

Details

__init__(name, degrees=90, rot_vel=0.2)[source]

constructor

Parameters
  • name (string) – name of behaviour

  • degrees (int, optional) – angle by which the robot should rotate [deg], defaults to 90

  • rot_vel (float, optional) – rotation speed [m/s], defaults to 0.2

add_desire(desire)

Send desire to resolver.

Parameters

desire (Desire) – a desire to be added to the resolver

error(code=0)

Raise an error about the behaviour. With the error code some more information about the error can be given to the behaviourgroup

Parameters

code (int, optional) – error code, defaults to 0

fire()[source]

The fire()-method, which is necessary in every Behaviour, will be called by resolver in every polling cycle.

static normalize_angle(angle)[source]

Function to normalize an given angle

Parameters

angle (float) – angle to be normalized [rad]

Returns

normalized angle in range [-pi, pi]

Return type

float

set_current_beh_group(beh_group)

Set current active behaviourgroup

Parameters

beh_group (BehaviourGroup) – the currently active behaviour group

set_percept_space(percept_space)

Set the reference to percept_space

Parameters

percept_space (PerceptualSpace) – relevant percept_space object

set_priority(priority)

Set current priority of the behaviour, can be changed during runtime

Parameters

priority ([type]) – [description]

set_resolver(resolver)

Set the reference to resolver

Parameters

resolver (Resolver) – relevant resolver object

success(code=0)

Set the behaviour as successful ended. With the success code some more information about the success can be given to the behaviourgroup

Parameters

code (int, optional) – success code, defaults to 0