Main Page
Namespaces
Namespace List
Namespace Members
All
Variables
Typedefs
Classes
Class List
Class Hierarchy
Class Members
All
Functions
Variables
Files
File List
File Members
All
Functions
Variables
Typedefs
include
rosserial_test
ros.h
Go to the documentation of this file.
1
#ifndef ROSSERIAL_ROS_H
2
#define ROSSERIAL_ROS_H
3
4
#include "rosserial/ros/node_handle.h"
5
#include "rosserial/duration.cpp"
6
#include "rosserial/time.cpp"
7
#include <iostream>
8
9
class
ClientComms
{
10
public
:
11
// Can smuggle in an fd representing either the back end of
12
// a socket or serial pty, and run the same tests over both.
13
static
int
fd
;
14
15
// Accessible to be manipulated by tests, for test behaviours
16
// dependent on the passage of time.
17
static
unsigned
long
millis
;
18
19
void
init
() {
20
}
21
int
read
() {
22
unsigned
char
ch;
23
ssize_t ret =
::read
(
fd
, &ch, 1);
24
return
ret == 1 ? ch : -1;
25
}
26
void
write
(uint8_t* data,
int
length) {
27
::write
(
fd
, data,
length
);
28
}
29
unsigned
long
time
() {
30
return
millis
;
31
}
32
};
33
34
int
ClientComms::fd
= -1;
35
unsigned
long
ClientComms::millis
= 0;
36
37
namespace
ros
{
38
typedef
NodeHandle_<ClientComms, 5, 5, 200, 200>
NodeHandle
;
39
}
40
41
#endif // ROSSERIAL_ROS_H
ClientComms::time
unsigned long time()
Definition:
ros.h:29
ros
ClientComms
Definition:
ros.h:9
ros::NodeHandle
NodeHandle_< ClientComms, 5, 5, 200, 200 > NodeHandle
Definition:
ros.h:38
ClientComms::init
void init()
Definition:
ros.h:19
ros::NodeHandle_< ClientComms, 5, 5, 200, 200 >
ClientComms::read
int read()
Definition:
ros.h:21
ClientComms::write
void write(uint8_t *data, int length)
Definition:
ros.h:26
ClientComms::fd
static int fd
Definition:
ros.h:13
length
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)
ClientComms::millis
static unsigned long millis
Definition:
ros.h:17
rosserial_test
Author(s):
autogenerated on Wed Mar 2 2022 00:58:17