-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJacobian.m
33 lines (27 loc) · 996 Bytes
/
Jacobian.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
classdef Jacobian < handle
%UNTITLED4 Summary of this class goes here
% Detailed explanation goes here
properties
% jacobianis always symbolic in term of q
Linear
Angular
Total
q % independent variable q for symbolic differentiation
end
methods
function obj = Jacobian(J_v,J_w,q)
obj.Linear = J_v;
obj.Angular = J_w;
obj.Total = [J_v ; J_w];
obj.q = q;
end
function numeric_jacobian = eval(obj,q_value)
% evaluate jacobian at given configuration
% q_value must have same dimension with obj.q
[m,n] = size(obj.q);
numeric_jacobian.Linear = subs(obj.Linear,q,reshape(q_value,m,n));
numeric_jacobian.Angular = subs(obj.Angular,q,reshape(q_value,m,n));
numeric_jacobian.Total = [numeric_jacobian.Linear;numeric_jacobian.Total];
end
end
end