-
Notifications
You must be signed in to change notification settings - Fork 61
Gamepad #2145
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
Gamepad #2145
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
3fe1970
add motion crate
pejotejo 4ef4f16
add motion crate
pejotejo 478ebe7
--wip--
pejotejo 6e69034
add new remotecontrol behavior for new motion comman
pejotejo 847e95f
implement motioncommand changes
pejotejo 9405c2e
move type definition
pejotejo 5b0578a
implement get remote_motion_comman as separate node
pejotejo b0a733b
remove unneccesary variables and fmt
pejotejo 7c4e2a4
remove unnecessary stuff
pejotejo 85dbaf6
fix rebase conflicts
pejotejo a660b33
fix: last gait progress
pejotejo 7051555
gamepad in thread
pejotejo 5d34f92
add start to start gamepad back
pejotejo cc3a566
fix rebase
pejotejo a064993
fix format und konrads changes
pejotejo fea4a78
add robot and controler step
pejotejo 166ec48
review changes: connectionerror and step based loop
pejotejo 84b7fbd
fmt
pejotejo db0d807
rename file
pejotejo 43dc987
fix controller reseting when joustick snaps
pejotejo 9d6ed1e
dead zones
pejotejo fdcd985
round dead zones
pejotejo f55a0b5
match label no data
pejotejo 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 |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| use color_eyre::Result; | ||
| use context_attribute::context; | ||
|
|
||
| use framework::MainOutput; | ||
| use linear_algebra::vector; | ||
| use serde::{Deserialize, Serialize}; | ||
| use types::{ | ||
| motion_command::{HeadMotion, MotionCommand}, | ||
| parameters::RemoteControlParameters, | ||
| }; | ||
|
|
||
| #[context] | ||
| pub struct CreationContext {} | ||
|
|
||
| #[context] | ||
| pub struct CycleContext { | ||
| remote_control_parameters: Parameter<RemoteControlParameters, "remote_control_parameters">, | ||
| } | ||
|
|
||
| #[derive(Deserialize, Serialize)] | ||
| pub struct RemoteControl {} | ||
|
|
||
| #[context] | ||
| #[derive(Default)] | ||
| pub struct MainOutputs { | ||
| pub motion_command: MainOutput<MotionCommand>, | ||
| } | ||
|
|
||
| impl RemoteControl { | ||
| pub fn new(_context: CreationContext) -> Result<Self> { | ||
| Ok(RemoteControl {}) | ||
| } | ||
|
|
||
| pub fn cycle(&mut self, context: CycleContext) -> Result<MainOutputs> { | ||
| let motion_command = MotionCommand::WalkWithVelocity { | ||
| head: HeadMotion::Center, | ||
| velocity: vector![ | ||
| context.remote_control_parameters.walk.forward, | ||
| context.remote_control_parameters.walk.left, | ||
| ], | ||
| angular_velocity: context.remote_control_parameters.walk.turn, | ||
| }; | ||
|
|
||
| Ok(MainOutputs { | ||
| motion_command: motion_command.into(), | ||
| }) | ||
| } | ||
| } |
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
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 was deleted.
Oops, something went wrong.
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.