-
Notifications
You must be signed in to change notification settings - Fork 1
/
sim_spherical_joint.m
107 lines (60 loc) · 2.66 KB
/
sim_spherical_joint.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
%% sim_spherical_joint %%
%
% A class to handle spherical joints. For all other joint
% types see its parent class, sim_joint. Methods inherited from ‘sim_joint’ % that have no effect on spherical joints have been overloaded to simply
% throw an error message.
%
% Properties
%
% Methods:
%
% get_angle % Returns 3 vector containing euler angles
% representing the position of the joint in radians.
% set_angle % Sets the position of the joint to the euler angles
% given as a 3 vector.
%
classdef sim_spherical_joint < sim_joint
properties
end
methods
function obj = sim_spherical_joint(sim,ident)
obj = obj@sim_joint(sim,ident);
end
function pos = get_angle(obj)
pos = obj.sim.getJointMatrix(obj.id);
end
function set_angle(obj,new)
obj.sim.setJointMatrix(obj.id,new);
end
function force(obj)
error('sim_spherical_joint: Operation not valid for spherical joints');
end
function mode(obj)
error('sim_spherical_joint: Operation not valid for spherical joints');
end
function set_angl(obj,new)
obj.sim.setJointPosition(obj.id,new);
end
function set_force(obj,new)
error('sim_spherical_joint: Operation not valid for spherical joints');
end
function set_tgt_vel(obj,vel)
error('sim_spherical_joint: Operation not valid for spherical joints');
end
function set_tgt_pos(obj,pos)
error('sim_spherical_joint: Operation not valid for spherical joints');
end
function enable_motor(obj)
error('sim_spherical_joint: Operation not valid for spherical joints');
end
function enable_control(obj)
error('sim_spherical_joint: Operation not valid for spherical joints');
end
function disable_motor(obj)
error('sim_spherical_joint: Operation not valid for spherical joints');
end
function disable_control(obj)
error('sim_spherical_joint: Operation not valid for spherical joints');
end
end
end