45 from numpy
import reshape, array, zeros, matrix, diag, real
47 import roslib; roslib.load_manifest(
'calibration_estimation')
60 if cur_config[
"sensor_id"]
in [ x.laser_id
for x
in M_robot.M_laser ] :
61 M_laser = [x
for x
in M_robot.M_laser
if cur_config[
"sensor_id"] == x.laser_id][0]
63 sensors.append(cur_sensor)
65 rospy.logdebug(
" Didn't find block")
84 assert(z_mat.shape[0] == 4)
85 assert(h_mat.shape[0] == 4)
86 assert(z_mat.shape[1] == z_mat.shape[1])
87 r = array(reshape(h_mat[0:3,:].T - z_mat[0:3,:].T, [-1,1]))[:,0]
93 r_scaled = gamma_sqrt * matrix(r).T
94 return array(r_scaled.T)[0]
100 gamma = matrix(zeros(cov.shape))
103 for k
in range(num_pts):
106 sub_cov = matrix(cov[first:last, first:last])
107 sub_gamma_sqrt_full = matrix(scipy.linalg.sqrtm(sub_cov.I))
108 sub_gamma_sqrt = real(sub_gamma_sqrt_full)
109 assert(scipy.linalg.norm(sub_gamma_sqrt_full - sub_gamma_sqrt) < 1e-6)
110 gamma[first:last, first:last] = sub_gamma_sqrt
122 return laser_pts_root
134 x = [copy.copy(x.position)
for x
in self.
_M_laser.joint_points]
136 f0 = reshape(array(self.
_tilting_laser.project_to_3D(x)[0:3,:].T), [-1])
138 x = [ [y
for y
in x.position]
for x
in self.
_M_laser.joint_points]
141 fTest = reshape(array(self.
_tilting_laser.project_to_3D(x)[0:3,:].T), [-1])
142 Jt[i] = (fTest - f0)/epsilon
148 cov_sensor = [x*x
for x
in std_dev_sensor]
150 cov = matrix(Jt).T * matrix(diag(cov_sensor)) * matrix(Jt)
162 sparsity[
'tilting_lasers'] = {}
163 sparsity[
'tilting_lasers'][self.
sensor_id] = {
'gearing':1}
164 sparsity[
'transforms'] = {}
167 sparsity[
'transforms'][cur_transform._name] = [1, 1, 1, 1, 1, 1]
168 sparsity[
'transforms'][self.
_tilting_laser._config[
'joint']] = [1, 1, 1, 1, 1, 1]