YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
robotDriver.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
10#include <yarp/dev/PolyDriver.h>
11
12#include <string>
13#include <vector>
14
15#ifndef ROBOTDRIVER_H
16#define ROBOTDRIVER_H
17
18// ******************** ROBOT DRIVER CLASS
20{
21 friend class BroadcastingThread;
22private:
23 size_t n_joints=0;
24 bool m_verbose=true;
25 std::vector<double> m_trajectoryTime; // default trajectory time in seconds
26 std::vector<double> m_stored_speed; // joint ref speed
27
28 yarp::dev::PolyDriver *drv_ll=nullptr;
29 yarp::dev::IPositionControl *ipos_ll=nullptr;
30 yarp::dev::IPositionDirect *iposdir_ll=nullptr;
31 yarp::dev::IPidControl *ipid_ll=nullptr;
32 yarp::dev::IControlMode *icmd_ll=nullptr;
33 yarp::dev::IEncoders *ienc_ll=nullptr;
34 yarp::dev::IMotorEncoders *imotenc_ll=nullptr;
35
36public:
39 bool init();
41 size_t getNJoints();
42 bool getControlMode(const int j, yarp::dev::ControlModeEnum& mode);
43 bool setControlMode(const int j, const yarp::dev::SelectableControlModeEnum mode);
44 bool setPosition(int j, double ref);
45 bool getEncoder(int j, double *v);
46 bool positionMove(int j, double ref);
47 bool setTrajectoryTime(double t);
48 bool setTrajectoryTime(int j, double t);
49
50 bool storeRefVelocities();
51 bool loadRefVelocities();
52};
53
54#endif
define control board standard interfaces
bool setTrajectoryTime(double t)
bool loadRefVelocities()
bool setPosition(int j, double ref)
bool configure(yarp::dev::PolyDriver *pd)
bool setControlMode(const int j, const yarp::dev::SelectableControlModeEnum mode)
size_t getNJoints()
bool getEncoder(int j, double *v)
bool storeRefVelocities()
bool getControlMode(const int j, yarp::dev::ControlModeEnum &mode)
bool positionMove(int j, double ref)
Interface for setting control mode in control board.
Control board, encoder interface.
Definition IEncoders.h:117
Control board, encoder interface.
Interface for a generic control board device implementing a PID controller, with scaled arguments.
Interface for a generic control board device implementing position control.
Interface for a generic control board device implementing position control.
A container for a device driver.
Definition PolyDriver.h:23
SelectableControlModeEnum