-
Notifications
You must be signed in to change notification settings - Fork 68
/
getJointVel.m
31 lines (26 loc) · 1.07 KB
/
getJointVel.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function jointVel = getJointVel(KinDynModel)
% GETJOINTVEL retrieves joint velocities from the reduced model.
%
% This matlab function wraps a functionality of the iDyntree library.
% For further info see also: https://github.com/robotology/idyntree
%
% FORMAT: jointVel = getJointVel(KinDynModel)
%
% INPUTS: - KinDynModel: a structure containing the loaded model and additional info.
%
% OUTPUTS: - jointVel: [ndof x 1] vector of joint velocities.
%
% Author : Gabriele Nava ([email protected])
%
% SPDX-FileCopyrightText: Fondazione Istituto Italiano di Tecnologia (IIT)
% SPDX-License-Identifier: BSD-3-Clause
%% ------------Initialization----------------
% get the joints velocities
ack = KinDynModel.kinDynComp.getJointVel(KinDynModel.kinematics.jointVel_iDyntree);
% check for errors
if ~ack
error('[getJointVel]: unable to retrieve the joint velocities from the reduced model.')
end
% convert to Matlab format
jointVel = KinDynModel.kinematics.jointVel_iDyntree.toMatlab;
end