|
# Readers
|
|
# Readers
|
|
|
|
|
|
The writer parent class takes information from a **ROS** topic and writes it to the HV Robot.
|
|
The Reader parent class takes information from the HV Robot and writes it to a **ROS** topic.
|
|
|
|
|
|
Writer classes subscribe to a topic, the data is taken and formatted as a message paired with a [probe](probes) that is saved to a array in the object. while the code is running, at the set interval (default 100hz) all the messages from all the probes are taken and sent to the robot. This means that the messages are always sent in a single data packet and no faster than the speed that the ros node is looping.
|
|
The Reader classes publish data to a topic, each class only publishes to a single topic.
|
|
|
|
|
|
## Creating A Writer
|
|
Reader classes subscribe to a topic, the data is taken and formatted as a message paired with a [probe](probes) that is saved to a array in the object. while the code is running, at the set interval (default 100hz) all the messages from all the probes are taken and sent to the robot. This means that the messages are always sent in a single data packet and no faster than the speed that the ros node is looping.
|
|
|
|
|
|
|
|
## Creating A Reader
|
|
|
|
|
|
|
|
Reader child classes are put in the `Sensors` directory and the classes that are in that directory should be used as refrence when creating a new sensor service.
|
|
|
|
|
|
### Creating the class
|
|
### Creating the class
|
|
To create a new function to send data to the HV Robot, the Writer class must be extended. the child class needs to have a `__init__()` function where the *subscriber* is defined and the probe name is passed to the parent constructor; and a `callback` function where the data is formatted to be passed to the robot over the probes.
|
|
To create a new function to send data to the HV Robot, the Writer class must be extended. the child class needs to have a `__init__()` function where the *subscriber* is defined and the probe name is passed to the parent constructor; and a `callback` function where the data is formatted to be passed to the robot over the probes.
|
... | | ... | |