-
Notifications
You must be signed in to change notification settings - Fork 2
Frank/trail detection node #57
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
stevenwaslander
wants to merge
22
commits into
main
Choose a base branch
from
frank/trail_detection_node
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
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
a5644d4
Trail_detection_node package
FrankZhaodong efd93a1
add psp model, change the coordinate conversion
FrankZhaodong e51e85e
Create README.md
FrankZhaodong 9beb822
Delete trail_detection_node/trail_detection_node/__pycache__ directory
FrankZhaodong 306fa05
Delete trail_detection_node/trail_detection_node/base_models directory
FrankZhaodong b3034b0
Delete trail_detection_node/trail_detection_node/GANav_visualizer.py
FrankZhaodong a5ea74b
Delete trail_detection_node/trail_detection_node/jpu.py
FrankZhaodong 4b7abe5
Delete trail_detection_node/trail_detection_node/model_store.py
FrankZhaodong f902b9e
Delete trail_detection_node/trail_detection_node/segbase.py
FrankZhaodong 7fd0167
Delete trail_detection_node/trail_detection_node/v1_trailDetectionNod…
FrankZhaodong ff03ab6
Delete trail_detection_node/trail_detection_node/visualizer_v1_trailD…
FrankZhaodong de2828e
Delete trail_detection_node/trail_detection_node/vgg.py
FrankZhaodong 7e21927
merged all the model loading part into one file
FrankZhaodong b27a0cc
deleted the fcn8s and fcn32s from the script
FrankZhaodong 6d7d978
Delete trail_detection_node/trail_detection_node/v2_trailDetectionNod…
FrankZhaodong d52f6b4
Delete trail_detection_node/trail_detection_node/visualizer_v2_trailD…
FrankZhaodong 3849886
merge visualization and msg publish node
FrankZhaodong 975fc45
Update setup.py
FrankZhaodong 9927b75
Update test.py
FrankZhaodong d42767c
Update package.xml
FrankZhaodong 5bc9924
Update README.md
FrankZhaodong 6ca4640
Update trailDetectionNode.py
FrankZhaodong 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,29 @@ | ||
| SETUP GUIDE | ||
| ============= | ||
| 1. Create a new folder named ```model``` in trail_detection_node/trail_detection_node | ||
| 2. Download ```psp_resnet50_pascal_voc_best_model.pth``` in NCRN Google Drive (Trail detection model folder) and put the file in the ```model``` folder | ||
| 3. Download ```resnet50-25c4b509.pth``` in NCRN Google Drive (Trail detection model folder) and put the file in folder ```~/.torch/models``` | ||
| 4. Build the package | ||
|
|
||
| RUN the node | ||
| ============= | ||
| ``` | ||
| ros2 run trail_detection_node trail_detection | ||
| ``` | ||
|
|
||
| Node Usage | ||
| ============= | ||
| The node has three modes, which can be controlled by setting the ```only_camera_mode```(line 175) and ```visualize```(line 188) to different value: | ||
| 1. Trail centerline publisher(default, ```only_camera_mode=False```, ```visualize=False```): subscribes to camera and lidar and publishes the centerline point(posestamp type msg) in ```velodyne``` frame in ```trail_location``` topic | ||
| 2. Trail centerline visualizer(```only_camera_mode=False```, ```visualize=True```): subscribes to camera and lidar and shows the chosen centerline point in **white**, the lidar points in **blue**, center points with no lidar points around in **yellow**, and center points with lidar points around in **red** in the image in the pop up window | ||
| 3. Only Camera mode(```only_camera_mode=True```): subscribes only to camera, runs the segmentation model, and shows the segmented trail in image in the pop up window | ||
|
|
||
| Possible issues | ||
| ============= | ||
| 1. **Model doesn't load successfully:** | ||
| Change the directory in the ```load model``` function in both ```trail_detection_node/trail_detection_node/v2_trailDetectionNode.py```(line 103 and 104) and ```trail_detection_node/trail_detection_node/visualizer_v2_trailDetectionNode.py```(line 107 and 110) | ||
| 2. **Subfolder package relative import error:** | ||
| Temporary fix: Move the script to the same folder and change the import code | ||
|
|
||
|
|
||
|
|
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,21 @@ | ||
| <?xml version="1.0"?> | ||
| <?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
| <package format="3"> | ||
| <name>trail_detection_node</name> | ||
| <version>0.0.0</version> | ||
| <description>TODO: Package description</description> | ||
| <maintainer email="zhaodong.jiang@mail.utortonto.ca">zhaodong</maintainer> | ||
| <license>TODO: License declaration</license> | ||
|
|
||
| <depend>sensor_msgs</depend> | ||
| <depend>cv_bridge</depend> | ||
|
|
||
| <test_depend>ament_copyright</test_depend> | ||
| <test_depend>ament_flake8</test_depend> | ||
| <test_depend>ament_pep257</test_depend> | ||
| <test_depend>python3-pytest</test_depend> | ||
|
|
||
| <export> | ||
| <build_type>ament_python</build_type> | ||
| </export> | ||
| </package> |
Empty file.
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,4 @@ | ||
| [develop] | ||
| script_dir=$base/lib/trail_detection_node | ||
| [install] | ||
| install_scripts=$base/lib/trail_detection_node |
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,26 @@ | ||
| from setuptools import setup | ||
|
|
||
| package_name = 'trail_detection_node' | ||
|
|
||
| setup( | ||
| name=package_name, | ||
| version='0.0.0', | ||
| packages=[package_name], | ||
| data_files=[ | ||
| ('share/ament_index/resource_index/packages', | ||
| ['resource/' + package_name]), | ||
| ('share/' + package_name, ['package.xml']), | ||
| ], | ||
| install_requires=['setuptools'], | ||
| zip_safe=True, | ||
| maintainer='zhaodong', | ||
| maintainer_email='zhaodong.jiang@mail.utoronto.ca', | ||
| description='TODO: Package description', | ||
| license='TODO: License declaration', | ||
| tests_require=['pytest'], | ||
| entry_points={ | ||
| 'console_scripts': [ | ||
| 'trail_detection = trail_detection_node.trailDetectionNode:main', | ||
| ], | ||
| }, | ||
| ) |
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,3 @@ | ||
| from trail_detection_node.trailDetectionNode import * | ||
|
|
||
| main() | ||
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,25 @@ | ||
| # Copyright 2015 Open Source Robotics Foundation, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| from ament_copyright.main import main | ||
| import pytest | ||
|
|
||
|
|
||
| # Remove the `skip` decorator once the source file(s) have a copyright header | ||
| @pytest.mark.skip(reason='No copyright header has been placed in the generated source file.') | ||
| @pytest.mark.copyright | ||
| @pytest.mark.linter | ||
| def test_copyright(): | ||
| rc = main(argv=['.', 'test']) | ||
| assert rc == 0, 'Found errors' |
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,25 @@ | ||
| # Copyright 2017 Open Source Robotics Foundation, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| from ament_flake8.main import main_with_errors | ||
| import pytest | ||
|
|
||
|
|
||
| @pytest.mark.flake8 | ||
| @pytest.mark.linter | ||
| def test_flake8(): | ||
| rc, errors = main_with_errors(argv=[]) | ||
| assert rc == 0, \ | ||
| 'Found %d code style errors / warnings:\n' % len(errors) + \ | ||
| '\n'.join(errors) |
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,23 @@ | ||
| # Copyright 2015 Open Source Robotics Foundation, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| from ament_pep257.main import main | ||
| import pytest | ||
|
|
||
|
|
||
| @pytest.mark.linter | ||
| @pytest.mark.pep257 | ||
| def test_pep257(): | ||
| rc = main(argv=['.', 'test']) | ||
| assert rc == 0, 'Found code style errors / warnings' |
Empty file.
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.