Skip to content

Wheel Encoder Preliminary Rust Code#43

Merged
taesungh merged 31 commits intomainfrom
11-pod-implement-wheel-encoder-measurements-in-rust
May 18, 2024
Merged

Wheel Encoder Preliminary Rust Code#43
taesungh merged 31 commits intomainfrom
11-pod-implement-wheel-encoder-measurements-in-rust

Conversation

@SM-dot
Copy link
Copy Markdown
Contributor

@SM-dot SM-dot commented May 8, 2024

The code has been modified to utilize the rppal library for GPIO communication, ensuring compatibility with Raspberry Pi devices and enhancing reliability and performance. Updates needed in the code after testing (making sure we are able to get an output from A and B both of the new wheel encoder and is measuring a pulse accurately):

  1. Calculate velocity

@SM-dot SM-dot linked an issue May 8, 2024 that may be closed by this pull request
Copy link
Copy Markdown
Member

@taesungh taesungh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for starting on this. Please keep in mind we need a struct for each sensor rather than just a testing script.

Comment thread pod-operation/hx_wheel_encodeer Outdated
Comment thread pod-operation/hx_wheel_encodeer Outdated
Comment thread pod-operation/hx_wheel_encodeer Outdated
Comment thread pod-operation/hx_wheel_encodeer Outdated
Comment thread pod-operation/hx_wheel_encodeer Outdated
SM-dot added 2 commits May 11, 2024 00:14
- changed to struct implementation
- tracking A and B values 
- changed encoder names for simplicity
Comment thread pod-operation/hx_wheel_encodeer Outdated
Comment thread pod-operation/src/components/wheel_encoder.rs Outdated
Copy link
Copy Markdown
Member

@taesungh taesungh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also get the corresponding usage in a function in demo.rs?

ryescholin and others added 13 commits May 11, 2024 15:17
V = Distance / Time
Distance depends on the counter. If distance decreases, the velocity also decreases.
Only checking for a's last state match and not b in order to keep consistency and define a direction in order to decrease the counter accurately for each pulse.
…ystem into 11-pod-implement-wheel-encoder-measurements-in-rust
@ryescholin
Copy link
Copy Markdown
Contributor

velocity should work now (havent been able to test at high speeds, works at low), dist works fs

Comment thread pod-operation/src/components/wheel_encoder.rs Outdated
Comment thread pod-operation/src/components/wheel_encoder.rs
Copy link
Copy Markdown
Member

@taesungh taesungh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice start, some questions about the implementation.

Comment thread pod-operation/src/components/wheel_encoder.rs
Comment thread pod-operation/src/components/wheel_encoder.rs Outdated
Comment thread pod-operation/src/components/wheel_encoder.rs Outdated
Copy link
Copy Markdown
Contributor

@ryescholin ryescholin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works

Copy link
Copy Markdown
Member

@taesungh taesungh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sake of unblocking #45, we can proceed with this for now, but we'll want to revisit using the full encoder resolution (currently just half) and measuring the velocity on each counter change.

@taesungh taesungh dismissed their stale review May 18, 2024 20:50

Will revisit improvements later. Squashing for now to unblock.

@taesungh taesungh merged commit 7562c47 into main May 18, 2024
@taesungh taesungh deleted the 11-pod-implement-wheel-encoder-measurements-in-rust branch May 29, 2024 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Pod] Implement wheel encoder measurements in Rust

4 participants