16 import numpy, math, general_python
as genpy
35 self.
error = pose_metric.Metric()
58 refernce point only for introducing an endeffector position
60 reference_position == Reference Position + Target Point for this reference position + actual position for this point
62 "reference_position" is a class or data structure containing properties by which a point in the task space of a chained link manipulator is defined.
64 TASK POSITION is RELATIVE to the "FRAME" of the link,
65 the "FRAME" of the link is determined via DH parameters and the zero configuration
68 def __init__(self, config_settings, link_point_list):
70 link_point_list == WEIGHTING
72 Create and define the default values for class properties
74 super(Task_Point, self).
__init__(config_settings)
77 self.
lp = link_point_list
78 self.
error = pose_metric.Position_Metric()
81 s =
" Actual Position (mm): " + vecmat.vector_to_str(1000*(self.
ra)) +
"\n"
82 s +=
" Desired Position (mm): " + vecmat.vector_to_str(1000*(self.
rd)) +
"\n"
83 s +=
" Position Error (mm): " + vecmat.vector_to_str(1000*(self.error.value(self.
ra, self.
rd))) +
"\n"
88 self.
ra = numpy.zeros((3))
89 for j
in range(0, len(self.
lp)):
90 x = numpy.dot(H[self.
lp[j].ln], vecmat.extend_vector(self.
lp[j].pv))
91 self.
ra = self.
ra + self.
lp[j].w * x[0:3]
95 if self.err_jac.value ==
None:
96 self.err_jac.update_for_position(self, ajac)
97 return self.err_jac.value
100 if self.geo_jac.value ==
None:
101 self.geo_jac.update_for_position(self, ajac)
102 return self.geo_jac.value
106 old name: Task_Frame :
108 ## link_number is NOT part of this class / element but of the SET that holds / manages these classes/elements!
109 ## -> link_number DOES NOT determine the NATURE of a Reference_Orientation
111 This class is used to introduce a reference orientation for the endeffector. The reference orientation is the orientation of link which is specified by: "link_number"
116 super(Task_Frame, self).
__init__(config_settings)
118 self.
ln = link_number
120 self.
error = pose_metric.Orientation_Metric()
123 s =
" Actual Orientation :" +
"\n" +
"\n" + str(self.
ra) +
"\n"
124 s +=
" Desired Orientation:" +
"\n" +
"\n" + str(self.
rd) +
"\n"
125 s +=
" Orientation Error : " + vecmat.vector_to_str(self.error.value(self.
ra,self.
rd)) +
"\n"
130 update the actual (current) orientation of the reference orientation. Change property "ra"
134 self.
ra = geo.Orientation_3D(H[self.
ln][ 0:3, 0:3 ])
138 if self.err_jac.value ==
None:
139 self.err_jac.update_for_orientation(self, ajac)
140 return self.err_jac.value
143 if self.geo_jac.value ==
None:
144 self.geo_jac.update_for_orientation(self, H)
145 return self.geo_jac.value