File tree 2 files changed +29
-13
lines changed
src/devices/controlBoardCouplingHandler
2 files changed +29
-13
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ bool ControlBoardCouplingHandler::open(Searchable& config)
47
47
return false ;
48
48
}
49
49
50
- this -> setNrOfControlledAxes (m_axesNames. size () );
50
+ configureBuffers ( );
51
51
52
52
Property prop;
53
53
prop.fromString (config.toString ());
@@ -85,6 +85,28 @@ struct axisLocation
85
85
int indexInSubDevice;
86
86
};
87
87
88
+ void ControlBoardCouplingHandler::configureBuffers () {
89
+ if (!iJntCoupling) {
90
+ yCError (CONTROLBOARDCOUPLINGHANDLER) << " IJointCoupling interface not available" ;
91
+ return ;
92
+ }
93
+ size_t nrOfPhysicalJoints;
94
+ size_t nrOfActuatedAxes;
95
+ auto ok = iJntCoupling->getNrOfPhysicalJoints (nrOfPhysicalJoints);
96
+ ok = ok && iJntCoupling->getNrOfActuatedAxes (nrOfActuatedAxes);
97
+ if (!ok)
98
+ {
99
+ yCError (CONTROLBOARDCOUPLINGHANDLER) << " Error in getting the number of physical joints or actuated axes" ;
100
+ return ;
101
+ }
102
+ physJointsPos.resize (nrOfPhysicalJoints);
103
+ physJointsVel.resize (nrOfPhysicalJoints);
104
+ physJointsAcc.resize (nrOfPhysicalJoints);
105
+ actAxesPos.resize (nrOfActuatedAxes);
106
+ actAxesVel.resize (nrOfActuatedAxes);
107
+ actAxesAcc.resize (nrOfActuatedAxes);
108
+ return ;
109
+ }
88
110
89
111
bool ControlBoardCouplingHandler::attachAllUsingAxesNames (const PolyDriverList& polylist)
90
112
{
@@ -198,9 +220,6 @@ bool ControlBoardCouplingHandler::detachAll()
198
220
return true ;
199
221
}
200
222
201
- void ControlBoardCouplingHandler::configureBuffers ()
202
- {
203
- }
204
223
205
224
// ////////////////////////////////////////////////////////////////////////////
206
225
// / ControlBoard methods
Original file line number Diff line number Diff line change @@ -40,22 +40,19 @@ class ControlBoardCouplingHandler :
40
40
yarp::dev::IAxisInfo *info;
41
41
yarp::dev::IJointCoupling *iJntCoupling;
42
42
43
- std::vector<std::string> axesNames;
43
+ yarp::sig::Vector physJointsPos;
44
+ yarp::sig::Vector physJointsVel;
45
+ yarp::sig::Vector physJointsAcc;
46
+ yarp::sig::Vector actAxesPos;
47
+ yarp::sig::Vector actAxesVel;
48
+ yarp::sig::Vector actAxesAcc;
44
49
45
50
/* * Verbosity of the class */
46
51
bool _verb{false };
47
52
48
53
// to open ports and print more detailed debug messages
49
54
std::string partName;
50
55
51
- /* *
52
- * Set the number of controlled axes, resizing appropriately
53
- * all the necessary buffers.
54
- */
55
- void setNrOfControlledAxes (const size_t nrOfControlledAxes);
56
-
57
- // TODO I am keeping it just for compiling, but it should be removed
58
-
59
56
/* *
60
57
* Configure buffers used by the device
61
58
*/
You can’t perform that action at this time.
0 commit comments