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
Merge requests
!55
Various changes in Python code
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Various changes in Python code
push-tmxwmklnoosx
into
main
Overview
0
Commits
3
Pipelines
2
Changes
3
Merged
Samuel Tardieu
requested to merge
push-tmxwmklnoosx
into
main
3 months ago
Overview
0
Commits
3
Pipelines
2
Changes
1
Expand
0
0
Merge request reports
Compare
version 1
version 1
1900c095
3 months ago
main (base)
and
latest version
latest version
0041d81d
3 commits,
3 months ago
version 1
1900c095
3 commits,
3 months ago
Show latest version
1 file
+
1
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
controller/python/check-firmware.py
+
8
−
4
Options
@@ -35,9 +35,13 @@ def check_firmware():
assert
c
.
get_encoder_ticks
()
==
(
0
,
0
)
print
(
"
- Check that PID coefficients can be set and read
"
)
c
.
set_pid_coefficients
(
0
,
0
,
0
)
assert
c
.
get_pid_coefficients
()
==
(
0
,
0
,
0
)
assert
c
.
get_pid_coefficients
()
==
(
(
0
,
0
)
,
(
0
,
0
),
(
0
,
0
)
)
c
.
set_pid_coefficients
(
0.25
,
0.125
,
-
0.0625
)
assert
c
.
get_pid_coefficients
()
==
(
0.25
,
0.125
,
-
0.0625
)
assert
c
.
get_pid_coefficients
()
==
(
(
0.25
,
0.25
),
(
0.125
,
0.125
),
(
-
0.0625
,
-
0.0625
),
)
print
(
"
- Check that the shutdown timeout triggers in controlled mode
"
)
c
.
set_motor_shutdown_timeout
(
0.2
)
c
.
set_pid_coefficients
(
4
,
0
,
0
)
@@ -71,11 +75,11 @@ def check_firmware():
(
left
,
right
)
=
c
.
get_encoder_ticks
()
assert
left
>
0
and
right
<
0
print
(
"
- Check that the I error accumulator is reset in non-controlled mode
"
)
assert
c
.
get_pid_i_accumulator
()
==
(
0
,
0
)
assert
c
.
get_pid_i_accumulator
s
()
==
(
0
,
0
)
print
(
"
- Check that a positive I stays behind the target
"
)
c
.
set_motor_speed
(
30
,
30
)
time
.
sleep
(
0.5
)
(
left
,
right
)
=
c
.
get_pid_i_accumulator
()
(
left
,
right
)
=
c
.
get_pid_i_accumulator
s
()
assert
left
>
0
and
right
>
0
time
.
sleep
(
1
)
Loading