-
Notifications
You must be signed in to change notification settings - Fork 15
[RSDK-8749] add FakeServo, servo data capture #512
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
[RSDK-8749] add FakeServo, servo data capture #512
Conversation
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.
LGTM
micro-rdk/src/common/servo.rs
Outdated
#[derive(DoCommand)] | ||
pub struct FakeServo { | ||
pos: u32, | ||
pow: u32, |
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.
is pow
meaningful to include? It never appears to change
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.
Code looks fine, though the FakeServo
has some somewhat inconsistent behavior. I don't know if we expect fakes to be even at all a little realistic, so maybe it doesn't matter.
micro-rdk/src/common/servo.rs
Outdated
Ok(self.pow > 0) | ||
} | ||
fn stop(&mut self) -> Result<(), super::actuator::ActuatorError> { | ||
self.pos = 0; |
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.
If the stop
method set pow
to 0, then it would also resolve the comment above about pow
never changing. But, it isn't clear to me that 0
pow
is actually the stopped state for a servo?
micro-rdk/src/common/servo.rs
Outdated
#[cfg(feature = "builtin-components")] | ||
impl Actuator for FakeServo { | ||
fn is_moving(&mut self) -> Result<bool, super::actuator::ActuatorError> { | ||
Ok(self.pow > 0) |
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.
The fake servo moves to a new position instantaneously, so, is it ever moving? But pow is always 1, so it will also always be moving, even if no move_to
was ever called.
@acmorrow updated the I had originally based it off of our |
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.
LGTM
verified on app by enabling data collection, and making a
FakeServo
with the following attribute