YARP
Yet Another Robot Platform
Loading...
Searching...
No Matches
broadcastingThread.h
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2024 Istituto Italiano di Tecnologia (IIT)
3
* SPDX-License-Identifier: BSD-3-Clause
4
*/
5
6
#include <
yarp/os/Log.h
>
7
#include <
yarp/os/LogStream.h
>
8
#include <
yarp/os/BufferedPort.h
>
9
#include <
yarp/os/PeriodicThread.h
>
10
#include <
yarp/sig/Vector.h
>
11
12
#include <iostream>
13
#include <iomanip>
14
#include <string>
15
#include <vector>
16
#include <cmath>
17
#include <mutex>
18
19
#include "
robotDriver.h
"
20
#include "
robotAction.h
"
21
22
#ifndef BROADCASTING_THREAD
23
#define BROADCASTING_THREAD
24
25
// ******************** THE THREAD
26
class
BroadcastingThread
:
public
yarp::os::PeriodicThread
27
{
28
size_t
njoints=0;
29
std::vector<double> encs;
30
std::vector<double> outs;
31
std::vector<double> errs;
32
std::vector<double> mots;
33
34
private
:
35
std::string module_name;
36
action_class
*actions=
nullptr
;
37
robotDriver
*driver=
nullptr
;
38
yarp::os::BufferedPort<yarp::os::Bottle>
port_data_out;
39
40
public
:
41
BroadcastingThread
(std::string module_name,
robotDriver
*p,
action_class
*a,
double
period = 0.001);
42
~BroadcastingThread
();
43
void
attachRobotDriver
(
robotDriver
*p);
44
void
attachActions
(
action_class
*a);
45
bool
threadInit
()
override
;
46
void
run
()
override
;
47
};
48
49
#endif
BufferedPort.h
LogStream.h
Log.h
PeriodicThread.h
Vector.h
contains the definition of a Vector type
BroadcastingThread
Definition
broadcastingThread.h:27
BroadcastingThread::attachActions
void attachActions(action_class *a)
BroadcastingThread::attachRobotDriver
void attachRobotDriver(robotDriver *p)
BroadcastingThread::threadInit
bool threadInit() override
Initialization method.
Definition
broadcastingThread.cpp:33
BroadcastingThread::run
void run() override
Loop function.
Definition
broadcastingThread.cpp:59
BroadcastingThread::~BroadcastingThread
~BroadcastingThread()
Definition
broadcastingThread.cpp:27
action_class
Definition
robotAction.h:46
robotDriver
Definition
robotDriver.h:19
yarp::os::BufferedPort
A mini-server for performing network communication in the background.
Definition
BufferedPort.h:60
yarp::os::PeriodicThread
An abstraction for a periodic thread.
Definition
PeriodicThread.h:27
robotAction.h
robotDriver.h
YARP
3.11.100+20250603.4+gitaa77f8b5c
src
commands
yarpActionsPlayer
broadcastingThread.h
Generated on Wed Jun 4 2025 02:39:56 for YARP by
1.9.8