1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 """The classes implemented in the joint group.
23 Currently, the only available class is
24 L{BindingsHingeJoint<mbdyn.bindings.joints.BindingsHingeJoint>},
25 that allows to set an angle value at each time step.
26
27 All the classes are contained into L{JOINT_CLASS}, then used
28 by L{mbdyn.bindings.groups}.
29 """
30 import numpy as N
31 from mbdyn.bindings.elements import Joint
32
34 """The interface of the C{DriveHingeJoint} class.
35 Currently not implemented"""
36 pass
37
39 """A drive hinge joint on which the angle value
40 can be set at every time step"""
41
45
47 """Return the angle vector
48
49 @rtype: a Numpy array
50 @return: vector of size 3x1"""
51 return self.value.copy()
52
54 """Set the angle vector on the drive hinge joint.
55
56 @type array: a Numpy array
57 @param array: a vector of size 3x1"""
58 for idx in range(3):
59 self.value[idx] = array[idx]
60 self.c_inst.ThetaVec.set_value(idx, float(array[idx]))
61
62
63 JOINT_CLASS = {}
64
65 JOINT_CLASS["general"] = Joint
66 JOINT_CLASS["DriveHingeJoint"] = DriveHingeJoint
67 JOINT_CLASS["BindingsHingeJoint"] = BindingsHingeJoint
68