From 0c955e2209426b5684b636316d23bb61dc8c1ade Mon Sep 17 00:00:00 2001 From: Yey007 <55263178+Yey007@users.noreply.github.com> Date: Thu, 4 Sep 2025 20:45:21 -0400 Subject: [PATCH 1/2] better usage instructions --- README.md | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a4c411c..e49cd34 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ ![Docs Badge](https://github.com/cornellev/icp/actions/workflows/docs.yaml/badge.svg) ## Introduction - This repository hosts CEV's implementation of Iterative Closest Points (ICP) as applied to scan matching. ## Authors @@ -17,17 +16,34 @@ This repository hosts CEV's implementation of Iterative Closest Points (ICP) as Please see [LICENSE](LICENSE). Note that all code is licensed under the MIT license, with the exception of some additions to `doxygen-style.css`. Files with copyright headers denoting specific copyright holders belong to said holders. Files under `book/asset` are from [doxygen_theme_flat_design](https://github.com/kcwongjoe/doxygen_theme_flat_design) under its MIT license (again with the exception of some additions to `doxygen-style.css`). Files without copyright headers are under the MIT license, Copyright (c) 2024-2025 Cornell Electric Vehicles. ## Install - You can view installation instructions at [INSTALL.md](INSTALL.md). -## Usage and Documentation +## Usage +```cpp +#include "icp/icp.h" +#include "icp/geo.h" +#include "icp/driver.h" +#include + +void align_clouds(const icp::PointCloud2& a, const icp::PointCloud2& b) { + std::unique_ptr icp = icp::ICP2::from_method("vanilla", icp::Config()).value(); + icp::ICPDriver driver(std::move(icp)); + driver.set_max_iterations(100); + driver.set_transform_tolerance(0.1 * M_PI / 180, 0.1); + auto result = driver.converge(a, b, icp::RBTransform2::Identity()); + + std::cout << "Rotation: " << result.transform.rotation() << "\n"; + std::cout << "Translation: " << result.transform.translation() << "\n"; +} +``` + + ## Versions - Version information can be found in the [releases](https://github.com/cornellev/icp/releases) page. From 1a07a4882f0e0e60bbe7302e5c29e9f012afdc29 Mon Sep 17 00:00:00 2001 From: Yey007 <55263178+Yey007@users.noreply.github.com> Date: Sun, 7 Sep 2025 21:55:55 -0400 Subject: [PATCH 2/2] documentation info --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e49cd34..1e3c294 100644 --- a/README.md +++ b/README.md @@ -38,12 +38,9 @@ void align_clouds(const icp::PointCloud2& a, const icp::PointCloud2& b) { } ``` - +## Documentation +Some documentation is available in the `book` folder. There are also Doxygen docs and other generated documentation hosted at +[cornellev.github.io/icp/](https://cornellev.github.io/icp/), but we haven't update this system in a bit and it might be out of date. ## Versions Version information can be found in the [releases](https://github.com/cornellev/icp/releases) page.