-
Notifications
You must be signed in to change notification settings - Fork 0
Trislam1 #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dr-soong
wants to merge
23
commits into
main
Choose a base branch
from
trislam1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Trislam1 #40
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
49e6b69
Draft of face following capability
da8bdf2
Merge branch 'main' into behaviors
5c15f5c
Minor cleanup
8c91260
Merge branch 'main' of github.com:gaia-platform/examples-internal int…
dr-soong 9d9f653
Merge branch 'main' of github.com:gaia-platform/examples-internal int…
dr-soong cc6b503
Merge branch 'main' of github.com:gaia-platform/examples-internal int…
dr-soong d5ee693
Merge branch 'main' of github.com:gaia-platform/examples-internal int…
dr-soong 0e11a8e
Snapshot save migrating SLAM to ClearPath-oriented example
dr-soong 5f14de4
Update rules/ddl so they compile
dr-soong 1ce766a
Fixing compile errors
dr-soong a2a9414
Snapshot save investigating link error
dr-soong 1ffb9c3
App compiles. Start testing next
dr-soong ea52e7c
Snapshot. State: apparent left/right inversion in range radials
dr-soong ea66c47
Fixed axis inversion issue w/ ray tracing
dr-soong 563b607
Running to produce demo. DDL/rules in draft
dr-soong 59f3f91
Address some PR comments
dr-soong 9cb963c
Reordered DDL to hopefully improve understandability. Added comment t…
dr-soong b26a384
PR comments (mostly re: constants and making types consistent)
dr-soong 2165b0b
Comments to Makefiles
dr-soong 095ccde
Found another data type inconsistency (float/double)
dr-soong 15fbf7c
Remove debug code, clean up comments, other PR changes
dr-soong 17d1b2c
Split ruleset into serial and non-serial sections
dr-soong 9d7c532
Minor cleanup. Bug fix on map output
dr-soong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| tmp | ||
| *.o | ||
| .*.swp | ||
| build | ||
| *.pgm | ||
| *.jpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| ################################################### | ||
| # Copyright (c) Gaia Platform LLC | ||
| # | ||
| # Use of this source code is governed by the MIT | ||
| # license that can be found in the LICENSE.txt file | ||
| # or at https://opensource.org/licenses/MIT. | ||
| ################################################### | ||
|
|
||
| cmake_minimum_required(VERSION 3.16) | ||
|
|
||
| enable_testing() | ||
|
|
||
| project(slam_demo) | ||
|
|
||
| set(CMAKE_CXX_STANDARD 17) | ||
|
|
||
| set(GAIA_COMPILE_FLAGS "-c -Wall -Wextra -ggdb") | ||
| set(GAIA_LINK_FLAGS "-ggdb") | ||
|
|
||
| # We need pthreads support. | ||
| set(CMAKE_THREAD_PREFER_PTHREAD TRUE) | ||
| set(THREADS_PREFER_PTHREAD_FLAG TRUE) | ||
| find_package(Threads REQUIRED) | ||
|
|
||
| include("/opt/gaia/cmake/gaia.cmake") | ||
|
|
||
| # --- Generate Direct Access classes from DDL--- | ||
| process_schema( | ||
| DDL_FILE ${PROJECT_SOURCE_DIR}/gaia/slam.ddl | ||
| DATABASE_NAME slam | ||
| ) | ||
|
|
||
| # -- Translate ruleset into CPP -- | ||
| translate_ruleset( | ||
| RULESET_FILE ${PROJECT_SOURCE_DIR}/gaia/slam.ruleset | ||
| CLANG_PARAMS | ||
| -I ${PROJECT_SOURCE_DIR}/include | ||
| ) | ||
|
|
||
| # Application | ||
|
|
||
| add_executable(slam_demo | ||
| src/analyze.cpp | ||
| src/occupancy.cpp | ||
| src/main.cpp | ||
| src/support.cpp | ||
| src/rule_api.cpp | ||
| src/utils/coord_list.cpp | ||
| src/utils/line_segment.cpp | ||
| ) | ||
|
|
||
| target_add_gaia_generated_sources(slam_demo) | ||
|
|
||
| target_include_directories(slam_demo PRIVATE | ||
| ${GAIA_INC} | ||
| ${PROJECT_SOURCE_DIR}/include | ||
| ${PROJECT_SOURCE_DIR}/gaia/slam | ||
| ) | ||
|
|
||
| target_link_directories(slam_demo PRIVATE ${GAIA_LIB_DIR}) | ||
| target_link_libraries(slam_demo PRIVATE ${GAIA_LIB} rt Threads::Threads) | ||
|
|
||
|
|
||
| ######################################################################## | ||
| # Tests | ||
|
|
||
| ################################ | ||
| add_executable(test_coord_list | ||
| tests/test_coord_list.cpp | ||
| src/utils/coord_list.cpp | ||
| ) | ||
|
|
||
| target_include_directories(test_coord_list PRIVATE ${PROJECT_SOURCE_DIR}/include) | ||
| target_link_libraries(test_coord_list PRIVATE rt) | ||
|
|
||
| add_test(NAME test_coord_list COMMAND test_coord_list) | ||
|
|
||
|
|
||
| ################################ | ||
| add_executable(test_line_segment | ||
| tests/test_line_segment.cpp | ||
| src/utils/line_segment.cpp | ||
| ) | ||
|
|
||
| target_include_directories(test_line_segment PRIVATE ${PROJECT_SOURCE_DIR}/include) | ||
| target_link_libraries(test_line_segment PRIVATE rt) | ||
|
|
||
| add_test(NAME test_line_segment COMMAND test_line_segment) | ||
|
|
||
|
|
||
| ################################ | ||
| add_executable(test_analyze | ||
| tests/test_analyze.cpp | ||
| src/analyze.cpp | ||
| src/occupancy.cpp | ||
| src/rule_api.cpp | ||
| src/support.cpp | ||
| src/utils/coord_list.cpp | ||
| src/utils/line_segment.cpp | ||
| ) | ||
| target_add_gaia_generated_sources(test_analyze) | ||
|
|
||
| target_include_directories(test_analyze PRIVATE ${GAIA_INC}) | ||
| target_include_directories(test_analyze PRIVATE ${PROJECT_SOURCE_DIR}/include) | ||
| target_link_libraries(test_analyze PRIVATE ${GAIA_LIB} rt) | ||
|
|
||
| add_test(NAME test_analyze COMMAND test_analyze) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Copyright (c) Gaia Platform LLC | ||
| # | ||
| # Use of this source code is governed by the MIT | ||
| # license that can be found in the LICENSE.txt file | ||
| # or at https://opensource.org/licenses/MIT. | ||
|
|
||
| # 'make all' executes cmake in 'build' directory. | ||
| # 'make clean' deletes the cmake build/ folder. | ||
| # 'make refresh_db' runs gaiac to clean out old content. | ||
| # 'make refresh' runs 'make clann all' | ||
|
|
||
| all: | ||
| #mkdir -p build && cd build && cmake .. && make | ||
| mkdir -p build && cd build && cmake .. && make -j 4 | ||
|
|
||
| run: | ||
| cd src && make run | ||
|
|
||
| # At present there's no method to delete the contents of the database | ||
| # from w/in the program, so add a way to do so outside. | ||
| refresh_db: | ||
| gaiac gaia/slam.ddl --db-name slam -g -o /tmp/slam | ||
|
|
||
| refresh: clean all | ||
|
|
||
| clean: | ||
| rm -Rf build | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| { | ||
| "description": "4 rooms, 3 with table", | ||
| "width": 15.0, | ||
| "height": 10.0, | ||
| "world": [ | ||
| { | ||
| "name": "Walls", | ||
| "vertices": [ | ||
| { "x": -6.9, "y": 4.9 }, | ||
| { "x": -0.1, "y": 4.9 }, | ||
| { "x": -0.1, "y": 0.1 }, | ||
| { "x": -1.5, "y": 0.1 }, | ||
| { "x": -1.5, "y": -0.1 }, | ||
| { "x": -0.1, "y": -0.1 }, | ||
| { "x": -0.1, "y": -3.0 }, | ||
| { "x": 0.1, "y": -3.0 }, | ||
| { "x": 0.1, "y": 4.9 }, | ||
| { "x": 6.9, "y": 4.9 }, | ||
| { "x": 6.9, "y": -1.9 }, | ||
| { "x": 2.1, "y": 0.1 }, | ||
| { "x": 2.1, "y": -0.1 }, | ||
| { "x": 6.9, "y": -2.1 }, | ||
| { "x": 6.9, "y": -4.9 }, | ||
| { "x": -6.9, "y": -4.9 }, | ||
| { "x": -6.9, "y": -0.1 }, | ||
| { "x": -3.4, "y": -0.1 }, | ||
| { "x": -3.4, "y": 0.1 }, | ||
| { "x": -6.9, "y": 0.1 }, | ||
| { "x": -6.9, "y": 4.9 } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "Table-1", | ||
| "vertices": [ | ||
| { "x": -5.5, "y": 3.5 }, | ||
| { "x": -4.0, "y": 3.5 }, | ||
| { "x": -4.0, "y": 2.5 }, | ||
| { "x": -5.5, "y": 2.5 }, | ||
| { "x": -5.5, "y": 3.5 } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "Table-2", | ||
| "vertices": [ | ||
| { "x": 2.5, "y": -2.5 }, | ||
| { "x": 3.8, "y": -3.5 }, | ||
| { "x": 1.2, "y": -3.5 }, | ||
| { "x": 2.5, "y": -2.5 } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "Table-3", | ||
| "vertices": [ | ||
| { "x": 3.0, "y": 3.0 }, | ||
| { "x": 4.0, "y": 3.0 }, | ||
| { "x": 4.0, "y": 2.0 }, | ||
| { "x": 3.0, "y": 2.0 }, | ||
| { "x": 3.0, "y": 3.0 } | ||
| ] | ||
| } | ||
| ], | ||
| "landmarks": [ | ||
| { "x": -3.5, "y": 4.9, "id": 1, "name": "mark-1" }, | ||
| { "x": 3.5, "y": 4.9, "id": 2, "name": "mark-2" }, | ||
| { "x": -3.5, "y": -4.9, "id": 2, "name": "mark-3" }, | ||
| { "x": 3.5, "y": -4.9, "id": 2, "name": "mark-4" }, | ||
| { "x": 6.0, "y": -0.0, "id": 2, "name": "mark-5" } | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Path coordinates. Note that +Y is upward (not downward in an image | ||
| # processing sense). | ||
| -4 4 | ||
daxhaw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| -3 4 | ||
| -2.5 3.5 | ||
| -2.2 3.2 | ||
| -2 2.5 | ||
| -2.3 2.2 | ||
| -3 2.0 | ||
| -4 2 | ||
| -4.5 1.5 | ||
| -4.4 1 | ||
| -4 1 | ||
| -3 1 | ||
| -2.5 0.5 | ||
| -2.4 0 | ||
| -2.3 -1 | ||
| -2.8 -1.2 | ||
| -3.5 -1.3 | ||
| -4.0 -2.0 | ||
| -4.0 -3.0 | ||
| -3.5 -3.5 | ||
| -2.5 -4.0 | ||
| -1.5 -4.0 | ||
| -0.5 -4 | ||
| 0.5 -3.9 | ||
| 0.8 -3.2 | ||
| 1.5 -2 | ||
| 1.9 -1.5 | ||
| 1.2 -0.5 | ||
| 1.0 0.5 | ||
| 1.5 1.5 | ||
| 1.8 2.5 | ||
| 2.1 3.5 | ||
| 3 4 | ||
| 4 4 | ||
| 5 4 | ||
| 5.5 3.5 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| 1.0 1.0 | ||
| 1.0 2.0 | ||
| -1 2.0 | ||
| -5 -2.0 | ||
| 5 -2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Copyright (c) Gaia Platform LLC | ||
| # | ||
| # Use of this source code is governed by the MIT | ||
| # license that can be found in the LICENSE.txt file | ||
| # or at https://opensource.org/licenses/MIT. | ||
|
|
||
| # The purpose of this makefile is to simply execute gaiac and gaiat | ||
| # to make sure there are not errors (without executing higher level | ||
| # make). The single target then cleans up after itself. | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. empty line (mayve you should put the Gaia copyright)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file will be deleted. It's a shortcut to build ddl/rules w/o jumping back to cmake. |
||
| RULES_CPP = slam_rules.cpp | ||
| DB_NAME = slam | ||
| INC = -I/opt/gaia/include/ -Islam/ -I../include/ | ||
|
|
||
| OBJS = slam_rules.o slam/gaia_slam.o | ||
|
|
||
| all: | ||
| gaiac slam.ddl -g --db-name $(DB_NAME) -o $(DB_NAME) | ||
| gaiat slam.ruleset -output $(RULES_CPP) -- -I/usr/lib/clang/10/include $(INC) | ||
| rm -f *.o $(RULES_CPP) | ||
| rm -rf $(DB_NAME) | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.