-
Notifications
You must be signed in to change notification settings - Fork 56
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
Power-Panic Service #1657
base: main
Are you sure you want to change the base?
Power-Panic Service #1657
Conversation
add rodio to toplevel toml implement first iteration of dbus communiton (get battery) add loop in main function move power-panic from tools/ to services/ adapt Cargo.toml to new project structure add crosscompilation flag to Cargo.toml fix errorhandling
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.
Just some minor remarks, nice work 👍
reorder imports refactor if statement use imports instead of qualifiers remove one unnecessary println!
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.
Looks really good, just one more request :)
let battery = get_battery_info().await?; | ||
println!("Battery: {:?}", battery); | ||
|
||
let mut time_to_sleep = 60; |
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.
Please try to use sophisticated types, in this case Duration
for representing time. When coding your time as an integer, it is not clear whether you mean seconds, minutes, etc. . You can read more about it here: https://refactoring.guru/smells/primitive-obsession
Why? What?
Implementation of an service, that provides auditive Feedback when the battery of the NAO runs out.
ToDo / Known Issues
The service still needs to be added to the meta-nao repository so that it becomes part of the image.
You may can argue about the time-interval of the sound. Right now it is played every charge in % in seconds.
Ideas for Next Iterations (Not This PR)
In the next iteration you think of a possibility to mute the alarm.
How to Test
After creating the binary of the service with
./pepsi build power-panic
you will find the binary in
~/worktree/hulk/services/power-panic/target/debug
.Copy the binary to a NAO e. g. using
rsync power-panic [email protected]:~/hulk/bin/
and execute it by connecting to the robot e. g. with
./pepsi shell x