Robot Control Interface
robot_control.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2016-2025 Leonardo Consoni <leonardojc@protonmail.com> //
4 // //
5 // This file is part of Robot Control Interface. //
6 // //
7 // Robot Control Interface is free software: you can redistribute it and/or modify //
8 // it under the terms of the GNU Lesser General Public License as published //
9 // by the Free Software Foundation, either version 3 of the License, or //
10 // (at your option) any later version. //
11 // //
12 // Robot Control Interface is distributed in the hope that it will be useful, //
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
15 // GNU Lesser General Public License for more details. //
16 // //
17 // You should have received a copy of the GNU Lesser General Public License //
18 // along with Robot Control Interface. If not, see <http://www.gnu.org/licenses/>. //
19 // //
21 
22 
28 
29 #ifndef ROBOT_CONTROL_H
30 #define ROBOT_CONTROL_H
31 
32 #include <math.h>
33 #ifndef M_PI
34 #define M_PI 3.14159
35 #endif
36 
37 #include "plugin_loader/loader_macros.h"
38 
41 {
48 };
49 
51 typedef struct DoFVariables
52 {
53  double position, velocity, force, acceleration, inertia, stiffness, damping;
54 }
56 
58 #define ROBOT_CONTROL_INTERFACE( Interface, INIT_FUNCTION ) \
59  INIT_FUNCTION( bool, Interface, InitController, const char* ) \
60  INIT_FUNCTION( void, Interface, EndController, void ) \
61  INIT_FUNCTION( size_t, Interface, GetJointsNumber, void ) \
62  INIT_FUNCTION( const char**, Interface, GetJointNamesList, void ) \
63  INIT_FUNCTION( size_t, Interface, GetAxesNumber, void ) \
64  INIT_FUNCTION( const char**, Interface, GetAxisNamesList, void ) \
65  INIT_FUNCTION( void, Interface, SetControlState, enum ControlState ) \
66  INIT_FUNCTION( void, Interface, RunControlStep, DoFVariables**, DoFVariables**, DoFVariables**, DoFVariables**, double ) \
67  INIT_FUNCTION( size_t, Interface, GetExtraInputsNumber, void ) \
68  INIT_FUNCTION( void, Interface, SetExtraInputsList, double* ) \
69  INIT_FUNCTION( size_t, Interface, GetExtraOutputsNumber, void ) \
70  INIT_FUNCTION( void, Interface, GetExtraOutputsList, double* )
71 
72 #endif // ROBOT_CONTROL_H
73 
74 
CONTROL_OFFSET
@ CONTROL_OFFSET
State for definition of reference (zero) for controller measurements.
Definition: robot_control.h:43
DoFVariables
Control used variables list indexes enumeration.
Definition: robot_control.h:51
CONTROL_STATES_NUMBER
@ CONTROL_STATES_NUMBER
Total number of control states.
Definition: robot_control.h:47
ControlState
ControlState
Defined possible control states enumeration. Passed to generic or plugin specific robot control imple...
Definition: robot_control.h:40
CONTROL_PREPROCESSING
@ CONTROL_PREPROCESSING
State for custom automatic preprocessing of controller parameters.
Definition: robot_control.h:45
DoFVariables
struct DoFVariables DoFVariables
Control used variables list indexes enumeration.
CONTROL_PASSIVE
@ CONTROL_PASSIVE
State for fully compliant robot control/behaviour.
Definition: robot_control.h:42
CONTROL_CALIBRATION
@ CONTROL_CALIBRATION
State for definition of limits (min-max) for controller measurements.
Definition: robot_control.h:44
CONTROL_OPERATION
@ CONTROL_OPERATION
State for normal controller operation.
Definition: robot_control.h:46