36 from numpy
import concatenate
37 from numpy
import zeros, cumsum, matrix, array
41 Given a list of matricies. Combine into a larger, block diagonal matrix. This really should 46 assert(m.shape[0] == m.shape[1])
47 m_sizes = [m.shape[0]
for m
in m_list ]
48 end_ind = list(cumsum(m_sizes))
49 start_ind = [0] + end_ind[0:-1]
50 result = zeros( [end_ind[-1], end_ind[-1] ] )
51 for first, last, m
in zip(start_ind, end_ind, m_list):
52 result[first:last, first:last] = m
57 Provides helper methods for dealing with all the sensor measurements 58 generated from a single RobotMeasurement/CbPose pair 68 sensor_type =
'tilting_lasers' 69 if sensor_type
in self._sensor_configs.keys():
71 cur_sensors = cur_bundler.build_blocks(msg)
72 sensors.extend(cur_sensors)
74 print "[%s] section doesn't exist. Skipping" % sensor_type
76 sensor_type =
'chains' 77 if sensor_type
in self._sensor_configs.keys():
79 cur_sensors = cur_bundler.build_blocks(msg)
80 sensors.extend(cur_sensors)
82 print "[%s] section doesn't exist. Skipping" % sensor_type
84 sensor_type =
'rectified_cams' 85 if sensor_type
in self._sensor_configs.keys():
87 cur_sensors = cur_bundler.build_blocks(msg)
88 sensors.extend(cur_sensors)
90 print "[%s] section doesn't exist. Skipping" % sensor_type
98 sensor.update_config(robot_params)
101 r_list = [sensor.compute_residual(target_pts)
for sensor
in self.
sensors]
105 r = concatenate(r_list,0)
109 r_list = [sensor.compute_residual_scaled(target_pts)
for sensor
in self.
sensors]
113 r = concatenate(r_list,0)
117 gamma_sqrt_list = [sensor.compute_marginal_gamma_sqrt(target_pts)
for sensor
in self.
sensors]
118 if len(gamma_sqrt_list) == 0:
124 return sum([sensor.get_residual_length()
for sensor
in self.
sensors])
def get_residual_length(self)
def compute_marginal_gamma_sqrt(self, target_pts)
def compute_residual(self, target_pts)
def update_config(self, robot_params)
def compute_residual_scaled(self, target_pts)
def sensors_from_message(self, msg)
def __init__(self, sensor_configs)