CRINSA-team2024 2024
Documentation du Club Robot INSA Rennes 2024
Chargement...
Recherche...
Aucune correspondance
Référence de la classe robot_behaviour.RobotBehavior

Dérivée par robot_behaviour.Robot.

Fonctions membres publiques

 __init__ (self, manager, *args, timelimit=None, exec_param=Logger.SHOW, log_level=INFO, **kwargs)
 
 perform (self, procedure, args=(), kwargs={}, timelimit=True)
 
 interrupt (self, thread)
 
 get (self, thread, timeout=None)
 
 send (self, *args, **kwargs)
 
 start_preparation (self)
 
 make_decision (self)
 
 goto_procedure (self, destination)
 
 set_side (self, side)
 
 set_position (self)
 
 positioning (self)
 
 start_procedure (self)
 
 stop_procedure (self)
 
 start (self)
 
 stop (self)
 
 get_elapsed_time (self)
 

Description détaillée

This class describe the generic beahviour of the robot. How to reach an action point and how to excute the desired action

Raises:
    TimeoutError: Timeout on communication or action
    AccessDenied: Thread is not allowed to execute on manager
    RuntimeError: Function not override
    RuntimeError: Function not override
    RuntimeError: Function not override
    RuntimeError: Function not override
    RuntimeError: Function not override

Documentation des constructeurs et destructeur

◆ __init__()

robot_behaviour.RobotBehavior.__init__ ( self,
manager,
* args,
timelimit = None,
exec_param = Logger.SHOW,
log_level = INFO,
** kwargs )
Initialise all the useful object members

Args:
    manager (class): The manager proxy
    timelimit (int, optional): The match time limit. Defaults to None.
    exec_param (int, optional): The logger display configuration. Defaults to Logger.SHOW.
    log_level (int, optional): The logger display level. Defaults to INFO.
Voici le graphe d'appel pour cette fonction :

Documentation des fonctions membres

◆ get()

robot_behaviour.RobotBehavior.get ( self,
thread,
timeout = None )
Wait for the current running thread(Action procedure) is end. Return the procedure result after.

Args:
    thread (Thread id): The current action thread to perform
    timeout (int, optional): The action timeout. Defaults to None.

Raises:
    TimeoutError: Raise this error when a timeour occur

Returns:
    return param: the output parameter of the thread

◆ get_elapsed_time()

robot_behaviour.RobotBehavior.get_elapsed_time ( self)
Get the time elapsed from the start of match

Returns:
    long: the elapsed time
Voici le graphe des appelants de cette fonction :

◆ goto_procedure()

robot_behaviour.RobotBehavior.goto_procedure ( self,
destination )
This function is called to choose how to reach an action point. The child robot needs to override this method to choose the moving behavior

Args:
    destination (tuple): The robot destionation coordinates x,y,theta

Raises:
    RuntimeError: When the method in not override by the child class

◆ interrupt()

robot_behaviour.RobotBehavior.interrupt ( self,
thread )
Interrupt the desired thread (Action procedure)

Args:
    thread (Thead id): The wanted thread

◆ make_decision()

robot_behaviour.RobotBehavior.make_decision ( self)
This function is called to choose which action to execute. The child robot needs to override this method to choose the decision behavior

Raises:
    RuntimeError: When the method in not override by the child class

◆ perform()

robot_behaviour.RobotBehavior.perform ( self,
procedure,
args = (),
kwargs = {},
timelimit = True )
This method allow the robot to perform an action. It create one thread for the current action and check if this thread is allow to run

Args:
    procedure (function): The desired action procedure
    args (tuple, optional): The procedure arguments. Defaults to ().
    kwargs (dict, optional): The procedure kwargs . Defaults to {}.
    timelimit (bool, optional): The match time limit. Defaults to True.

Returns:
    Thread : Return the created thread

◆ positioning()

robot_behaviour.RobotBehavior.positioning ( self)
Optionnal positioning method to do a small move after setting up the start position

◆ send()

robot_behaviour.RobotBehavior.send ( self,
* args,
** kwargs )
redefine the manager send method in order to only use the proxy when the running thread is authorized

Raises:
    AccessDenied: When the acces is denied for current thread

Returns:
    Manager ret code
Voici le graphe d'appel pour cette fonction :
Voici le graphe des appelants de cette fonction :

◆ set_position()

robot_behaviour.RobotBehavior.set_position ( self)
This function is called to setup the starting position. The child robot needs to override this method to apply the stating position

Raises:
    RuntimeError: When the method in not override by the child class
Voici le graphe des appelants de cette fonction :

◆ set_side()

robot_behaviour.RobotBehavior.set_side ( self,
side )
This function is called to choose the robot side. The child robot needs to override this method to choose how to attribute a side

Args:
    side (int): the side color

Raises:
    RuntimeError: When the method in not override by the child class

◆ start()

robot_behaviour.RobotBehavior.start ( self)
This method is the core of the robot. It allow the robot to go to each action and reach all action points

◆ start_preparation()

robot_behaviour.RobotBehavior.start_preparation ( self)
This method is called during prepartion phase in order to run the robot IHM and allow the user to setup the robot before a match.

◆ start_procedure()

robot_behaviour.RobotBehavior.start_procedure ( self)
Optionnal function running when the robot start its match. Usually used tu put the actuators to its default position

◆ stop()

robot_behaviour.RobotBehavior.stop ( self)
Stop the robot
Voici le graphe des appelants de cette fonction :

◆ stop_procedure()

robot_behaviour.RobotBehavior.stop_procedure ( self)
Optionnal function running at the end of match. Usually used to check if the funny action is end

La documentation de cette classe a été générée à partir du fichier suivant :