Classes | Defines | Enumerations | Functions | Variables

robot.h File Reference

#include <stdint.h>
#include <stdio.h>
#include <trgenconstr.h>
#include <robottype.h>
#include <roboorte_robottype.h>
#include <robodim.h>
#include <roboevent.h>
#include <fsm.h>
#include <robot_config.h>
Include dependency graph for robot.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  robot

Defines

#define ROBOT_FSM_MAIN   main
 FSM.
#define ROBOT_FSM_MOTION   motion
#define ROBOT_FSM_DISPLAY   display
#define ROBOT_FSM_ACT   act
#define FSM_GET_BY_ID(fsm_id)   (&robot.fsm.ROBOT_FSM_##fsm_id)
#define __LOCK_CHECK(mutex)
 LOCKING MANIPULATION.
#define __UNLOCK_CHECK(mutex)
#define ROBOT_LOCK(var)
 Locks the robot structure.
#define ROBOT_UNLOCK(var)
 Unlocks the robot structure.
#define __robot_lock_ref_pos   lock_ref_pos
#define __robot_lock_est_pos_odo   lock_est_pos_odo
#define __robot_lock_est_pos_indep_odo   lock_est_pos_indep_odo
#define __robot_lock_joy_data   lock_joy_data
#define __robot_lock_meas_angles   lock_meas_angles
#define __robot_lock_drives   lock
#define __robot_lock_sharps   lock
#define __robot_lock_hokuyo   lock
#define __robot_lock_cmu   lock
#define __robot_lock_bumper   lock
#define __robot_lock_disp   lock_disp
#define __robot_lock_motion_irc   lock
#define __robot_lock_odo_data   lock
#define __robot_lock_corr_distances   lock
#define __robot_lock_camera_result   lock_camera
#define THREAD_PRIO_TRAJ_FOLLOWER   90
#define THREAD_PRIO_TRAJ_RECLAC   18
#define OBST_FORGETING_PRIO   17

Enumerations

enum  team_color { RED = 0, BLUE }
 

robot.h 08/04/20

More...
enum  robot_start_state { POWER_ON = 0, START_PLUGGED_IN, COMPETITION_STARTED }
enum  robot_status { STATUS_OK, STATUS_WARNING, STATUS_FAILED }
enum  robot_component {
  COMPONENT_MOTOR, COMPONENT_ODOMETRY, COMPONENT_CAMERA, COMPONENT_POWER,
  COMPONENT_HOKUYO, COMPONENT_START, COMPONENT_JAWS, COMPONENT_LIFT,
  ROBOT_COMPONENT_NUMBER
}

Functions

int robot_init () __attribute__((warn_unused_result))
 Initializes the robot.
int robot_start () __attribute__((warn_unused_result))
 Starts the robot FSMs and threads.
void robot_exit ()
 Signals all the robot threads to finish.
void robot_destroy ()
 Stops the robot.
void robot_get_est_pos_trans (double *x, double *y, double *phi)
void robot_get_est_pos (double *x, double *y, double *phi)
void serial_comm (int status)
 FSM_STATE_FULL_DECL (main, init)
 FSM_STATE_FULL_DECL (motion, init)
 FSM_STATE_FULL_DECL (disp, init)
 FSM_STATE_FULL_DECL (act, wait_for_command)

Variables

struct robot robot

Define Documentation

#define __LOCK_CHECK (   mutex  ) 

LOCKING MANIPULATION.

#define __robot_lock_bumper   lock
#define __robot_lock_camera_result   lock_camera
#define __robot_lock_cmu   lock
#define __robot_lock_corr_distances   lock
#define __robot_lock_disp   lock_disp
#define __robot_lock_drives   lock
#define __robot_lock_est_pos_indep_odo   lock_est_pos_indep_odo
#define __robot_lock_est_pos_odo   lock_est_pos_odo
#define __robot_lock_hokuyo   lock
#define __robot_lock_joy_data   lock_joy_data
#define __robot_lock_meas_angles   lock_meas_angles
#define __robot_lock_motion_irc   lock
#define __robot_lock_odo_data   lock
#define __robot_lock_ref_pos   lock_ref_pos
#define __robot_lock_sharps   lock
#define __UNLOCK_CHECK (   mutex  ) 
#define FSM_GET_BY_ID (   fsm_id  )     (&robot.fsm.ROBOT_FSM_##fsm_id)
#define OBST_FORGETING_PRIO   17
#define ROBOT_FSM_ACT   act
#define ROBOT_FSM_DISPLAY   display
#define ROBOT_FSM_MAIN   main

FSM.

#define ROBOT_FSM_MOTION   motion
#define ROBOT_LOCK (   var  ) 
Value:
do {                                                     \
                pthread_mutex_lock(&robot.__robot_lock_##var);   \
                __LOCK_CHECK(&robot.__robot_lock_##var);         \
        } while(0)

Locks the robot structure.

Parameters:
var Field in the structure you are going to work with.
#define ROBOT_UNLOCK (   var  ) 
Value:
do {                                                            \
                __UNLOCK_CHECK(&robot.__robot_lock_##var);              \
                pthread_mutex_unlock(&robot.__robot_lock_##var);        \
        } while(0)

Unlocks the robot structure.

Parameters:
var Field in the structure, which was locked by ROBOT_LOCK.
#define THREAD_PRIO_TRAJ_FOLLOWER   90
#define THREAD_PRIO_TRAJ_RECLAC   18

Enumeration Type Documentation

Enumerator:
COMPONENT_MOTOR 
COMPONENT_ODOMETRY 
COMPONENT_CAMERA 
COMPONENT_POWER 
COMPONENT_HOKUYO 
COMPONENT_START 
COMPONENT_JAWS 
COMPONENT_LIFT 
ROBOT_COMPONENT_NUMBER 
Enumerator:
POWER_ON 
START_PLUGGED_IN 
COMPETITION_STARTED 
Enumerator:
STATUS_OK 
STATUS_WARNING 
STATUS_FAILED 
enum team_color

robot.h 08/04/20

Robot's data structures for the Eurobot 2008.

Copyright: (c) 2008 CTU Dragons CTU FEE - Department of Control Engineering License: GNU GPL v.2 Competition parameters

Enumerator:
RED 
BLUE 

Function Documentation

FSM_STATE_FULL_DECL ( main  ,
init   
)
FSM_STATE_FULL_DECL ( act  ,
wait_for_command   
)
FSM_STATE_FULL_DECL ( motion  ,
init   
)
FSM_STATE_FULL_DECL ( disp  ,
init   
)
void robot_destroy (  ) 

Stops the robot.

All resources alocated by robot_init() or robot_start() are dealocated here.

Here is the call graph for this function:

Here is the caller graph for this function:

void robot_exit (  ) 

Signals all the robot threads to finish.

Here is the call graph for this function:

Here is the caller graph for this function:

void robot_get_est_pos ( double *  x,
double *  y,
double *  phi 
)

Here is the caller graph for this function:

void robot_get_est_pos_trans ( double *  x,
double *  y,
double *  phi 
)

Here is the call graph for this function:

int robot_init (  ) 

Initializes the robot.

Setup fields in robot structure, initializes FSMs and ORTE.

Returns:
0

Here is the call graph for this function:

Here is the caller graph for this function:

int robot_start (  ) 

Starts the robot FSMs and threads.

Returns:
0

Here is the call graph for this function:

Here is the caller graph for this function:

void serial_comm ( int  status  ) 

Variable Documentation

struct robot robot