8 from dynamic_graph.sot.core.op_point_modifier
import OpPointModifier
13 (1.0, 0.0, 0.0, 0.025),
15 (0.0, 0.0, 1.0, 0.648),
24 (1.0, 0.0, 0.0, 0.0, 0.648, 0.0),
25 (0.0, 1.0, 0.0, -0.648, 0.0, 0.025),
26 (0.0, 0.0, 1.0, 0.0, -0.025, 0.0),
27 (0.0, 0.0, 0.0, 1.0, 0.0, 0.0),
28 (0.0, 0.0, 0.0, 0.0, 1.0, 0.0),
29 (0.0, 0.0, 0.0, 0.0, 0.0, 1.0),
45 (1.0, 0.0, 0.0, 0.0, 0.0, 0.0),
46 (0.0, 1.0, 0.0, 0.0, 0.0, 0.0),
47 (0.0, 0.0, 1.0, 0.0, 0.0, 0.0),
48 (0.0, 0.0, 0.0, 1.0, 0.0, 0.0),
49 (0.0, 0.0, 0.0, 0.0, 1.0, 0.0),
50 (0.0, 0.0, 0.0, 0.0, 0.0, 1.0),
57 op = OpPointModifier(
"op")
58 op.setTransformation(I4)
59 op.positionIN.value = I4
60 op.jacobianIN.value = I6
61 op.position.recompute(0)
62 op.jacobian.recompute(0)
64 self.assertTrue((op.getTransformation() == I4).all())
65 self.assertTrue((op.position.value == I4).all())
66 self.assertTrue((op.jacobian.value == I6).all())
82 op = OpPointModifier(
"op2")
83 op.setTransformation(T)
84 op.positionIN.value = gaze
85 op.jacobianIN.value = Jgaze
86 op.position.recompute(1)
87 op.jacobian.recompute(1)
89 self.assertTrue((op.getTransformation() == T).all())
94 w_M_s_ref = w_M_g.dot(g_M_s)
95 w_M_s = op.position.value
98 self.assertTrue((w_M_s == w_M_s_ref).all())
102 [1.0, 0.0, 0.0, 0.0, tz, -ty],
103 [0.0, 1.0, 0.0, -tz, 0.0, tx],
104 [0.0, 0.0, 1.0, ty, -tx, 0.0],
105 [0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
106 [0.0, 0.0, 0.0, 0.0, 1.0, 0.0],
107 [0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
111 J = op.jacobian.value
112 J_ref = twist.dot(Jgaze)
115 self.assertTrue((J == J_ref).all())
120 (0.0, 0.0, 1.0, 0.0),
121 (0.0, -1.0, 0.0, 0.0),
122 (1.0, 0.0, 0.0, 0.0),
123 (0.0, 0.0, 0.0, 1.0),
127 op = OpPointModifier(
"op3")
128 op.setTransformation(T)
129 op.positionIN.value = gaze
130 op.jacobianIN.value = Jgaze
131 op.position.recompute(1)
132 op.jacobian.recompute(1)
134 self.assertTrue((op.getTransformation() == T).all())
139 w_M_s_ref = w_M_g.dot(g_M_s)
140 w_M_s = op.position.value
143 self.assertTrue((w_M_s == w_M_s_ref).all())
147 [0.0, 0.0, 1.0, 0.0, 0.0, 0.0],
148 [0.0, -1.0, 0.0, 0.0, 0.0, 0.0],
149 [1.0, 0.0, 0.0, 0.0, 0.0, 0.0],
150 [0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
151 [0.0, 0.0, 0.0, 0.0, -1.0, 0.0],
152 [0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
156 J = op.jacobian.value
157 J_ref = twist.dot(Jgaze)
160 self.assertTrue((J == J_ref).all())
170 (0.0, -1.0, 0.0, ty),
172 (0.0, 0.0, 0.0, 1.0),
176 op = OpPointModifier(
"op4")
177 op.setTransformation(T)
178 op.positionIN.value = gaze
179 op.jacobianIN.value = Jgaze
180 op.position.recompute(1)
181 op.jacobian.recompute(1)
183 self.assertTrue((op.getTransformation() == T).all())
188 w_M_s_ref = w_M_g.dot(g_M_s)
189 w_M_s = op.position.value
192 self.assertTrue((w_M_s == w_M_s_ref).all())
196 [0.0, 0.0, 1.0, ty, -tx, 0.0],
197 [0.0, -1.0, 0.0, tz, 0.0, -tx],
198 [1.0, 0.0, 0.0, 0.0, tz, -ty],
199 [0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
200 [0.0, 0.0, 0.0, 0.0, -1.0, 0.0],
201 [0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
205 J = op.jacobian.value
206 J_ref = twist.dot(Jgaze)
209 self.assertTrue((J == J_ref).all())
212 if __name__ ==
"__main__":
def test_translation(self)
def test_rotation_translation(self)