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
a81c1519
Commit
a81c1519
authored
6 months ago
by
Samuel Tardieu
Browse files
Options
Downloads
Patches
Plain Diff
Better phrasing and typing for controller module
parent
5ccb7a62
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!11
Better phrasing and typing for controller module
Pipeline
#98545
passed
6 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
controller/python/controller.py
+3
-3
3 additions, 3 deletions
controller/python/controller.py
with
3 additions
and
3 deletions
controller/python/controller.py
+
3
−
3
View file @
a81c1519
import
struct
from
numbers
import
Real
from
typing
import
Any
,
Optional
from
typing
import
Optional
# Major and minor version of required firmware
_REQUIRED_FIRMWARE_VERSION
=
(
0
,
4
)
...
...
@@ -144,8 +144,8 @@ class Controller:
sense. Return a pair with left and right data.
"""
return
self
.
_read
(
self
.
ENCODER_TICKS
,
4
,
"
hh
"
)
def
get_status
(
self
)
->
dict
[
str
,
Any
]:
"""
Return a dict with
various
status fields:
def
get_status
(
self
)
->
dict
[
str
,
bool
]:
"""
Return a dict with status fields:
-
"
moving
"
: True if at least one motor is moving, False otherwise
-
"
automatic
"
: True if the motors are in automatic mode, False otherwise
"""
(
status
,)
=
self
.
_read
(
self
.
STATUS
,
1
,
"
B
"
)
...
...
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