forked from robotology/whole-body-controllers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rotationDerivativeFromAngVel.m
37 lines (34 loc) · 1.51 KB
/
rotationDerivativeFromAngVel.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
function RDot = rotationDerivativeFromAngVel(omega,R)
% ROTATIONDERIVATIVEFROMANGVEL computes the derivative of a rotation matrix
% given the angular velocity. It makes use of
% the following convention: if the rotation of
% a body b is expressed in the WORLD FRAME w
% (i.e., R = w_R_b), then this function is
% expecting the angular velocity of the body
% to be expressed in the WORLD FRAME, i.e.
% omega = w_omega.
%
% USAGE: please note that this function has been designed for being inserted
% in a Simulink model.
%
% FORMAT: RDot = rotationDerivativeFromAngVel(omega,R)
%
% INPUT: - omega = [3 * 1] angular velocity
% - R = [3 * 3] rotation matrix
%
% OUTPUT: - RDot = [3 * 3] rotation matrix derivative
%
% Authors: Daniele Pucci, Marie Charbonneau, Gabriele Nava
%
% all authors are with the Italian Istitute of Technology (IIT)
% email: name.surname@iit.it
%
% Genoa, Dec 2017
%
%% --- Initialization ---
% Rotation matrix derivative (with correction to keep the integration
% inside the space of rotation matrices). Omega is assumed to be w.r.t.
% the inertial frame, i.e. w_omega.
kCorr = 1;
RDot = wbc.skew(omega)*R +kCorr*(eye(3)-R*transpose(R))*R;
end