Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DC motor driver hat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
DC motor driver hat
Commits
aa619d0f
Commit
aa619d0f
authored
3 months ago
by
Samuel Tardieu
Browse files
Options
Downloads
Patches
Plain Diff
Check status in check-firmware
parent
0555f9de
No related branches found
No related tags found
1 merge request
!52
Various changes
Pipeline
#100997
passed
3 months ago
Stage: check
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tele0592/examples/check-firmware.rs
+25
-1
25 additions, 1 deletion
tele0592/examples/check-firmware.rs
with
25 additions
and
1 deletion
tele0592/examples/check-firmware.rs
+
25
−
1
View file @
aa619d0f
...
...
@@ -15,6 +15,11 @@ fn main() -> color_eyre::Result<()> {
println!
(
"- Check firmware version consistency"
);
c
.check_firmware_version
()
?
;
println!
(
"- Check that robot is not moving and not in controlled mode"
);
let
status
=
c
.get_status
()
?
;
assert!
(
!
status
.is_moving
());
assert!
(
!
status
.is_controlled
());
println!
(
"- Check that the encoders have been reset"
);
assert_eq!
(
c
.get_encoder_ticks
()
?
,
(
0
,
0
));
...
...
@@ -57,10 +62,19 @@ fn main() -> color_eyre::Result<()> {
c
.set_raw_motor_speed
(
Some
(
30
),
Some
(
-
40
))
?
;
assert_eq!
(
c
.get_raw_motor_speed
()
?
.unwrap
(),
(
30
,
-
40
));
println!
(
"- Check that the motors are moving and are not controlled"
);
let
status
=
c
.get_status
()
?
;
assert!
(
status
.is_moving
());
assert!
(
!
status
.is_controlled
());
println!
(
"- Check that the motor can be stopped"
);
c
.set_raw_motor_speed
(
Some
(
0
),
Some
(
0
))
?
;
assert_eq!
(
c
.get_raw_motor_speed
()
?
.unwrap
(),
(
0
,
0
));
println!
(
"- Check that the status reports not moving"
);
let
status
=
c
.get_status
()
?
;
assert!
(
!
status
.is_moving
());
println!
(
"- Check that the motor can be put in standby mode"
);
c
.set_raw_motor_speed
(
None
,
None
)
?
;
assert_eq!
(
c
.get_raw_motor_speed
()
?
,
None
);
...
...
@@ -136,8 +150,13 @@ fn main() -> color_eyre::Result<()> {
println!
(
"- Check that controlled motor speed can be read back"
);
assert_eq!
(
c
.get_motor_speed
()
?
,
Some
((
30
,
-
30
)));
println!
(
"- Check that
raw motor speed can be rea
d i
n
controlled
mode
"
);
println!
(
"- Check that
the robot is moving an
d i
s
controlled"
);
thread
::
sleep
(
Duration
::
from_millis
(
100
));
let
status
=
c
.get_status
()
?
;
assert!
(
status
.is_moving
());
assert!
(
status
.is_controlled
());
println!
(
"- Check that raw motor speed can be read in controlled mode"
);
let
(
left
,
right
)
=
c
.get_raw_motor_speed
()
?
.unwrap
();
assert!
(
left
>
0
&&
right
<
0
);
...
...
@@ -145,6 +164,11 @@ fn main() -> color_eyre::Result<()> {
thread
::
sleep
(
Duration
::
from_millis
(
250
));
assert_eq!
(
c
.get_raw_motor_speed
()
?
,
None
);
println!
(
"- Check that controlled mode has been left"
);
let
status
=
c
.get_status
()
?
;
assert!
(
!
status
.is_moving
());
assert!
(
!
status
.is_controlled
());
println!
(
"- Check that a positive P goes into the right direction"
);
c
.set_motor_shutdown_timeout
(
Duration
::
from_secs
(
1
))
?
;
c
.get_encoder_ticks
()
?
;
// Reset ticks
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment