utils.py
Go to the documentation of this file.
1 import numpy as np
2 
3 
5  # TODO
6  pass
7 
8 
9 def parse_translation(p_translation: str, p_cloud_dim: int):
10  parsed_translation = np.identity(p_cloud_dim + 1)
11 
12  p_translation = p_translation.replace(',', ' ')
13 
14  translation_values = np.fromiter(p_translation.split(' '), np.float)
15 
16  for i, v in enumerate(translation_values):
17  parsed_translation[i, p_cloud_dim] = v
18 
19  return parsed_translation
20 
21 
22 def parse_rotation(p_rotation: str, p_cloud_dim: int):
23  parsed_rotation = np.identity(p_cloud_dim + 1)
24 
25  p_rotation = p_rotation.replace(',', ' ')
26  p_rotation = p_rotation.replace(';', ' ')
27 
28  rotation_matrix = np.fromiter(p_rotation.split(' '), np.float)
29 
30  for i, v in enumerate(rotation_matrix):
31  parsed_rotation[i // p_cloud_dim, i % p_cloud_dim] = v
32 
33  return parsed_rotation
def list_modules()
Definition: utils.py:4
def parse_rotation
Definition: utils.py:22
def parse_translation
Definition: utils.py:9


libpointmatcher
Author(s):
autogenerated on Sat May 27 2023 02:38:03