yarp-devices
Loading...
Searching...
No Matches
JointCalibrator.hpp
1// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2
3#ifndef __JOINT_CALIBRATOR_HPP__
4#define __JOINT_CALIBRATOR_HPP__
5
6#include <vector>
7
8#include <yarp/conf/version.h>
9
10#include <yarp/dev/CalibratorInterfaces.h>
11#include <yarp/dev/DeviceDriver.h>
12#include <yarp/dev/IControlMode.h>
13#include <yarp/dev/IEncoders.h>
14#include <yarp/dev/IPositionControl.h>
15#include <yarp/dev/WrapperSingle.h>
16
17#include "JointCalibrator_ParamsParser.h"
18
30{
31 std::vector<double> pos;
32 std::vector<double> vel;
33 std::vector<double> acc;
34};
35
40class JointCalibrator : public yarp::dev::DeviceDriver,
41 public yarp::dev::IRemoteCalibrator,
42 public yarp::dev::WrapperSingle,
44{
45public:
46#if YARP_VERSION_COMPARE(>=, 4, 0, 0)
47 yarp::dev::ReturnValue calibrateSingleJoint(int j) override;
48 yarp::dev::ReturnValue calibrateWholePart() override;
49 yarp::dev::ReturnValue homingSingleJoint(int j) override;
50 yarp::dev::ReturnValue homingWholePart() override;
51 yarp::dev::ReturnValue parkSingleJoint(int j, bool wait) override;
52 yarp::dev::ReturnValue parkWholePart() override;
53 yarp::dev::ReturnValue quitCalibrate() override;
54 yarp::dev::ReturnValue quitPark() override;
55#else
56 bool calibrateSingleJoint(int j) override;
57 bool calibrateWholePart() override;
58 bool homingSingleJoint(int j) override;
59 bool homingWholePart() override;
60 bool parkSingleJoint(int j, bool wait) override;
61 bool parkWholePart() override;
62 bool quitCalibrate() override;
63 bool quitPark() override;
64#endif
65
66 bool attach(yarp::dev::PolyDriver * poly) override;
67 bool detach() override;
68
69 bool open(yarp::os::Searchable & config) override;
70 bool close() override;
71
72private:
73#if YARP_VERSION_COMPARE(>=, 4, 0, 0)
74 yarp::dev::ReturnValue move(const std::vector<int> & joints, const MovementSpecs & specs);
75#else
76 bool move(const std::vector<int> & joints, const MovementSpecs & specs);
77#endif
78
79 MovementSpecs homeSpecs;
80 MovementSpecs parkSpecs;
81
82 yarp::dev::IControlMode * iControlMode {nullptr};
83 yarp::dev::IEncoders * iEncoders {nullptr};
84 yarp::dev::IPositionControl * iPositionControl {nullptr};
85};
86
87#endif // __JOINT_CALIBRATOR_HPP__
Definition JointCalibrator_ParamsParser.h:55
Remote calibrator class for multi-joint homing and park.
Definition JointCalibrator.hpp:44
Stores movement specifications: position, velocity, acceleration.
Definition JointCalibrator.hpp:30