Clase que definirá la estructura básica una serie de componentes. Adaptado para ROS Define e implementa una serie de métodos y estructuras básicas que seguirán todos los componentes desarrollados por Robotnik (C) 2013 Robotnik Automation, SLL All rights reserved. More...
#include <ros/ros.h>#include <pthread.h>#include <string>#include <vector>#include <signal.h>#include <stdio.h>#include <stdlib.h>#include <string.h>

Go to the source code of this file.
Classes | |
| class | Component |
| Class component. More... | |
| struct | thread_data |
| struct to store main data for a thread More... | |
| struct | thread_param |
| Struct used for real time thread. More... | |
Defines | |
| #define | DEFAULT_THREAD_DESIRED_HZ 40.0 |
| Size of string for logging. | |
| #define | DEFAULT_THREAD_PRIORITY 25 |
| #define | NSEC_PER_SEC 1000000000 |
| #define | Pi 3.141592654 |
| #define | USEC_PER_SEC 1000000 |
Typedefs | |
| typedef struct thread_data | thread_data |
| struct to store main data for a thread | |
Enumerations | |
| enum | ReturnValue { OK = 0, INITIALIZED, THREAD_RUNNING, ERROR = -1, NOT_INITIALIZED = -2, THREAD_NOT_RUNNING = -3, COM_ERROR = -4, NOT_ERROR = -5 } |
| Defines return values for methods and functions. More... | |
| enum | States { INIT_STATE, STANDBY_STATE, READY_STATE, EMERGENCY_STATE, FAILURE_STATE, SHUTDOWN_STATE, UNKNOWN_STATE } |
| Defines standard states of a component. More... | |
Functions | |
| void * | AuxControlThread (void *threadParam) |
| Main function to execute into the thread. | |
| static long | calcdiff (struct timespec t1, struct timespec t2) |
| Returns time difference in uS. | |
| int | clock_nanosleep (clockid_t __clock_id, int __flags, __const struct timespec *__req, struct timespec *__rem) |
| static void | radnorm (double *radians) |
| Normalize in rad. | |
| static void | radnorm2 (double *radians) |
| static void | tsnorm (struct timespec *ts) |
Clase que definirá la estructura básica una serie de componentes. Adaptado para ROS Define e implementa una serie de métodos y estructuras básicas que seguirán todos los componentes desarrollados por Robotnik (C) 2013 Robotnik Automation, SLL All rights reserved.
Definition in file Component.h.
| #define DEFAULT_THREAD_DESIRED_HZ 40.0 |
Size of string for logging.
Definition at line 25 of file Component.h.
| #define DEFAULT_THREAD_PRIORITY 25 |
Definition at line 26 of file Component.h.
| #define NSEC_PER_SEC 1000000000 |
Definition at line 29 of file Component.h.
| #define Pi 3.141592654 |
Definition at line 30 of file Component.h.
| #define USEC_PER_SEC 1000000 |
Definition at line 28 of file Component.h.
| typedef struct thread_data thread_data |
struct to store main data for a thread
| enum ReturnValue |
Defines return values for methods and functions.
| OK | |
| INITIALIZED | |
| THREAD_RUNNING | |
| ERROR | |
| NOT_INITIALIZED | |
| THREAD_NOT_RUNNING | |
| COM_ERROR | |
| NOT_ERROR |
Definition at line 33 of file Component.h.
| enum States |
Defines standard states of a component.
| INIT_STATE | |
| STANDBY_STATE | |
| READY_STATE | |
| EMERGENCY_STATE | |
| FAILURE_STATE | |
| SHUTDOWN_STATE | |
| UNKNOWN_STATE |
Definition at line 44 of file Component.h.
| void * AuxControlThread | ( | void * | threadParam | ) |
Main function to execute into the thread.
| threadParam | as void *, parameters of thread Function executing in the thread |
Definition at line 20 of file Component.cc.
| static long calcdiff | ( | struct timespec | t1, |
| struct timespec | t2 | ||
| ) | [inline, static] |
Returns time difference in uS.
Definition at line 91 of file Component.h.
| int clock_nanosleep | ( | clockid_t | __clock_id, |
| int | __flags, | ||
| __const struct timespec * | __req, | ||
| struct timespec * | __rem | ||
| ) |
Global functions Use of real time nanosleep
| static void radnorm | ( | double * | radians | ) | [inline, static] |
Normalize in rad.
Definition at line 70 of file Component.h.
| static void radnorm2 | ( | double * | radians | ) | [inline, static] |
Normalize in rad Normalize between -PI and PI
Definition at line 81 of file Component.h.
| static void tsnorm | ( | struct timespec * | ts | ) | [inline, static] |
Common functions to all components Normalize in sec.ns
Definition at line 62 of file Component.h.