-
Notifications
You must be signed in to change notification settings - Fork 14
Spider milovice #1056
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
Merged
Merged
Spider milovice #1056
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f4cb881
spider.py: allow multiple start via reset already_moved
tajgr 50d0d89
go.py: add variable timeout to stop robot
tajgr d51e4a1
fix config parameters
tajgr 964ead3
followpath.py: add support for pose3d
tajgr 57ae524
spider.py: use desired steering instead of move
tajgr 5450c4f
oak_camera_v3.py: remome unnecessary import
tajgr e2c68d4
Merge branch 'master' into feature/spider-milovice
tajgr 228bc82
Merge remote-tracking branch 'refs/remotes/origin/feature/spider-milo…
tajgr cda3027
go.py: comment stop-timeout
tajgr 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 |
|---|---|---|
|
|
@@ -8,7 +8,6 @@ | |
|
|
||
| import depthai as dai | ||
| import numpy as np | ||
| import cv2 | ||
|
|
||
|
|
||
| g_logger = logging.getLogger(__name__) | ||
|
|
||
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 |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ | |
| MAX_WHEEL_ANGLE = math.radians(80) | ||
|
|
||
|
|
||
| def get_desired_angle(speed, angular_speed): | ||
| def get_desired_angle(speed, angular_speed): # TODO to handle the calculation | ||
|
Member
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. is TODO still valid?
Collaborator
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. Yes, it is. |
||
| if speed == 0: | ||
| return 0 | ||
| # The formula is similar to Kloubak but not the same because the steering geometry is different. | ||
|
|
@@ -229,7 +229,7 @@ def on_can(self, data): | |
| if status is not None: | ||
| self.publish('status', status) | ||
|
|
||
| def on_move(self, data): | ||
| def on_desired_steering(self, data): | ||
| speed_mm, desired_angle_cdeg = data | ||
| self.desired_speed = speed_mm / 1000.0 | ||
| self.desired_angle = math.radians(desired_angle_cdeg / 100.0) # one hundredth of rad | ||
|
|
@@ -241,6 +241,11 @@ def on_desired_speed(self, data): | |
| angular_speed = math.radians(angular_speed_crad / 100.0) # one hundredth of rad | ||
| self.desired_angle = get_desired_angle(self.desired_speed, angular_speed) | ||
|
|
||
| def on_reset(self, data): | ||
| # Return some parameters to default settings. It allows multiple starts. | ||
| self.pose2d = (0.0, 0.0, 0.0) | ||
| self.already_moved = False | ||
|
|
||
| def send_speed(self, data): | ||
| # set PI controller | ||
| speed_p = 200 | ||
|
|
||
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.
can you add comment what it means?
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.
Ok