YARP
Yet Another Robot Platform
IControlCalibration.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_DEV_ICONTROLCALIBRATION_H
11 #define YARP_DEV_ICONTROLCALIBRATION_H
12 
13 #include <yarp/os/Vocab.h>
14 #include <yarp/dev/api.h>
15 #include <yarp/dev/CalibratorInterfaces.h> // ICalibrator
16 
17 namespace yarp {
18  namespace dev {
19  class IControlCalibrationRaw;
20 #ifndef YARP_NO_DEPRECATED // Since YARP 3.0.0
21 YARP_DEPRECATED_TYPEDEF_MSG("Use yarp::dev::IControlCalibrationRaw instead") IControlCalibrationRaw IControlCalibration2Raw;
22 #endif
23  class IControlCalibration;
24 #ifndef YARP_NO_DEPRECATED // Since YARP 3.0.0
25 YARP_DEPRECATED_TYPEDEF_MSG("Use yarp::dev::IControlCalibration instead") IControlCalibration IControlCalibration2;
26 #endif
27  struct CalibrationParameters;
28  }
29 }
30 
32 {
33  unsigned int type;
34  double param1;
35  double param2;
36  double param3;
37  double param4;
38  double param5;
39  double paramZero;
40  CalibrationParameters() { type = 0; param1 = 0; param2 = 0; param3 = 0; param4 = 0; param5 = 0; paramZero = 0; }
41 };
42 
48 {
49 public:
55 
61  virtual bool calibrationDoneRaw(int j)=0;
62 
68  virtual bool calibrateAxisWithParamsRaw(int axis, unsigned int type, double p1, double p2, double p3)=0;
69 
75  virtual bool setCalibrationParametersRaw(int axis, const CalibrationParameters& params) { return false; }
76 
77 };
78 
85 {
86 private:
87  ICalibrator *calibrator;
88 
89 public:
94  virtual ~IControlCalibration() {}
95 
101  virtual bool calibrateAxisWithParams(int axis, unsigned int type, double p1, double p2, double p3)=0;
102 
108  virtual bool setCalibrationParameters(int axis, const CalibrationParameters& params) { return false; }
109 
115  virtual bool calibrationDone(int j)=0;
116 
122  virtual bool setCalibrator(ICalibrator *c);
123 
130  virtual bool calibrateRobot();
131 
132  virtual bool park(bool wait=true);
133 
134  /* Abort calibration, force the function calibrate() to return.*/
135  virtual bool abortCalibration();
136 
137  /* Abort parking, force the function park() to return.*/
138  virtual bool abortPark();
139 };
140 
141 
142 /* Vocabs representing the above interfaces */
143 
152 
153 #endif // YARP_DEV_ICONTROLCALIBRATION_H
CalibratorInterfaces.h
yarp::os::createVocab
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
Definition: Vocab.h:22
yarp::dev::CalibrationParameters::CalibrationParameters
CalibrationParameters()
Definition: IControlCalibration.h:40
yarp::dev::CalibrationParameters::param5
double param5
Definition: IControlCalibration.h:38
VOCAB_CALIBRATE_JOINT_PARAMS
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_JOINT_PARAMS
Definition: IControlCalibration.h:145
yarp::dev::CalibrationParameters::param3
double param3
Definition: IControlCalibration.h:36
yarp::dev::CalibrationParameters::param1
double param1
Definition: IControlCalibration.h:34
yarp::dev::IControlCalibration::calibrateRobot
virtual bool calibrateRobot()
Calibrate robot by using an external calibrator.
Definition: ImplementControlCalibration.cpp:35
yarp::dev::CalibrationParameters::paramZero
double paramZero
Definition: IControlCalibration.h:39
yarp::dev::IControlCalibrationRaw
Interface for control devices, calibration commands.
Definition: IControlCalibration.h:48
yarp::dev::IControlCalibration::~IControlCalibration
virtual ~IControlCalibration()
Destructor.
Definition: IControlCalibration.h:94
VOCAB_PARK
constexpr yarp::conf::vocab32_t VOCAB_PARK
Definition: IControlCalibration.h:151
yarp::dev::IControlCalibrationRaw::setCalibrationParametersRaw
virtual bool setCalibrationParametersRaw(int axis, const CalibrationParameters &params)
Start calibration, this method is very often platform specific.
Definition: IControlCalibration.h:75
VOCAB_CALIBRATE_DONE
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_DONE
Definition: IControlCalibration.h:150
yarp::dev::IControlCalibration
Interface for control devices, calibration commands.
Definition: IControlCalibration.h:85
yarp::dev::IControlCalibration::IControlCalibration
IControlCalibration()
Definition: ImplementControlCalibration.cpp:19
yarp::dev::IControlCalibration::setCalibrationParameters
virtual bool setCalibrationParameters(int axis, const CalibrationParameters &params)
Start calibration, this method is very often platform specific.
Definition: IControlCalibration.h:108
VOCAB_ABORTCALIB
constexpr yarp::conf::vocab32_t VOCAB_ABORTCALIB
Definition: IControlCalibration.h:148
yarp::dev::IControlCalibrationRaw::calibrateAxisWithParamsRaw
virtual bool calibrateAxisWithParamsRaw(int axis, unsigned int type, double p1, double p2, double p3)=0
Start calibration, this method is very often platform specific.
yarp::dev::ICalibrator
Definition: ICalibrator.h:19
yarp::dev::IControlCalibration::setCalibrator
virtual bool setCalibrator(ICalibrator *c)
Set the calibrator object to be used to calibrate the robot.
Definition: ImplementControlCalibration.cpp:24
yarp::dev::CalibrationParameters::type
unsigned int type
Definition: IControlCalibration.h:33
yarp::dev::IControlCalibration::calibrateAxisWithParams
virtual bool calibrateAxisWithParams(int axis, unsigned int type, double p1, double p2, double p3)=0
Start calibration, this method is very often platform specific.
yarp::dev::CalibrationParameters::param4
double param4
Definition: IControlCalibration.h:37
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::IControlCalibration::calibrationDone
virtual bool calibrationDone(int j)=0
Check if the calibration is terminated, on a particular joint.
yarp::dev::IControlCalibration::abortPark
virtual bool abortPark()
Definition: ImplementControlCalibration.cpp:57
yarp::dev::CalibrationParameters::param2
double param2
Definition: IControlCalibration.h:35
VOCAB_CALIBRATE_JOINT
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_JOINT
Definition: IControlCalibration.h:144
YARP_DEPRECATED_TYPEDEF_MSG
#define YARP_DEPRECATED_TYPEDEF_MSG(x)
Definition: api.h:102
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::conf::vocab32_t
std::int32_t vocab32_t
Definition: numeric.h:52
Vocab.h
yarp::dev::IControlCalibration::abortCalibration
virtual bool abortCalibration()
Definition: ImplementControlCalibration.cpp:49
yarp::dev::CalibrationParameters
Definition: IControlCalibration.h:32
yarp::dev::IControlCalibrationRaw::IControlCalibrationRaw
IControlCalibrationRaw()
Definition: IControlCalibration.h:50
api.h
yarp::dev::IControlCalibrationRaw::~IControlCalibrationRaw
virtual ~IControlCalibrationRaw()
Destructor.
Definition: IControlCalibration.h:54
yarp::dev::IControlCalibrationRaw::calibrationDoneRaw
virtual bool calibrationDoneRaw(int j)=0
Check if the calibration is terminated, on a particular joint.
VOCAB_CALIBRATE_CHANNEL
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_CHANNEL
Definition: IControlCalibration.h:147
VOCAB_CALIBRATE
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE
Definition: IControlCalibration.h:146
VOCAB_ABORTPARK
constexpr yarp::conf::vocab32_t VOCAB_ABORTPARK
Definition: IControlCalibration.h:149
yarp::dev::IControlCalibration::park
virtual bool park(bool wait=true)
Definition: ImplementControlCalibration.cpp:65