Skip to content

Commit

Permalink
fixed attribution error failed
Browse files Browse the repository at this point in the history
  • Loading branch information
ShisatoYano committed Dec 4, 2023
1 parent 13eda48 commit c6b06e5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/components/sensors/sensor_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,16 @@ def __init__(self, lon_m=0.0, lat_m=0.0, min_m=0.5, max_m=40, reso_deg=2.0,
self.global_x_m = None
self.global_y_m = None

self.est_inst_array = np.zeros((3, 1))
self.prev_sensor_tf = np.zeros((3, 3))
self.curr_sensor_tf = np.zeros((3, 3))
self.prev_vehicle_tf = np.zeros((3, 3))
self.curr_vehicle_tf = np.zeros((3, 3))
self.DIM_NUM = 3 # state vector[lon, lat, yaw]
self.ALPHA = 0.001
self.BETA = 2
self.KAPPA = 0
self.LAMBDA = self.ALPHA**2 * (self.DIM_NUM + self.KAPPA) - self.DIM_NUM
self.est_inst_array = np.zeros((self.DIM_NUM, 1))
self.prev_sensor_tf = np.zeros((self.DIM_NUM, self.DIM_NUM))
self.curr_sensor_tf = np.zeros((self.DIM_NUM, self.DIM_NUM))
self.prev_vehicle_tf = np.zeros((self.DIM_NUM, self.DIM_NUM))
self.curr_vehicle_tf = np.zeros((self.DIM_NUM, self.DIM_NUM))
self.first_sensor_pos = True
self.first_vehicle_pos = True

Expand Down Expand Up @@ -89,6 +94,7 @@ def _hom_mat(self, x, y, yaw):
def estimate_extrinsic_params(self, state):
# current vehicle pose
pose = state.x_y_yaw()

# sensor odometry between 2 steps
sensor_odom_glb_tf = np.linalg.inv(self.prev_sensor_tf) @ self.curr_sensor_tf
sensor_odom_lcl_tf = np.linalg.inv(self._hom_mat(0.0, 0.0, pose[2, 0])) @ sensor_odom_glb_tf
Expand Down
3 changes: 3 additions & 0 deletions test/test_omni_directional_lidar.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ def calculate_global_pos(self, state):
self.global_x_m = transformed_array.get_x_data()
self.global_y_m = transformed_array.get_y_data()

def estimate_extrinsic_params(self, state):
pass

def get_global_x_m(self):
return self.global_x_m[0]

Expand Down

0 comments on commit c6b06e5

Please sign in to comment.