#include <stdint.h>
#include <stdio.h>
#include <mcl.h>
#include <RobotType.h>
#include "RobotTypeArr.h"
#include "roboevent.h"
#include <fsm.h>
#include "fsmloc.h"


Go to the source code of this file.
Classes | |
| struct | robo_pos |
| struct | bottle_sens |
| struct | robo_priv |
Defines | |
| #define | LAS_CNT 12 |
| #define | LAS_MEAS_CNTI 0 |
| #define | LAS_MEAS_PERI 1 |
| #define | LAS_MEAS_DATAI 2 |
| #define | FSM_CNT 5 |
| #define | FSM(id) (&robot.fsm[FSM_ID_##id]) |
| #define | FSM_GET_BY_ID(id) (&robot.fsm[FSM_ID_##id]) |
| Returns pointer to struct fsm identified by the id. | |
| #define | __robot_lock_act_pos lock_act_pos |
| #define | __robot_lock_est_pos lock |
| #define | __robot_lock_goal lock |
| #define | __robot_lock_IRsensors lock |
| #define | __robot_lock_joy lock |
| #define | __robot_lock_laser_recv lock |
| #define | __robot_lock_new_trajectory lock |
| #define | __robot_lock_sharpsOpponent lock |
| #define | __robot_lock_sharpsWaste lock |
| #define | ROBOT_LOCK(var) (pthread_mutex_lock(&robot.__robot_lock_##var)) |
| Locks the robot structure. | |
| #define | ROBOT_UNLOCK(var) (pthread_mutex_unlock(&robot.__robot_lock_##var)) |
| Unlocks the robot structure. | |
| #define | DEBUG |
| DEBUG MACROS. | |
| #define | PROG_NAME "robot" |
| #define | DBG(f, a...) printf(f, ## a) |
| #define | DBGPROG(f, a...) printf(PROG_NAME ": " f, ## a) |
| #define | ROBOT_WIDTH_MM 290 |
| #define | ROBOT_ROTATION_RADIUS_MM (254/2) |
| #define | LASER_CENTER_OFFSET_MM 50 /*FIXME*/ |
| #define | ROBOT_WHEEL_RADIUS_MM 40 |
| #define | ROBOT_AXIS_TO_BACK_MM 75 |
| #define | ROBOT_AXIS_TO_FRONT_MM 183 |
| #define | ROBOT_AXIS_TO_BELT_MM 280 |
| #define | PLAYGROUND_WIDTH_MM 3000 |
| #define | PLAYGROUND_HEIGHT_MM 2100 |
| #define | TRAJ_FOLLOWER_PRIO 255 |
| #define | TRAJ_RECALC_PRIO 0 |
| #define | SET_THREAD_PRIORITY(tid, prio) |
Enumerations | |
| enum | robot_fsm_id { FSM_ID_MAIN = 0, FSM_ID_DET = 1, FSM_ID_LOC = 2, FSM_ID_MOTION = 3, FSM_ID_PICKUP = 4 } |
| enum | bottle_sens_state { NOTHING = 0, FAR, CLOSE } |
| enum | { ROBO_COMPETING = 0, ROBO_TESTING } |
Functions | |
| void | initOrte () |
| void | terminateOrte () |
| int | robot_init () |
| Initializes the robot. | |
| int | robot_start () |
| Starts the robot threads. | |
| int | robot_exit () |
| Signals all the robot threads to finish. | |
| int | robot_wait () |
| Wait for finishing the robot threads after calling robot_exit(). | |
| int | robot_destroy () |
| Stops the robot. | |
| FSM_STATE_DECL (main_init) | |
| FSM_STATE_DECL (start_pickup) | |
| FSM_STATE_DECL (move_init) | |
| FSM_STATE_DECL (det_start) | |
| FSM_STATE_DECL (loc_init) | |
Variables | |
| struct robo_priv | robot |
Copyright: (c) 2007 DCE Eurobot Dragon Team CTU FEE - Department of Control Engineering Contacts: Tran Duy Khanh <trandk1@fel.cvut.cz> License: GNU GPL v.2
Definition in file robot.h.
| #define ROBOT_LOCK | ( | var | ) | (pthread_mutex_lock(&robot.__robot_lock_##var)) |
Locks the robot structure.
| var | Field in the structure you are going to work with. |
Definition at line 147 of file robot.h.
Referenced by new_goal(), new_trajectory(), robot_goto(), robot_trajectory_add_final_point(), robot_trajectory_add_point(), robot_trajectory_new_ex(), trajctory_recalc(), and trajectory_follower().
| #define ROBOT_UNLOCK | ( | var | ) | (pthread_mutex_unlock(&robot.__robot_lock_##var)) |
Unlocks the robot structure.
| var | Field in the structure, which was locked by ROBOT_LOCK. |
Definition at line 153 of file robot.h.
Referenced by new_goal(), new_trajectory(), robot_goto(), robot_trajectory_add_final_point(), robot_trajectory_add_point(), robot_trajectory_new_ex(), trajctory_recalc(), and trajectory_follower().
| #define SET_THREAD_PRIORITY | ( | tid, | |||
| prio | ) |
| enum bottle_sens_state |
| enum robot_fsm_id |
| int robot_destroy | ( | ) |
Stops the robot.
All resources alocated by robot_init() or robot_start() are dealocated here.
Definition at line 150 of file robot.c.
References DBG, FSM_CNT, fsm_destroy(), and robot_trajectory_stop().

| int robot_exit | ( | ) |
| int robot_init | ( | ) |
Initializes the robot.
Setup fields in robot structure, initializes FSMs and ORTE.
Definition at line 50 of file robot.c.
References FSM_CNT, fsm_init(), and ROBO_TESTING.

| int robot_start | ( | ) |
Starts the robot threads.
Don't exit() in case of error.
Definition at line 86 of file robot.c.
References FSM_CNT, and fsm_start().

| int robot_wait | ( | ) |
Wait for finishing the robot threads after calling robot_exit().
*
Definition at line 134 of file robot.c.
References FSM_CNT.
1.5.3