Skip to content

Commit

Permalink
Update docs and README
Browse files Browse the repository at this point in the history
  • Loading branch information
Yey007 committed Oct 30, 2024
1 parent d7db03f commit c6ef1bc
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 88 deletions.
24 changes: 8 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ SRCDIR := src
INCLUDEDIR := src

CC := $(shell which g++ || which clang++)
# CC := $(shell which clang++)
PY := $(shell which python3 || which python)
CFLAGS := -std=c++17 -pedantic -Wall -Wextra -I $(INCLUDEDIR)
CDEBUG := -g
CRELEASE := -O3 -DRELEASE_BUILD #-fno-fast-math
CRELEASE := -O3 -DRELEASE_BUILD
TARGET := main
LIBNAME := libcevicp.a

Expand Down Expand Up @@ -46,27 +45,19 @@ $(TARGET): main.cpp $(OBJ)
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@
@make readme

# .PHONY: run
# run: $(TARGET)
# ./$(TARGET)

.PHONY: test
test: test.cpp $(OBJ)
@$(CC) $(CFLAGS) -DTEST -o _temp $^ $(LDFLAGS)
@echo 'Running tests...'
@./_temp
@rm -f ./_temp

.PHONY: aux
aux: $(TARGET)
./$(TARGET) -mvanilla

.PHONY: view
view: $(TARGET)
./$(TARGET) -S ex_data/scan$(N)/first.conf -D ex_data/scan$(N)/second.conf --method $(METHOD) --gui

.PHONY: bench
bench: $(TARGET)
bench: $(TARGET)
./$(TARGET) -S ex_data/scan$(N)/first.conf -D ex_data/scan$(N)/second.conf --method $(METHOD) --bench

%.o: %.cpp
Expand All @@ -77,15 +68,16 @@ bench: $(TARGET)
clean:
rm -rf $(OBJ) $(TARGET) $(TARGET) $(DEPS) $(shell find . -name "*.dSYM") $(shell find . -name "*.d") docs

# Not building book rn, add these commands to build
# cd book; \
pdflatex icp.tex; \
rm *.aux *.log *.out \
mv book/icp.pdf docs
.PHONY: docs
docs:
@make readme
$(PY) script/icp_doc_builder.py src/icp/ book/icp_descr/
cd book; \
pdflatex icp.tex; \
rm *.aux *.log *.out
doxygen
mv book/icp.pdf docs
cp book/desmos.txt docs

.PHONY: cloc
Expand All @@ -94,7 +86,7 @@ cloc:

.PHONY: readme
readme:
cd script; $(PY) readme.py `curl https://api.github.com/repos/cornellev/icp/releases/latest | jq .name`
cd script; $(PY) readme.py

.PHONY: math
math:
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<!-- EDIT README.md.build INSTEAD. -->
# icp

> Last updated 2024-10-29 20:38:09.763209.
> Last updated 2024-10-29 21:34:15.790605.
> Version v1.2.1.
> Made by [Ethan Uppal](https://www.ethanuppal.com) and [Utku Melemetci](https://utku.sh).
## Introduction
Expand All @@ -23,7 +24,9 @@ Please see there for information on how to download and how to use the library.
You can build the documentation yourself locally with `make docs`.
The main page will be located at `docs/index.html` relative to the project root.

## v1.2.1
## Versions

### v1.1.2

Started work on a new implementation (read [this paper](book/icp.pdf)).
It passes all `make test` tests.
Expand All @@ -46,7 +49,7 @@ ICP ALGORITHM BENCHMARKING
* Average time per invocation: 0.00413281s
```

### v1.1.x
### v1.1.1

The algorithm runs extremely fast now.
We only need it to run at 6hz with our current LiDAR.
Expand Down
41 changes: 39 additions & 2 deletions README.md.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# icp

> Last updated {{DATE}}.
> Version {{VERSION}}.
> Made by {{AUTHOR}}.

## Introduction
Expand All @@ -20,6 +21,42 @@ Please see there for information on how to download and how to use the library.
You can build the documentation yourself locally with `make docs`.
The main page will be located at `docs/index.html` relative to the project root.

## {{VERSION}}
## Versions

### v1.1.2

Started work on a new implementation (read [this paper](book/icp.pdf)).
It passes all `make test` tests.
Here is the performance currently:
```
ICP ALGORITHM BENCHMARKING
=======================================
* Method name: test1
* Number of trials: 50
* Burn-in period: 0
* Ideal convergence threshold: 20
* Min cost: 19.4709
* Max cost: 19.4709
* Median cost: 19.4709
* Mean cost: 19.4709
* Min iterations: 7 (real: 7)
* Max iterations: 7 (real: 7)
* Median iterations: 7 (real: 7)
* Mean iterations: 7 (real: 7)
* Average time per invocation: 0.00413281s
```

### v1.1.1

The algorithm runs extremely fast now.
We only need it to run at 6hz with our current LiDAR.

![](book/asset/img/v1.1.1bench.png)

It also matches quite well.
Below is the result of running this ICP implementation on two point clouds obtained within the workspace.

![](book/asset/img/v1.1.1result.png)

However, there is still remove for improvement with regard to outlier rejection and other parts of the algorithm (for instance, adopting a point-to-line metric).

{{VERSIONMD}}
Binary file removed book/icp.pdf
Binary file not shown.
Empty file removed book/icp_descr/.gitkeep
Empty file.
25 changes: 0 additions & 25 deletions book/icp_descr/icp_test1.md

This file was deleted.

34 changes: 0 additions & 34 deletions book/versions/v1.md

This file was deleted.

14 changes: 6 additions & 8 deletions script/readme.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
if __name__ == "__main__":
import subprocess
import sys
from datetime import datetime as dt

import requests

README_PATH = "../README.md"
README_GEN_PATH = README_PATH + ".build"
VERSION_TAG = sys.argv[1][1:-1]
VERSION_MAJOR = VERSION_TAG.split(".")[0]
VERSION_MD_PATH = "../book/versions"

VERSION_TAG = requests.get(
"https://api.github.com/repos/cornellev/icp/releases/latest"
).json()["name"]

with open(README_GEN_PATH, "r") as f:
readme = {"content": f.read()}
Expand All @@ -22,9 +23,6 @@ def put(var, text):
"[Ethan Uppal](https://www.ethanuppal.com) and [Utku Melemetci](https://utku.sh)",
)

with open(f"{VERSION_MD_PATH}/{VERSION_MAJOR}.md", "r") as md:
put("VERSIONMD", md.read())

with open(README_PATH, "w") as f:
f.write(
"<!-- THIS FILE IS GENERATED AUTOMATICALLY. -->\n<!-- DO NOT EDIT THIS FILE. -->\n<!-- EDIT README.md.build INSTEAD. -->\n"
Expand Down

0 comments on commit c6ef1bc

Please sign in to comment.