Skip to content

Commit 6fbe592

Browse files
committed
Rename library to Fast Methods, reorganize code, and update documentation.
1 parent 4520fc6 commit 6fbe592

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+410
-394
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ build/
22
*.*~
33
examples/build/
44
doc/html/
5+
.vscode
56

67
#QtCreator temps
78
.idea

CMakeLists.txt

Lines changed: 19 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required (VERSION 2.6)
2-
project (FMM)
2+
project (fast_methods)
33

44
# set a default build type for single-configuration
55
# CMake generators if no build type is set.
@@ -9,7 +9,7 @@ endif(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
99

1010
set(BUILD_EXAMPLES true CACHE STRING "True (default) to build examples")
1111
if(BUILD_EXAMPLES)
12-
message(STATUS "Examples are being built (NOT installed).")
12+
message(STATUS "Examples are being built and installed.")
1313
endif(BUILD_EXAMPLES)
1414

1515
# Select flags.
@@ -39,84 +39,61 @@ endif()
3939
include_directories (
4040
${Boost_INCLUDE_DIRS}
4141
${CImg_INCLUDE_DIRS}
42-
console
43-
ndgridmap
44-
fmm
45-
fmm/fmdata
46-
fm2
47-
io
48-
gradientdescent
49-
thirdparty
42+
include
5043
)
5144

5245
# Create main library
53-
add_library(fastmarching SHARED
54-
console/console.cpp
55-
ndgridmap/cell.cpp
56-
fmm/fmdata/fmcell.cpp
46+
add_library(fast_methods SHARED
47+
src/console/console.cpp
48+
src/ndgridmap/cell.cpp
49+
src/ndgridmap/fmcell.cpp
5750
)
5851

5952
# Linking
60-
target_link_libraries(fastmarching
53+
target_link_libraries(fast_methods
6154
${Boost_LIBRARIES}
6255
${CImg_SYSTEM_LIBS}
6356
)
6457

6558
# Add benchmarking capabilities
66-
add_executable (fmmbenchmark benchmark/fmm_benchmark.cpp)
59+
add_executable(fm_benchmark src/benchmark/fm_benchmark.cpp)
6760

68-
target_link_libraries (fmmbenchmark fastmarching)
61+
target_link_libraries(fm_benchmark fast_methods)
6962

7063
# Create main example
7164
if(BUILD_EXAMPLES)
72-
add_executable(fmm main.cpp)
73-
target_link_libraries(fmm fastmarching)
7465
add_subdirectory(examples)
7566
endif(BUILD_EXAMPLES)
7667

7768
# Install section
7869
# We are not using CMakePackageConfigHelpers because CIMG variables are lists
7970
# and those functions do not manage them properly.
8071
configure_file(
81-
cmake/FMConfig.cmake.in
82-
${CMAKE_BINARY_DIR}/FMConfig.cmake
72+
cmake/fast_methods-config.cmake.in
73+
${CMAKE_BINARY_DIR}/fast_methods-config.cmake
8374
)
8475

85-
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FMConfig.cmake
86-
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/FM
76+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/fast_methods-config.cmake
77+
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/fast_methods
8778
)
8879

89-
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FMConfig.cmake
90-
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/FM
91-
)
92-
93-
install(TARGETS fastmarching
80+
install(TARGETS fast_methods
9481
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
9582
)
9683

97-
install(TARGETS fmmbenchmark
84+
install(TARGETS fm_benchmark
9885
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
9986
)
10087

101-
install(DIRECTORY scripts DESTINATION ${CMAKE_INSTALL_PREFIX}/share/FM)
88+
install(DIRECTORY scripts
89+
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/fast_methods)
10290

103-
install(DIRECTORY benchmark/cfg DESTINATION ${CMAKE_INSTALL_PREFIX}/share/FM)
104-
105-
install(DIRECTORY ${CMAKE_SOURCE_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/include
91+
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include
10692
FILES_MATCHING
10793
PATTERN "*.hpp"
10894
PATTERN "*.h"
109-
REGEX "/build$" EXCLUDE
110-
REGEX ".git$" EXCLUDE
111-
REGEX "/examples$" EXCLUDE
112-
REGEX "/doc$" EXCLUDE
113-
REGEX "/data$" EXCLUDE
114-
REGEX "/cfg$" EXCLUDE
115-
REGEX "/cmake$" EXCLUDE
116-
REGEX "/scripts$" EXCLUDE
11795
)
11896

119-
12097
# Uninstall target
12198
configure_file(
12299
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"

README.md

Lines changed: 25 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,150 +1,64 @@
1-
N-Dimensional Fast Marching Method V1.0
1+
N-Dimensional Fast Methods Library v0.7
22

33
**Authors:**
44
- [Javier V. Gomez](http://jvgomez.github.io) javvgomez _at_ gmail.com
55
- Jose Pardeiro jose.pardeiro _at_ gmail.com
66
- Pablo Gely
77

88
## ALGORITHMS
9+
All the theory and algorithms implemented in this library can be found in my [PhD thesis](doc/files/phd_thesis.pdf). In fact, all the benchmarking data in chapter 4 has been produced with this library and it is stored on the `experiments` branch.
10+
11+
912
**Fast Marching Methods:**
10-
- [FMM](http://jvgomez.github.io/fastmarching/classFMM.html): Fast Marching Method with Binary Queue and Fibonacci Queue (binary by default).
11-
- [FMM*](http://jvgomez.github.io/fastmarching/classFMMStar.html): FMM with CostToGo heuristics.
12-
- [SFMM](http://jvgomez.github.io/fastmarching/classSFMM.html): Simplified Fast Marhching Method.
13-
- [SFMM*](http://jvgomez.github.io/fastmarching/classSFMMStar.html): SFMM with CostToGo heuristics..
13+
- [FMM](http://jvgomez.github.io/fast_methods/classFMM.html): Fast Marching Method with Binary Queue and Fibonacci Queue (binary by default).
14+
- [FMM*](http://jvgomez.github.io/fast_methods/classFMMStar.html): FMM with CostToGo heuristics.
15+
- [SFMM](http://jvgomez.github.io/fast_methods/classSFMM.html): Simplified Fast Marhching Method.
16+
- [SFMM*](http://jvgomez.github.io/fast_methods/classSFMMStar.html): SFMM with CostToGo heuristics..
1417

1518
**O(n) Fast Marching Methods:**
16-
- [GMM](http://jvgomez.github.io/fastmarching/classGMM.html): Group Marching Method.
17-
- [UFMM](http://jvgomez.github.io/fastmarching/classUFMM.html): Untidy Fast Marching Method.
18-
- [FIM](http://jvgomez.github.io/fastmarching/classFIM.html): Fast Iterative Method.
19+
- [GMM](http://jvgomez.github.io/fast_methods/classGMM.html): Group Marching Method.
20+
- [UFMM](http://jvgomez.github.io/fast_methods/classUFMM.html): Untidy Fast Marching Method.
21+
- [FIM](http://jvgomez.github.io/fast_methods/classFIM.html): Fast Iterative Method.
1922

2023
**Fast Sweeping Methods:**
21-
- [FSM](http://jvgomez.github.io/fastmarching/classFSM.html): Fast Sweeping Method.
22-
- [LSM](http://jvgomez.github.io/fastmarching/classLSM.html): Lock Sweeping Method.
23-
24-
**Other methods:**
25-
- [DDQM](http://jvgomez.github.io/fastmarching/classDDQM.html): Dynamic Double Queue Method.
24+
- [FSM](http://jvgomez.github.io/fast_methods/classFSM.html): Fast Sweeping Method.
25+
- [LSM](http://jvgomez.github.io/fast_methods/classLSM.html): Lock Sweeping Method.
26+
- [DDQM](http://jvgomez.github.io/fast_methods/classDDQM.html): Dynamic Double Queue Method.
2627

2728
**Fast Marching Square motion planning algorithms:**
28-
- [FM2](http://jvgomez.github.io/fastmarching/classFM2.html): Fast Marching Square Method.
29-
- [FM2*](http://jvgomez.github.io/fastmarching/classFM2Star.html): Fast Marching Square Star FM2 with CostToGo heuristics.
29+
- [FM2](http://jvgomez.github.io/fast_methods/classFM2.html): Fast Marching Square Method.
30+
- [FM2*](http://jvgomez.github.io/fast_methods/classFM2Star.html): Fast Marching Square Star FM2 with CostToGo heuristics.
3031

3132
**ROS**
3233

33-
ROS nodes using this code (tested in the TurtleBot) are provided in a separate repo:
34-
https://github.com/jpardeiro/fastmarching_node
34+
ROS nodes using this code (tested in the TurtleBot) are provided in a [separate repo](https://github.com/jpardeiro/fastmarching_node)
35+
3536

3637
## DISCLAIMER and IMPORTANT NOTES
3738

3839
- The code is not deeply tested. I've just tested it works for the cases I need. If you find any problem, have any question (or whatever), please write to: javvgomez _at_ gmail.com
3940

40-
- The compilation time is highly increased due to CImg library. Please, omit it when possible.
41+
- The compilation time is highly increased due to CImg library. Please, omit it when possible as it is used only for visualization purposes.
4142

42-
- License GNU/GPL V3: http://www.gnu.org/copyleft/gpl.html
43+
- License [GNU/GPL V3](http://www.gnu.org/copyleft/gpl.html)
4344

4445
- This is a source code intended for my research. Although I want it to be useful for other people it is not intended to act as a library (there are many many points to improve). However, if you show interest or have feature request do not hesitate to contact me and I will try my best to improve the code for whoever needs it. I am also open to contributions and to create a formal library if necessary.
4546

4647

4748
## Documentation
4849

49-
- [API Reference](jvgomez.github.io/fastmarching/)
50-
- This README is important as well.
51-
52-
53-
To build latest the documentation:
54-
55-
$ cd doc
56-
$ doxygen
57-
58-
Go into the HTML folder and open index.html
59-
60-
61-
## Dependencies:
62-
63-
This code uses C\++11 so a compiler g++ 4.8 or equivalent is required. With GCC 4.7 some runtime problems can occur.
64-
65-
Additional dependencies: Boost, imagemafick and CImg.
50+
- [API Reference](jvgomez.github.io/fast_methods/)
6651

67-
$ sudo apt-get install imagemagick libboost-all-dev cimg-dev
6852

6953
## Building the code
70-
To build the code:
71-
72-
$ cd build
73-
$ cmake .. -DCMAKE_BUILD_TYPE=Release (Release, RelWithDebInf or Debug, Release by default)
74-
$ make -j8 (or the number of cores you want to use during compilation)
75-
$ sudo make install (only if you want to install the library)
76-
$ ./fmm -map1 ../data/testimg.png -map2 ../data/map.png -vel ../data/velocities.png
77-
78-
This main shows most of the utilities implemented so far.
79-
80-
To uninstall:
81-
82-
$ sudo make uninstall
83-
84-
85-
## Folder structure
86-
87-
Although there are a lot of folders, they are quite simple. It is organized this way because I'm focusing on an upload to Biicode (www.biicode.com)
88-
89-
+ build: where the code should be compiled.
90-
+ console: the console class.
91-
+ data: additional files and maps to test.
92-
+ alpha: contains code the be refactorized and included in the library in the future.
93-
+ doc: doxygen documentation.
94-
+ examples: easy examples to understand how to use the code.
95-
+ fm2: Fast Marching Square (FM2) algorithms.
96-
+ fmm: Fast Marching Algorithms.
97-
+ fmdata: classes related to the data types of the Fast Marching Method and other algorithms.
98-
+ gradientdescent: under development.
99-
+ io: input/output helper classes.
100-
+ ndgridmap: main container.
101-
+ scripts: matlab scripts to parse outputs and automatic benchmarking bash script.
102-
+ thirdparty: others' software included.
103-
104-
### Installation
105-
Default installation folder is` /usr/local` for Linux distributions (or equivalent on other OS). Libraries are installed in subfolder `lib`, together with CMake modules. All the includes are installed under `include` subfolder. Additionally, in the `share` subfolder the helper scripts and some samples of benchmark configurations files are installed. Finally, the benchmark binary is installed in `bin`.
106-
107-
In order to change the default installation folder you can do:
108-
109-
$ cmake ../.. -DCMAKE_INSTALL_PREFIX=<your folder>
54+
Check the [building section](http://jvgomez.github.io/fast_methods/md_markdown_building.html) of the documentation.
11055

11156

112-
In this case, you will have to adapt your environment variables so that the libraries and CMake modules are found.
57+
## Design and folder structure
58+
Check the [design section](http://jvgomez.github.io/fast_methods/md_markdown_design.html) of the documentation.
11359

11460

11561
## KNOWN ISSUES
11662

11763
- Gradient Descent for FM2* could fail if very narrow passages are in the way of the path.
118-
- It seems that UFMM can fail in maps with random (or similar) velocity changes.
119-
120-
## TODO
121-
122-
At the top of each file there are specific TODO comments. Here are some others.
123-
124-
### Code TODOs
125-
- Remove relative file dependencies (#include "../../fmm", filename = "../../data", CMakeLists.txt deps, etc).
126-
- MapLoader, GridWriter... get a naming convention. MapReader or GridSaver for instance.
127-
- printRunInfo implementation missing for most of the solvers.
128-
- Unify GridWriter and GridPlotter functions parameter order: (grid, name)
129-
- Fix Doxygen warnings.
130-
- Convert all scripts to python (or similar) so that they keep completely open source.
131-
- Reimplement FM2Dir from scratch. Currently in data/alpha folder.
132-
- Substitute arg parsing with boost_options.
133-
- Implement a grid copy constructor and assignment operator, etc.
134-
- Most of the unsigned int should be replaced by size_t to be type-correct.
135-
- Use smart pointers (specially for grid).
136-
- Create a testing framework.
137-
- BenchmarkCFG::configure, parse ctorParams_ with a variadic templated function, something like:` parseParams<int, bool>(param1, param2)`, `parseParams<string,double,bool>(p1,p2,p3)`.
138-
- GridPlotter code can be refactorized so that the same code is not repeated many times.
139-
- Review template template parameters, perhaps it can be simplified (specially for benchmark): `template <grid_t>` to `template <nDGridMap <cell_t, ndims>>` so we can use cell_t without doing `template <grid_t, cell_t>` (redundant).
140-
- Unify names: one thing is Fast Methods, other Fast Marching, etc.
141-
142-
### Algorithmic TODOs
143-
- Improve untidy queue implementation with hash maps (specially remove element in increase_priority()).
144-
- Mix SFMM and UFMM (researchy TODO).
145-
- Improve the way FM2 and its versions deal with the grid when running multiple times on the same grid. Concretely, avoid recomputation of velocities map.
146-
- For most methods, neighbors for same cell are computed many times. Store them like FMT to save some computation time.
147-
148-
### Documentation TODOs
149-
- Review and update nDGridMap.pdf
150-
- Link thesis and papers.
64+
- It seems that UFMM can fail in maps with random (or similar) velocity changes.

TODO.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# TODO
2+
3+
At the top of each file there are specific TODO comments. (List [here](http://jvgomez.github.io/fast_methods/todo.html)). Here are some others.
4+
5+
## Code TODOs
6+
- MapLoader, GridWriter... get a naming convention. MapReader or GridSaver for instance.
7+
- printRunInfo implementation missing for most of the solvers.
8+
- Unify GridWriter and GridPlotter functions parameter order: (grid, name)
9+
- Fix Doxygen warnings.
10+
- Convert all scripts to python (or similar) so that they keep completely open source.
11+
- Reimplement FM2Dir from scratch. Currently in data/alpha folder.
12+
- Substitute arg parsing with boost_options.
13+
- Implement a grid copy constructor and assignment operator, etc.
14+
- Most of the unsigned int should be replaced by size_t to be type-correct.
15+
- Use smart pointers (specially for grid).
16+
- Create a testing framework.
17+
- BenchmarkCFG::configure, parse ctorParams_ with a variadic templated function, something like:` parseParams<int, bool>(param1, param2)`, `parseParams<string,double,bool>(p1,p2,p3)`.
18+
- GridPlotter code can be refactorized so that the same code is not repeated many times.
19+
- Review template template parameters, perhaps it can be simplified (specially for benchmark): `template <grid_t>` to `template <nDGridMap <cell_t, ndims>>` so we can use cell_t without doing `template <grid_t, cell_t>` (redundant).
20+
- Add proper versioning in CMake.
21+
- use Git LFS for big files (and clean the experiments branch).
22+
23+
## Algorithmic TODOs
24+
- Improve untidy queue implementation with hash maps (specially remove element in increase_priority()).
25+
- Mix SFMM and UFMM (researchy TODO).
26+
- Improve the way FM2 and its versions deal with the grid when running multiple times on the same grid. Concretely, avoid recomputation of velocities map.
27+
- For most methods, neighbors for same cell are computed many times. Store them like FMT to save some computation time.
28+
29+
## Documentation TODOs
30+
- Review and update nDGridMap.pdf
31+
- Link thesis and papers.
32+
- Review and update: naming, folder structure, build instructions.
33+
- Add a make doc target.

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
- Benchmarking can save only a grid per solver or grid for all runs with option savegrid=1 or `savegrid=2`
33
- Benchmarking CFG files now accept .grid textfiles under the option `text=<path_to_text_grid>`
44
- Added install and uninstall CMake targets.
5+
- Renamed library to Fast Methods.
6+
- Changed directory structure and includes.
57

68
#### v0.6 ChangeLog
79
- solveEikonal made more stable, but a bit less efficient.
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
set(FM_FOUND 1)
1+
set(fast_methods_FOUND 1)
22

3-
set(FM_INCLUDE_DIRS
3+
set(fast_methods_INCLUDE_DIRS
44
@Boost_INCLUDE_DIRS@
55
@CImg_INCLUDE_DIRS@
66
@CMAKE_INSTALL_PREFIX@/include
77
)
88

9-
set(FM_LIBRARIES
10-
@CMAKE_INSTALL_PREFIX@/lib/${CMAKE_SHARED_LIBRARY_PREFIX}fastmarching${CMAKE_SHARED_LIBRARY_SUFFIX}
9+
set(fast_methods_LIBRARIES
10+
@CMAKE_INSTALL_PREFIX@/lib/${CMAKE_SHARED_LIBRARY_PREFIX}fast_methods${CMAKE_SHARED_LIBRARY_SUFFIX}
1111
@CImg_SYSTEM_LIBS@
1212
@Boost_LIBRARIES@
1313
)

0 commit comments

Comments
 (0)