Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
localization VROB
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Böttger
localization VROB
Commits
98411da5
Commit
98411da5
authored
1 year ago
by
Jessica Dreyer
Browse files
Options
Downloads
Patches
Plain Diff
Corrected spelling mistakes
parent
f3150fad
No related branches found
No related tags found
1 merge request
!1
Development
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
driving.py
+18
-18
18 additions, 18 deletions
driving.py
with
18 additions
and
18 deletions
driving.py
+
18
−
18
View file @
98411da5
...
...
@@ -14,17 +14,17 @@ L = 2 # Value for a left turn
#%% Classes
"""
# This class co
u
ntai
o
ns some functions to analy
s
e data from the
lego
robot EV3.
# It detects the
type of the
section depending on the rotationspeed of the robot.
#
Also i
t calculate the odometrie for x-position, y-position an direction of the robot
#
and can
calculate the driven distance on a section.
# This class contains some functions to analy
z
e data from the
LEGO
robot EV3.
# It detects the section
type
depending on the rotationspeed of the robot.
#
I
t calculate
s
the odometrie for x-position, y-position an
d
direction of the robot
.
#
It
calculate
s
the driven distance on a section.
"""
class
Driving_Analyser
:
"""
# Constructor of the driving analyser.
# Need threshold values of rotationspeed for left and right turn
# and
also
a block size represent the number of
left and right turns which are sumed up to classifi
e the section type
.
# Need
s
threshold values of rotationspeed for left and right turn
# and a block size
which
represent
s
the number of
iterations to analyz
e the section type
"""
def
__init__
(
self
,
threshold_left
,
threshold_right
,
block_size
):
self
.
threshold_left
=
threshold_left
...
...
@@ -39,14 +39,14 @@ class Driving_Analyser:
self
.
driven_distance_on_section
=
0
"""
# This function detect the section type.
# For the detection
is use
the given threshold for left and right turns
# and the block size to sum up the values.
# This function detect
s
the section type.
# For the detection the given threshold for left and right turns
# and the block size to sum up the values
are used
.
# The function decides on the basis of the threshold values
# whether the current rotation speed is a left or a right turn
# and sums up these types in the amount of the block size to make the decision for the section type.
# If the function is called and the sum of values
are
lower than the block size it
'
s
return None
# If the detection of the section is completed, the function will return a integer value.
# If the function is called and the sum of values
is
lower than the block size it return
s
None
# If the detection of the section is completed, the function will return a
n
integer value.
# 0 # Value for a straight part of the track
# 1 # Value for a right turn
# 2 # Value for a left turn
...
...
@@ -71,8 +71,8 @@ class Driving_Analyser:
return
(
section_type
,
self
.
counter_left
,
self
.
counter_right
,
self
.
counter_straight
)
"""
# This function caluates the continues odometrie which add the new positon to the old one.
# The calculation of the position depend
ing
on the speed, rotationspeed and the time
.
span.
# This function cal
c
uates the continues odometrie which add
s
the new positon to the old one.
# The calculation of the position depend
s
on the speed, rotationspeed and the time
span.
"""
def
calculate_odometrie_continues
(
self
,
w
,
v
,
time_delta
):
...
...
@@ -94,8 +94,8 @@ class Driving_Analyser:
return
(
self
.
x_old
,
self
.
y_old
,
self
.
theta_old
)
"""
# This function caluates the delta odometrie which return only the delta position of the given time span.
# The calculation of the position depend
ing
on the speed, rotationspeed and the time
.
span.
# This function cal
c
uates the delta odometrie which return
s
only the delta position of the given time span.
# The calculation of the position depend
s
on the speed, rotationspeed and the time
span.
"""
def
calculate_odometrie_delta
(
self
,
w
,
v
,
time_delta
):
...
...
@@ -119,14 +119,14 @@ class Driving_Analyser:
return
self
.
driven_distance_on_section
"""
# This function
will
reset the drivien distance.
# This function reset
s
the drivien distance.
"""
def
reset_driven_distance_on_section
(
self
):
self
.
driven_distance_on_section
=
0
"""
# This function is
only
for internal use and printing.
# It
s
convert the integer values for the section type to the correct discription of the section type.
# This function is for internal use and printing
only
.
# It convert
s
the integer values for the section type to the correct discription of the section type.
"""
def
__get_section_type
(
self
,
section_type_int
):
section_type_string
=
""
...
...
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