-
Notifications
You must be signed in to change notification settings - Fork 68
/
setFrameVelocityRepresentation.m
54 lines (42 loc) · 1.7 KB
/
setFrameVelocityRepresentation.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
function [] = setFrameVelocityRepresentation(KinDynModel,frameVelRepr)
% SETFRAMEVELOCITYREPRESENTATION sets the frame velocity representation.
%
% This matlab function wraps a functionality of the iDyntree library.
% For further info see also: https://github.com/robotology/idyntree
%
% FORMAT: [] = setFrameVelocityRepresentation(KinDynModel,frameVelRepr)
%
% INPUTS: - frameVelRepr: a string with one of the following values:
% 'mixed', 'body', 'inertial';
% - KinDynModel: a structure containing the loaded model and additional info.
%
% Mapping for the frame velocity reperesentation
%
% 0 = INERTIAL_FIXED_REPRESENTATION
%
% 1 = BODY_FIXED_REPRESENTATION
%
% 2 = MIXED_REPRESENTATION
%
% Author : Gabriele Nava ([email protected])
%
% SPDX-FileCopyrightText: Fondazione Istituto Italiano di Tecnologia (IIT)
% SPDX-License-Identifier: BSD-3-Clause
%% ------------Initialization----------------
switch frameVelRepr
case 'mixed'
frameVelRepr_idyntree = iDynTree.MIXED_REPRESENTATION;
case 'body'
frameVelRepr_idyntree = iDynTree.BODY_FIXED_REPRESENTATION;
case 'inertial'
frameVelRepr_idyntree = iDynTree.INERTIAL_FIXED_REPRESENTATION;
otherwise
error('[setFrameVelocityRepresentation]: frameVelRepr is not a valid string.')
end
% set the desired frameVelRepr
ack = KinDynModel.kinDynComp.setFrameVelocityRepresentation(frameVelRepr_idyntree);
% check for errors
if ~ack
error('[setFrameVelocityRepresentation]: unable to set the frame velocity representation.')
end
end