Skip to content

Commit fc82a19

Browse files
authored
Add better usage instructions to the README (#69)
* better usage instructions * documentation info --------- Co-authored-by: Yey007 <55263178+Yey007@users.noreply.github.com>
1 parent 818bd57 commit fc82a19

1 file changed

Lines changed: 23 additions & 7 deletions

File tree

README.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
![Docs Badge](https://github.com/cornellev/icp/actions/workflows/docs.yaml/badge.svg)
66

77
## Introduction
8-
98
This repository hosts CEV's implementation of Iterative Closest Points (ICP) as applied to scan matching.
109

1110
## Authors
@@ -19,12 +18,29 @@ Please see [LICENSE](LICENSE). Note that all code is licensed under the MIT lice
1918
## Install
2019
You can view installation instructions at [INSTALL.md](INSTALL.md).
2120

22-
## Usage and Documentation
23-
We host the usage information and documentation at [cornellev.github.io/icp/](https://cornellev.github.io/icp/).
24-
Please see there for information on how to download and how to use or extend the library.
25-
26-
You can build the documentation yourself locally with `make docs`.
27-
The main page will be located at `docs/index.html` relative to the project root.
21+
## Usage
22+
```cpp
23+
#include "icp/icp.h"
24+
#include "icp/geo.h"
25+
#include "icp/driver.h"
26+
#include <iostream>
27+
28+
void align_clouds(const icp::PointCloud2& a, const icp::PointCloud2& b) {
29+
std::unique_ptr<icp::ICP2> icp = icp::ICP2::from_method("vanilla", icp::Config()).value();
30+
icp::ICPDriver driver(std::move(icp));
31+
32+
driver.set_max_iterations(100);
33+
driver.set_transform_tolerance(0.1 * M_PI / 180, 0.1);
34+
auto result = driver.converge(a, b, icp::RBTransform2::Identity());
35+
36+
std::cout << "Rotation: " << result.transform.rotation() << "\n";
37+
std::cout << "Translation: " << result.transform.translation() << "\n";
38+
}
39+
```
40+
41+
## Documentation
42+
Some documentation is available in the `book` folder. There are also Doxygen docs and other generated documentation hosted at
43+
[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.
2844
2945
## Versions
3046
Version information can be found in the [releases](https://github.com/cornellev/icp/releases) page.

0 commit comments

Comments
 (0)