wg0x.cpp File Reference
#include <iomanip>
#include <math.h>
#include <stddef.h>
#include <ethercat_hardware/wg0x.h>
#include <dll/ethercat_dll.h>
#include <al/ethercat_AL.h>
#include <dll/ethercat_device_addressed_telegram.h>
#include <dll/ethercat_frame.h>
#include <boost/crc.hpp>
#include <boost/static_assert.hpp>
Go to the source code of this file.
Defines |
#define | CHECK_SAFETY_BIT(bit) |
#define | ERR_MODE "\033[41m" |
#define | ERROR_HDR "\033[41mERROR\033[0m" |
#define | GET_ATTR(a) |
#define | GOOD_MODE "\033[42m" |
#define | INFO_MODE "\033[44m" |
#define | STD_MODE "\033[0m" |
#define | WARN_HDR "\033[43mERROR\033[0m" |
#define | WARN_MODE "\033[43m" |
Functions |
static unsigned | computeChecksum (void const *data, unsigned length) |
| PLUGINLIB_REGISTER_CLASS (6805021, WG021, EthercatDevice) |
| PLUGINLIB_REGISTER_CLASS (6805006, WG06, EthercatDevice) |
| PLUGINLIB_REGISTER_CLASS (6805005, WG05, EthercatDevice) |
static unsigned int | rotateRight8 (unsigned in) |
int | safe_clock_gettime (clockid_t clk_id, timespec *time) |
| error checking wrapper around clock_gettime
|
void | safe_usleep (uint32_t usec) |
| safe version of usleep.
|
int | timediff_ms (const timespec ¤t, const timespec &start) |
| Find differece between two timespec values.
|
void | updateIndexAndWkc (EC_Telegram *tg, EC_Logic *logic) |
Define Documentation
#define CHECK_SAFETY_BIT |
( |
bit |
|
) |
|
Value:do { if (status & SAFETY_##bit) { \
str += prefix + #bit; \
prefix = ", "; \
} } while(0)
Definition at line 2346 of file wg0x.cpp.
#define ERR_MODE "\033[41m" |
#define ERROR_HDR "\033[41mERROR\033[0m" |
Value:{ \
TiXmlElement *c; \
attr = elt->Attribute((a)); \
if (!attr) { \
c = elt->FirstChildElement((a)); \
if (!c || !(attr = c->GetText())) { \
ROS_FATAL("Actuator is missing the attribute "#a); \
exit(EXIT_FAILURE); \
} \
} \
}
Definition at line 698 of file wg0x.cpp.
#define GOOD_MODE "\033[42m" |
#define INFO_MODE "\033[44m" |
#define STD_MODE "\033[0m" |
#define WARN_HDR "\033[43mERROR\033[0m" |
#define WARN_MODE "\033[43m" |
Function Documentation
static unsigned computeChecksum |
( |
void const * |
data, |
|
|
unsigned |
length | |
|
) |
| | [static] |
static unsigned int rotateRight8 |
( |
unsigned |
in |
) |
[static] |
int safe_clock_gettime |
( |
clockid_t |
clk_id, |
|
|
timespec * |
time | |
|
) |
| | |
error checking wrapper around clock_gettime
- Parameters:
-
| current | current time |
| current | start time |
- Returns:
- returns 0 for success, non-zero for failure
Definition at line 1470 of file wg0x.cpp.
void safe_usleep |
( |
uint32_t |
usec |
) |
|
safe version of usleep.
Uses nanosleep internally. Will restart sleep after begin woken by signal.
- Parameters:
-
| usec | number of microseconds to sleep for. Must be < 1000000. |
Definition at line 1489 of file wg0x.cpp.
int timediff_ms |
( |
const timespec & |
current, |
|
|
const timespec & |
start | |
|
) |
| | |
Find differece between two timespec values.
- Parameters:
-
| current | current time |
| current | start time |
- Returns:
- returns time difference (current-start) in milliseconds
Definition at line 1455 of file wg0x.cpp.
void updateIndexAndWkc |
( |
EC_Telegram * |
tg, |
|
|
EC_Logic * |
logic | |
|
) |
| | |