Conversation
| RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F42ED6FBAB17C654 | ||
|
|
||
| # Install livox_ros_driver2 for Livox LiDAR support | ||
| RUN apt-get update && apt-get install -y git build-essential \ |
There was a problem hiding this comment.
Добавь после установки зависимостей rm -rf /var/lib/apt/lists/*
|
|
||
| numpy==1.23.5 | ||
| scipy==1.9.3 | ||
| scikit-learn>=0.23.0 |
There was a problem hiding this comment.
Стоит указать точную версию
| self.ransac_max_iterations = 1_000_000 # Reduced for 30% speedup | ||
| self.ransac_confidence = 200 # Reduced for early stopping |
There was a problem hiding this comment.
Немного запутывает название self.ransac_confidence, confidence это больше про вероятность. Тут судя по документации более уместно max_validation. Также лучше вынести эти параметры в конструктор класса.
| """Return current RANSAC parameters.""" | ||
| return { | ||
| "max_iterations": self.ransac_max_iterations, | ||
| "confidence": self.ransac_confidence, |
There was a problem hiding this comment.
Поменяй слово confidence здесь
| Returns: | ||
| Transformed trajectory with same format. | ||
| """ | ||
| from scipy.spatial.transform import Rotation |
There was a problem hiding this comment.
Лучше располагать все импорты в начале файла согласно PEP 8
| @@ -0,0 +1 @@ | |||
| pyyaml No newline at end of file | |||
There was a problem hiding this comment.
Можно указать конкретную версию пакета
| RUN apt-get update && apt-get install -y git build-essential \ | ||
| && mkdir -p /home/mars_ugv/livox_ws/src \ | ||
| && cd /home/mars_ugv/livox_ws/src \ | ||
| && git clone https://github.com/Livox-SDK/livox_ros_driver2.git \ |
There was a problem hiding this comment.
Здесь лучше зафиксировать конкретный коммит
|
|
||
| # Copy application code | ||
| COPY nodes/ /opt/fastlio_localization/nodes/ | ||
| #COPY docker/pipeline_all_in_docker.py /opt/fastlio_localization/ |
| COPY config/ /opt/fastlio_localization/config/ | ||
| COPY scripts/downsample_reference.py /opt/fastlio_localization/scripts/downsample_reference.py | ||
|
|
||
| RUN chmod +x /opt/fastlio_localization/scripts/downsample_reference.py |
There was a problem hiding this comment.
Можно сделать любые файлы исполняемыми у себя локально и закоммитить. Тогда после git clone репозитория файлы сразу будут исполняемыми и вот так делать не придется
| if ext == ".pcd": | ||
| return PointCloudProcessor.load_pcd(filepath) | ||
| elif ext == ".obj": | ||
| mesh = o3d.io.read_triangle_mesh(filepath) | ||
| pcd = mesh.sample_points_uniformly(number_of_points=int(1e6)) | ||
| if len(pcd.points) == 0: | ||
| raise ValueError(f"Empty mesh/point cloud: {filepath}") | ||
| return pcd | ||
| elif ext == ".ply": | ||
| pcd = o3d.io.read_point_cloud(filepath) | ||
| if len(pcd.points) == 0: | ||
| raise ValueError(f"Empty point cloud: {filepath}") | ||
| return pcd |
There was a problem hiding this comment.
Ну как будто pcd и ply по итогу одинаково загружаются
| point = np.array([x, y, z]) | ||
| transformed_point = transform_point(point, T) | ||
|
|
||
| quat = np.array([qx, qy, qz, qw]) | ||
| R_odom = Rotation.from_quat(quat).as_matrix() | ||
| R_ref = T[:3, :3] @ R_odom | ||
| R_rot = Rotation.from_matrix(R_ref) | ||
| quat_transformed = R_rot.as_quat() |
There was a problem hiding this comment.
Можно просто сразу сделать матрицу 4х4 и умножить её на T, тогда за одно умножение получится то же самое
| self.trajectory_buffer.append([stamp, x, y, z, qx, qy, qz, qw]) | ||
|
|
||
| # Limit buffer size | ||
| if len(self.trajectory_buffer) > 10000: |
There was a problem hiding this comment.
Лучше вынести константу куда-нибудь в инициализацию класса
| # Transform position | ||
| pos_h = np.append(pos, 1.0) | ||
| pos_ref = (T @ pos_h)[:3] | ||
|
|
||
| # Transform orientation | ||
| R_odom = Rotation.from_quat(quat).as_matrix() | ||
| R_ref = T[:3, :3] @ R_odom | ||
| quat_ref = Rotation.from_matrix(R_ref).as_quat() |
There was a problem hiding this comment.
Здесь тот же самый момент, можно обойтись одним умножением
| from PIL import Image | ||
|
|
||
|
|
||
| def load_point_cloud(filepath: str) -> o3d.geometry.PointCloud: |
There was a problem hiding this comment.
Кажется уже где-то это было
There was a problem hiding this comment.
Да, точно такая же функция используется в nodes/common.py PointCloudProcessor.
В унифицированном скрипте scripts/visualize.py я оставила копию функции загрузки облака, чтобы его можно было использовать отдельно от узла локализации.
| return geometries | ||
|
|
||
|
|
||
| def _save_visualization_as_gif( |
There was a problem hiding this comment.
Очень похоже на то, что происходит в create_gif.py, может можно унифицировать?
There was a problem hiding this comment.
объединила функционал create_gif.py и visualize_trajectory.py в один файл visualize.py
- Add PointCloudProcessor.load_downsampled() for memoized static clouds; - Update Global and LocalAlign to use pre-processed clouds and cached targets; - Implement LocalAlign._select_seed() for warm-starting with candidate seeds (previous + fresh global); - Add buffer_lock for thread-safe concurrent access; - Switch to deque with automatic pruning.
- Update README.md, config/pipeline_config.yaml and .gitignore; - Simplify docker/docker_build_and_run.sh print_header function; - Simplify scripts/visualize.py logic.
ar961na
left a comment
There was a problem hiding this comment.
Спасибо, исправила комментарии
| RUN apt-get update && apt-get install -y git build-essential \ | ||
| && mkdir -p /home/mars_ugv/livox_ws/src \ | ||
| && cd /home/mars_ugv/livox_ws/src \ | ||
| && git clone https://github.com/Livox-SDK/livox_ros_driver2.git \ |
| RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F42ED6FBAB17C654 | ||
|
|
||
| # Install livox_ros_driver2 for Livox LiDAR support | ||
| RUN apt-get update && apt-get install -y git build-essential \ |
|
|
||
| # Copy application code | ||
| COPY nodes/ /opt/fastlio_localization/nodes/ | ||
| #COPY docker/pipeline_all_in_docker.py /opt/fastlio_localization/ |
| COPY config/ /opt/fastlio_localization/config/ | ||
| COPY scripts/downsample_reference.py /opt/fastlio_localization/scripts/downsample_reference.py | ||
|
|
||
| RUN chmod +x /opt/fastlio_localization/scripts/downsample_reference.py |
|
|
||
| numpy==1.23.5 | ||
| scipy==1.9.3 | ||
| scikit-learn>=0.23.0 |
| return geometries | ||
|
|
||
|
|
||
| def _save_visualization_as_gif( |
There was a problem hiding this comment.
объединила функционал create_gif.py и visualize_trajectory.py в один файл visualize.py
| from PIL import Image | ||
|
|
||
|
|
||
| def load_point_cloud(filepath: str) -> o3d.geometry.PointCloud: |
There was a problem hiding this comment.
Да, точно такая же функция используется в nodes/common.py PointCloudProcessor.
В унифицированном скрипте scripts/visualize.py я оставила копию функции загрузки облака, чтобы его можно было использовать отдельно от узла локализации.
| point = np.array([x, y, z]) | ||
| transformed_point = transform_point(point, T) | ||
|
|
||
| quat = np.array([qx, qy, qz, qw]) | ||
| R_odom = Rotation.from_quat(quat).as_matrix() | ||
| R_ref = T[:3, :3] @ R_odom | ||
| R_rot = Rotation.from_matrix(R_ref) | ||
| quat_transformed = R_rot.as_quat() |
| # Transform position | ||
| pos_h = np.append(pos, 1.0) | ||
| pos_ref = (T @ pos_h)[:3] | ||
|
|
||
| # Transform orientation | ||
| R_odom = Rotation.from_quat(quat).as_matrix() | ||
| R_ref = T[:3, :3] @ R_odom | ||
| quat_ref = Rotation.from_matrix(R_ref).as_quat() |
| self.trajectory_buffer.append([stamp, x, y, z, qx, qy, qz, qw]) | ||
|
|
||
| # Limit buffer size | ||
| if len(self.trajectory_buffer) > 10000: |
- Add optional initial_pose parameter to config and pipeline for complex cases; - Add rebase rotation/translation thresholds for detecting basin switches;- Save both trajectory_reference.txt (rebased) and trajectory_reference_raw.txt (published) odometries; - Add config and it's parameters (e.g. duration, align_interval, map_accumulation_time) v alidation in docker build script; - Fix issue with leftover tail being not localized.
No description provided.