-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add support from Hokuyo lidar #1186
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
mgagvani
wants to merge
6
commits into
autorope:main
Choose a base branch
from
mgagvani:hokuyo_pr
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.
+73
−9
Open
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7c8a783
[UNTESTED] Add support for Hokuyo lidar in donkeycar/parts/lidar.py a…
mgagvani ed9ca8d
lidar viz as as camera, fixes
mgagvani c4cda03
fixes addressing @Ezward review
mgagvani f3ed8a2
address comments from @DocGarbanzo
mgagvani 735bbc8
Merge remote-tracking branch 'upstream/main' into hokuyo_pr
mgagvani d1e9e47
bump version
mgagvani 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
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
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 |
|---|---|---|
|
|
@@ -106,13 +106,18 @@ def drive(cfg, model_path=None, use_joystick=False, model_type=None, | |
|
|
||
| # add lidar | ||
| if cfg.USE_LIDAR: | ||
| from donkeycar.parts.lidar import RPLidar | ||
| if cfg.LIDAR_TYPE == 'RP': | ||
| from donkeycar.parts.lidar import RPLidar | ||
| print("adding RP lidar part") | ||
| lidar = RPLidar(lower_limit = cfg.LIDAR_LOWER_LIMIT, upper_limit = cfg.LIDAR_UPPER_LIMIT) | ||
| V.add(lidar, inputs=[],outputs=['lidar/dist_array'], threaded=True) | ||
| if cfg.LIDAR_TYPE == 'YD': | ||
| print("YD Lidar not yet supported") | ||
| if cfg.LIDAR_TYPE == "HOKUYO": | ||
| from donkeycar.parts.lidar import HokuyoLidar | ||
| print("adding Hokuyo lidar part") | ||
| lidar = HokuyoLidar(max_dist = cfg.LIDAR_MAX_DIST) | ||
| V.add(lidar, inputs=[], outputs=['lidar/dist_scan'], threaded=False) | ||
|
|
||
| if cfg.HAVE_TFMINI: | ||
| from donkeycar.parts.tfmini import TFMini | ||
|
|
@@ -820,6 +825,9 @@ def get_camera(cfg): | |
| elif cfg.CAMERA_TYPE == "MOCK": | ||
| from donkeycar.parts.camera import MockCamera | ||
| cam = MockCamera(image_w=cfg.IMAGE_W, image_h=cfg.IMAGE_H, image_d=cfg.IMAGE_DEPTH) | ||
| elif cfg.CAMERA_TYPE == "LIDAR_PLOT": | ||
| from donkeycar.parts.lidar import LidarPlot2 | ||
| cam = LidarPlot2(resolution=(cfg.IMAGE_H, cfg.IMAGE_W)) | ||
| else: | ||
| raise(Exception("Unkown camera type: %s" % cfg.CAMERA_TYPE)) | ||
| return cam | ||
|
|
@@ -872,7 +880,22 @@ def add_camera(V, cfg, camera_type): | |
| outputs=['cam/image_array', 'cam/depth_array', | ||
| 'imu/acl_x', 'imu/acl_y', 'imu/acl_z', | ||
| 'imu/gyr_x', 'imu/gyr_y', 'imu/gyr_z'], | ||
| threaded=False) | ||
|
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. This should be left a threaded part. |
||
|
|
||
|
|
||
| elif cfg.CAMERA_TYPE == "LIDAR_PLOT": | ||
mgagvani marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| from donkeycar.parts.lidar import LidarPlot2 | ||
| cam = LidarPlot2( | ||
| resolution=(cfg.IMAGE_W, cfg.IMAGE_H), | ||
| rotate_plot=cfg.LIDAR_ANGLE_OFFSET, | ||
| max_dist=cfg.LIDAR_MAX_DIST, | ||
| plot_type=LidarPlot2.PLOT_TYPE_CIRCLE, | ||
| mark_px=1 | ||
| ) | ||
| V.add(cam, inputs=['lidar/dist_scan'], | ||
| outputs=['cam/image_array'], | ||
| threaded=True) | ||
|
|
||
| else: | ||
| inputs = [] | ||
| outputs = ['cam/image_array'] | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls remove commented code.