lidar-converter 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lidar_converter-0.2.0/CHANGELOG.md +83 -0
- lidar_converter-0.2.0/CONTRIBUTING.md +104 -0
- lidar_converter-0.2.0/LICENSE +21 -0
- lidar_converter-0.2.0/Lidar_Converter/CLI_README.md +113 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/README.md +126 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/__init__.py +30 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/base_wrapper.py +523 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/CMakeLists.txt +50 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/LICENSE +25 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/README.md +83 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/SDK_SETUP.md +130 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/SDK_STATUS.md +114 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/__init__.py +33 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/change notes.md +99 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/include/pandarGeneral_sdk/pandarGeneral_sdk.h +107 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/PandarGeneralRaw/CMakeLists.txt +35 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/PandarGeneralRaw/include/log.h +63 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/PandarGeneralRaw/include/pandarGeneral/input.h +47 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/PandarGeneralRaw/include/pandarGeneral/pandarGeneral.h +112 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/PandarGeneralRaw/include/pandarGeneral/pandarGeneral_internal.h +633 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/PandarGeneralRaw/include/pandarGeneral/pandarQT.h +98 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/PandarGeneralRaw/include/pandarGeneral/pandarXT.h +233 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/PandarGeneralRaw/include/pandarGeneral/pcap_reader.h +44 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/PandarGeneralRaw/include/pandarGeneral/point_types.h +38 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/PandarGeneralRaw/include/version.h +40 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/PandarGeneralRaw/src/input.cc +265 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/PandarGeneralRaw/src/pandarGeneral.cc +112 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/PandarGeneralRaw/src/pandarGeneral_internal.cc +2102 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/PandarGeneralRaw/src/pcap_reader.cpp +186 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/pandarGeneral_sdk.cc +183 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/tcp_command_client.c +348 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/tcp_command_client.h +69 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/util.c +177 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/util.h +36 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/wrapper.cc +105 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/src/wrapper.h +12 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/test/test.cc +91 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_sdk/verify_sdk.py +139 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/hesai_wrapper.py +1154 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/livox_wrapper.py +1398 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/ouster_wrapper.py +947 -0
- lidar_converter-0.2.0/Lidar_Converter/Wrappers/velodyne_wrapper.py +1137 -0
- lidar_converter-0.2.0/Lidar_Converter/__init__.py +101 -0
- lidar_converter-0.2.0/Lidar_Converter/cli.py +793 -0
- lidar_converter-0.2.0/Lidar_Converter/converter.py +521 -0
- lidar_converter-0.2.0/Lidar_Converter/detector.py +871 -0
- lidar_converter-0.2.0/MANIFEST.in +42 -0
- lidar_converter-0.2.0/PKG-INFO +415 -0
- lidar_converter-0.2.0/README.md +368 -0
- lidar_converter-0.2.0/lidar_converter.egg-info/PKG-INFO +415 -0
- lidar_converter-0.2.0/lidar_converter.egg-info/SOURCES.txt +56 -0
- lidar_converter-0.2.0/lidar_converter.egg-info/dependency_links.txt +1 -0
- lidar_converter-0.2.0/lidar_converter.egg-info/entry_points.txt +2 -0
- lidar_converter-0.2.0/lidar_converter.egg-info/requires.txt +21 -0
- lidar_converter-0.2.0/lidar_converter.egg-info/top_level.txt +1 -0
- lidar_converter-0.2.0/pyproject.toml +97 -0
- lidar_converter-0.2.0/requirements.txt +14 -0
- lidar_converter-0.2.0/setup.cfg +4 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- `requirements.txt` aligned with `pyproject.toml` runtime dependencies
|
|
12
|
+
- `TESTING_GUIDE.md` with manual CLI examples, SDK / `pip` notes, and link to **[lidar-multi-convert](https://github.com/Param-Patel-o5/lidar-multi-convert)**; accurate `Lidar_Converter/CLI_README.md`
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- CLI program name in help text: `lidar-converter` (matches the PyPI package and console script)
|
|
16
|
+
- **`pyproject.toml` `[project.urls]`** and docs now use the GitHub repo **`Param-Patel-o5/lidar-multi-convert`** (PyPI name stays `lidar-converter`)
|
|
17
|
+
- Removed unused `click` dependency (CLI uses `argparse`)
|
|
18
|
+
- README: project layout, install clone URL, SDK vs PCAP table, testing references
|
|
19
|
+
|
|
20
|
+
### Removed
|
|
21
|
+
- Duplicate `[tool.flake8]` block from `pyproject.toml` (use `.flake8` at repo root)
|
|
22
|
+
- `[tool.pytest.ini_options]` from `pyproject.toml` (no bundled test suite)
|
|
23
|
+
|
|
24
|
+
## [0.2.0] - 2024-11-18
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
- **Hesai LiDAR Support** - Full support for Hesai sensors (PandarXT-32, PandarXT-16, Pandar64, Pandar40P, PandarQT)
|
|
28
|
+
- Automatic vendor detection with 48% confidence scoring
|
|
29
|
+
- PCAP packet parsing based on official Hesai documentation
|
|
30
|
+
- Support for all output formats (LAS, LAZ, PCD, BIN, CSV)
|
|
31
|
+
- Dynamic packet structure parsing for flexibility across models
|
|
32
|
+
- Reads channel count, block count, and distance unit from packet headers
|
|
33
|
+
- Adaptive block size calculation for different Hesai models
|
|
34
|
+
- **LAZ Compression** - Real compression now working for all vendors
|
|
35
|
+
- Added `lazrs>=0.8.0` dependency for LAZ compression
|
|
36
|
+
- Compression ratio: 60-80% smaller than uncompressed LAS
|
|
37
|
+
- Verified compression for Ouster, Velodyne, Livox, and Hesai
|
|
38
|
+
- Typical compression: 3-15 bytes/point (vs 28-30 for uncompressed)
|
|
39
|
+
- **PyPI Package Configuration** - Professional package setup for PyPI publishing
|
|
40
|
+
- MIT License file
|
|
41
|
+
- Contributing guidelines (CONTRIBUTING.md)
|
|
42
|
+
- Code of Conduct (CODE_OF_CONDUCT.md)
|
|
43
|
+
- Comprehensive tool configurations (black, pytest, flake8, mypy)
|
|
44
|
+
- Optional dependencies for development and documentation
|
|
45
|
+
- PyPI badges in README
|
|
46
|
+
- Livox LiDAR support (Avia, Horizon, Tele-15, Mid-40/70, HAP)
|
|
47
|
+
- Multiple output format support (PCD, BIN, CSV) in addition to LAS/LAZ
|
|
48
|
+
- Batch conversion capability
|
|
49
|
+
- Health check command
|
|
50
|
+
- Comprehensive CLI with rich output formatting
|
|
51
|
+
|
|
52
|
+
### Changed
|
|
53
|
+
- Updated README.md with Hesai support information and PyPI installation instructions
|
|
54
|
+
- Updated vendor detection to include Hesai magic bytes (0xEEFF)
|
|
55
|
+
- Updated UDP port detection to recognize Hesai port (2368)
|
|
56
|
+
- Improved packet size detection for Hesai (861 bytes)
|
|
57
|
+
- Enhanced documentation with Hesai packet structure details
|
|
58
|
+
- Improved vendor detection with multi-method approach
|
|
59
|
+
- Enhanced error handling and logging
|
|
60
|
+
- Optimized performance with configurable scan limits
|
|
61
|
+
- Fixed package discovery in pyproject.toml for proper subpackage inclusion
|
|
62
|
+
|
|
63
|
+
### Fixed
|
|
64
|
+
- Syntax error in __init__.py (missing closing quote in __all__)
|
|
65
|
+
- LAZ compression now works properly (was creating uncompressed files before)
|
|
66
|
+
- Hesai packet parsing now correctly reads data from byte 12 (not byte 42)
|
|
67
|
+
- Fixed block size calculation to use header information
|
|
68
|
+
- Improved point filtering to remove invalid/noise points
|
|
69
|
+
|
|
70
|
+
## [0.1.0] - 2025-11-01
|
|
71
|
+
|
|
72
|
+
### Added
|
|
73
|
+
- Initial release
|
|
74
|
+
- Ouster LiDAR support (OS-0, OS-1, OS-2, OS-Dome series)
|
|
75
|
+
- Velodyne LiDAR support (VLP-16, VLP-32C, HDL-32E, HDL-64E, VLS-128)
|
|
76
|
+
- Automatic vendor detection
|
|
77
|
+
- LAS/LAZ output format support
|
|
78
|
+
- Command-line interface
|
|
79
|
+
- Python API
|
|
80
|
+
|
|
81
|
+
[Unreleased]: https://github.com/Param-Patel-o5/lidar-multi-convert/compare/v0.2.0...HEAD
|
|
82
|
+
[0.2.0]: https://github.com/Param-Patel-o5/lidar-multi-convert/compare/v0.1.0...v0.2.0
|
|
83
|
+
[0.1.0]: https://github.com/Param-Patel-o5/lidar-multi-convert/releases/tag/v0.1.0
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Contributing to LiDAR Converter
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to LiDAR Converter! We appreciate your effort.
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
- Python 3.8 or higher
|
|
9
|
+
- Git
|
|
10
|
+
|
|
11
|
+
### Setup Instructions
|
|
12
|
+
|
|
13
|
+
1. **Fork and clone the repository:**
|
|
14
|
+
```bash
|
|
15
|
+
git clone https://github.com/Param-Patel-o5/lidar-multi-convert.git
|
|
16
|
+
cd lidar-multi-convert
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
2. **Create a virtual environment:**
|
|
20
|
+
```bash
|
|
21
|
+
python -m venv venv
|
|
22
|
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
3. **Install in editable mode with dev dependencies:**
|
|
26
|
+
```bash
|
|
27
|
+
pip install -e ".[dev]"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Running Tests
|
|
31
|
+
|
|
32
|
+
Run all tests:
|
|
33
|
+
```bash
|
|
34
|
+
pytest
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Run with coverage report:
|
|
38
|
+
```bash
|
|
39
|
+
pytest --cov=Lidar_Converter --cov-report=html
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Code Quality
|
|
43
|
+
|
|
44
|
+
We maintain consistent code quality using:
|
|
45
|
+
|
|
46
|
+
### Format with Black
|
|
47
|
+
```bash
|
|
48
|
+
black Lidar_Converter/
|
|
49
|
+
black tests/
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Lint with Flake8
|
|
53
|
+
```bash
|
|
54
|
+
flake8 Lidar_Converter/
|
|
55
|
+
flake8 tests/
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Type checking with mypy
|
|
59
|
+
```bash
|
|
60
|
+
mypy Lidar_Converter/
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Run all checks
|
|
64
|
+
```bash
|
|
65
|
+
black Lidar_Converter/ tests/ && flake8 Lidar_Converter/ tests/ && mypy Lidar_Converter/ && pytest
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Making Changes
|
|
69
|
+
|
|
70
|
+
1. **Create a feature branch:**
|
|
71
|
+
```bash
|
|
72
|
+
git checkout -b feature/your-feature-name
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
2. **Make your changes and commit:**
|
|
76
|
+
```bash
|
|
77
|
+
git add .
|
|
78
|
+
git commit -m "feat: description of your changes"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Follow conventional commit format:
|
|
82
|
+
- `feat:` for new features
|
|
83
|
+
- `fix:` for bug fixes
|
|
84
|
+
- `docs:` for documentation
|
|
85
|
+
- `test:` for test additions
|
|
86
|
+
- `refactor:` for code refactoring
|
|
87
|
+
- `style:` for formatting changes
|
|
88
|
+
|
|
89
|
+
3. **Push and create a Pull Request:**
|
|
90
|
+
```bash
|
|
91
|
+
git push origin feature/your-feature-name
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Pull Request Guidelines
|
|
95
|
+
|
|
96
|
+
- Include a clear description of changes
|
|
97
|
+
- Reference related issues (e.g., "Fixes #123")
|
|
98
|
+
- Ensure all tests pass locally
|
|
99
|
+
- Update documentation if needed
|
|
100
|
+
- Follow code style guidelines
|
|
101
|
+
|
|
102
|
+
## Questions?
|
|
103
|
+
|
|
104
|
+
Feel free to open an issue or discussion in the repository.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Param Patel
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# lidar-converter — command-line interface
|
|
2
|
+
|
|
3
|
+
The installed console script is **`lidar-converter`** (defined in `pyproject.toml`).
|
|
4
|
+
Global options (`--log-level`, `--config`, `--output-format`, etc.) must appear **before** the subcommand.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
pip install lidar-converter
|
|
10
|
+
# or from source:
|
|
11
|
+
pip install -e .
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Verify:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
lidar-converter --help
|
|
18
|
+
lidar-converter --log-level ERROR --output-format json health
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Subcommands
|
|
22
|
+
|
|
23
|
+
| Command | Purpose |
|
|
24
|
+
|---------|---------|
|
|
25
|
+
| `convert` | One input file → one output file (format from `-o` extension or `-f`) |
|
|
26
|
+
| `batch` | Many files in a directory (shared output format) |
|
|
27
|
+
| `detect` | Vendor detection only |
|
|
28
|
+
| `health` | SDK / wrapper availability |
|
|
29
|
+
| `test` | Run pipeline test on one file (detect + wrapper test conversion) |
|
|
30
|
+
|
|
31
|
+
There is **no** `info` subcommand and **no** `--version` flag in the current CLI (use `pip show lidar-converter` for the package version).
|
|
32
|
+
|
|
33
|
+
## `convert`
|
|
34
|
+
|
|
35
|
+
**Syntax:**
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
lidar-converter convert INPUT_FILE -o OUTPUT_FILE [options]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Important:** output path is **` -o ` / `--output`**, not a second positional argument.
|
|
42
|
+
|
|
43
|
+
**Examples:**
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# LAS (extension chooses format)
|
|
47
|
+
lidar-converter convert data.pcap -o out.las --max-scans 10
|
|
48
|
+
|
|
49
|
+
# LAZ, PCD, BIN, CSV
|
|
50
|
+
lidar-converter convert data.pcap -o out.laz --max-scans 10
|
|
51
|
+
lidar-converter convert data.pcap -o out.pcd --max-scans 10
|
|
52
|
+
lidar-converter convert data.pcap -o out.bin --max-scans 10
|
|
53
|
+
lidar-converter convert data.pcap -o out.csv --max-scans 10
|
|
54
|
+
|
|
55
|
+
# Explicit format (optional)
|
|
56
|
+
lidar-converter convert data.pcap -o out.file --format laz
|
|
57
|
+
|
|
58
|
+
# Ouster: metadata JSON beside PCAP (same stem) or pass explicitly
|
|
59
|
+
lidar-converter convert scan.pcap -o out.las -c scan.json --max-scans 10
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Common options:**
|
|
63
|
+
|
|
64
|
+
- `-o`, `--output` — output file path
|
|
65
|
+
- `-f`, `--format` — `las`, `laz`, `pcd`, `bin`, `csv` (optional if extension is clear)
|
|
66
|
+
- `--max-scans` — limit scans for faster tests (default in CLI: 1000)
|
|
67
|
+
- `-c`, `--calibration` — calibration / metadata file
|
|
68
|
+
- `--validate` — validate output after conversion
|
|
69
|
+
- `--no-intensity` — drop intensity
|
|
70
|
+
|
|
71
|
+
## `batch`
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
lidar-converter batch INPUT_DIR -o OUTPUT_DIR [--pattern "*.pcap"] [-r] [--max-scans 10]
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Output filenames are derived from input stems; format comes from `-f` or config.
|
|
78
|
+
|
|
79
|
+
## `detect`
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
lidar-converter --output-format json detect file.pcap
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## `health`
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
lidar-converter --output-format json health
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Use JSON on Windows if the Rich tables fail due to console encoding (see `TESTING_GUIDE.md`).
|
|
92
|
+
|
|
93
|
+
## `test`
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
lidar-converter test file.pcap
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Configuration file
|
|
100
|
+
|
|
101
|
+
Optional JSON (merged with defaults), searched in order:
|
|
102
|
+
|
|
103
|
+
1. Path from `--config`
|
|
104
|
+
2. `~/.lidar_converter.json`
|
|
105
|
+
3. `./.lidar_converter.json`
|
|
106
|
+
|
|
107
|
+
Environment overrides: `LIDAR_OUTPUT_FORMAT`, `LIDAR_OUTPUT_DIR`, `LIDAR_LOG_LEVEL`.
|
|
108
|
+
|
|
109
|
+
## Further reading
|
|
110
|
+
|
|
111
|
+
- Repository root: `README.md`, `TESTING_GUIDE.md`
|
|
112
|
+
- Source on GitHub: [Param-Patel-o5/lidar-multi-convert](https://github.com/Param-Patel-o5/lidar-multi-convert) (PyPI: `lidar-converter`)
|
|
113
|
+
- Wrappers: `Lidar_Converter/Wrappers/README.md`
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Vendor Wrapper Modules
|
|
2
|
+
|
|
3
|
+
This directory contains vendor-specific wrappers that provide a unified interface for LiDAR conversion across different manufacturers.
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
All vendor wrappers follow the same architecture pattern:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
BaseVendorWrapper (abstract base class)
|
|
11
|
+
├── OusterWrapper ✅ (implemented - Python SDK)
|
|
12
|
+
├── VelodyneWrapper ✅ (implemented - dpkt parsing)
|
|
13
|
+
├── HesaiWrapper (planned)
|
|
14
|
+
├── LivoxWrapper (planned)
|
|
15
|
+
├── RIEGLWrapper (planned)
|
|
16
|
+
└── SICKWrapper (planned)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Design Principles
|
|
20
|
+
|
|
21
|
+
1. **Unified Interface**: All wrappers implement the same abstract methods
|
|
22
|
+
2. **Abstraction**: Vendor-specific details are hidden from converter.py
|
|
23
|
+
3. **Robustness**: Comprehensive error handling and validation
|
|
24
|
+
4. **Extensibility**: Easy to add new vendors following the same pattern
|
|
25
|
+
5. **Documentation**: Clear docstrings and usage examples
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### Basic Usage
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from Wrappers import OusterWrapper, VelodyneWrapper
|
|
33
|
+
|
|
34
|
+
# Ouster conversion (requires ouster-sdk)
|
|
35
|
+
ouster_wrapper = OusterWrapper()
|
|
36
|
+
if ouster_wrapper.sdk_available:
|
|
37
|
+
result = ouster_wrapper.convert_to_las(
|
|
38
|
+
input_path="ouster_data.pcap",
|
|
39
|
+
output_path="output.las",
|
|
40
|
+
calibration_file="metadata.json" # Required for Ouster
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
# Velodyne conversion (uses dpkt fallback)
|
|
44
|
+
velodyne_wrapper = VelodyneWrapper()
|
|
45
|
+
if velodyne_wrapper.sdk_available:
|
|
46
|
+
result = velodyne_wrapper.convert_to_las(
|
|
47
|
+
input_path="velodyne_data.pcap",
|
|
48
|
+
output_path="output.las",
|
|
49
|
+
sensor_model="VLP-16" # Optional, auto-detected if not provided
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
# Check results
|
|
53
|
+
if result["success"]:
|
|
54
|
+
print(f"Converted {result['points_converted']} points")
|
|
55
|
+
print(f"Time: {result['conversion_time']:.2f}s")
|
|
56
|
+
print(f"Vendor: {result.get('vendor', 'unknown')}")
|
|
57
|
+
else:
|
|
58
|
+
print(f"Error: {result['error']}")
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Integration with converter.py
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
from converter import LiDARConverter
|
|
65
|
+
|
|
66
|
+
# Automatic vendor detection and conversion
|
|
67
|
+
converter = LiDARConverter()
|
|
68
|
+
result = converter.convert("file.pcap", "output.las")
|
|
69
|
+
|
|
70
|
+
# Manual wrapper usage
|
|
71
|
+
from detector import VendorDetector
|
|
72
|
+
from Wrappers import OusterWrapper, VelodyneWrapper
|
|
73
|
+
|
|
74
|
+
detector = VendorDetector()
|
|
75
|
+
detection_result = detector.detect_vendor("file.pcap")
|
|
76
|
+
|
|
77
|
+
if detection_result["success"]:
|
|
78
|
+
vendor = detection_result["vendor_name"]
|
|
79
|
+
|
|
80
|
+
if vendor == "ouster":
|
|
81
|
+
wrapper = OusterWrapper()
|
|
82
|
+
elif vendor == "velodyne":
|
|
83
|
+
wrapper = VelodyneWrapper()
|
|
84
|
+
|
|
85
|
+
if wrapper.sdk_available:
|
|
86
|
+
result = wrapper.convert_to_las("file.pcap", "output.las")
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Wrapper Interface
|
|
90
|
+
|
|
91
|
+
All wrappers must implement:
|
|
92
|
+
|
|
93
|
+
- `get_vendor_name()` → str
|
|
94
|
+
- `validate_sdk_installation()` → dict
|
|
95
|
+
- `convert_to_las(input_path, output_path, **kwargs)` → dict
|
|
96
|
+
- `convert(input_path, output_format, output_path, **kwargs)` → dict
|
|
97
|
+
- `get_vendor_info()` → dict
|
|
98
|
+
- `validate_conversion(input_path, output_path)` → bool
|
|
99
|
+
|
|
100
|
+
## Adding New Vendors
|
|
101
|
+
|
|
102
|
+
To add a new vendor wrapper:
|
|
103
|
+
|
|
104
|
+
1. Create `{vendor}_wrapper.py` in this directory
|
|
105
|
+
2. Inherit from `BaseVendorWrapper`
|
|
106
|
+
3. Implement all abstract methods
|
|
107
|
+
4. Follow the same error handling and logging patterns
|
|
108
|
+
5. Add to `__init__.py` exports
|
|
109
|
+
6. Document vendor-specific requirements
|
|
110
|
+
|
|
111
|
+
See `ouster_wrapper.py` and `velodyne_wrapper.py` as reference implementations.
|
|
112
|
+
|
|
113
|
+
## Current Implementations
|
|
114
|
+
|
|
115
|
+
### OusterWrapper
|
|
116
|
+
- **SDK**: Uses official Ouster Python SDK (ouster-sdk)
|
|
117
|
+
- **Requirements**: Requires JSON metadata file
|
|
118
|
+
- **Sensors**: OS-0, OS-1, OS-2, OS-Dome series (16/32/64/128 channels)
|
|
119
|
+
- **Features**: Full SDK integration with coordinate transformations
|
|
120
|
+
|
|
121
|
+
### VelodyneWrapper
|
|
122
|
+
- **SDK**: Uses dpkt for PCAP parsing (no vendor SDK required)
|
|
123
|
+
- **Requirements**: Only PCAP file needed
|
|
124
|
+
- **Sensors**: VLP-16, VLP-32C, HDL-32E, HDL-64E, VLS-128
|
|
125
|
+
- **Features**: Manual packet parsing with coordinate conversion
|
|
126
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Vendor-specific wrapper modules for LiDAR conversion.
|
|
3
|
+
|
|
4
|
+
This package contains vendor-specific wrappers that abstract SDK complexity
|
|
5
|
+
behind a unified interface. All wrappers inherit from BaseVendorWrapper and
|
|
6
|
+
provide consistent method signatures for seamless integration with converter.py.
|
|
7
|
+
|
|
8
|
+
Supported Vendors:
|
|
9
|
+
- Ouster: Full implementation
|
|
10
|
+
- Velodyne: Full implementation
|
|
11
|
+
- Hesai: Full implementation
|
|
12
|
+
- Livox: Full implementation
|
|
13
|
+
- RIEGL: Planned
|
|
14
|
+
- SICK: Planned
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from .base_wrapper import BaseVendorWrapper
|
|
18
|
+
from .ouster_wrapper import OusterWrapper
|
|
19
|
+
from .velodyne_wrapper import VelodyneWrapper
|
|
20
|
+
from .livox_wrapper import LivoxWrapper
|
|
21
|
+
from .hesai_wrapper import HesaiWrapper
|
|
22
|
+
|
|
23
|
+
__all__ = [
|
|
24
|
+
"BaseVendorWrapper",
|
|
25
|
+
"OusterWrapper",
|
|
26
|
+
"VelodyneWrapper",
|
|
27
|
+
"LivoxWrapper",
|
|
28
|
+
"HesaiWrapper",
|
|
29
|
+
]
|
|
30
|
+
|