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>
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
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
34private:
35 std::string module_name;
36 action_class *actions=nullptr;
37 robotDriver *driver=nullptr;
39
40public:
41 BroadcastingThread(std::string module_name, robotDriver *p, action_class *a, double period = 0.001);
45 bool threadInit() override;
46 void run() override;
47};
48
49#endif
contains the definition of a Vector type
void attachActions(action_class *a)
void attachRobotDriver(robotDriver *p)
bool threadInit() override
Initialization method.
void run() override
Loop function.
A mini-server for performing network communication in the background.
An abstraction for a periodic thread.