Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
von-bis-public
VectorProjects
Yoshi
Commits
ec2cb759
Commit
ec2cb759
authored
Feb 29, 2020
by
JoelMXLinux
Browse files
Merge branch 'master' of git.scc.kit.edu:prog3-2019/yoshi
parents
1208a28c
ea3ee5f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
navigation.py
View file @
ec2cb759
...
@@ -53,9 +53,7 @@ def search(robot, predictor):
...
@@ -53,9 +53,7 @@ def search(robot, predictor):
i
=
0
i
=
0
i
+=
1
i
+=
1
print
(
'Keep Searching, taking new picture'
)
print
(
'Keep Searching, taking new picture'
)
if
i
>=
4
:
robot
.
behavior
.
drive_straight
(
distance_mm
(
200
),
speed_mmps
(
150
))
i
=
1
robot
.
behavior
.
turn_in_place
(
degrees
(
96
))
robot
.
behavior
.
turn_in_place
(
degrees
(
96
))
result_of_search
=
evaluate_picture
(
robot
,
predictor
,
BALLOON_SIZE_MM
)
result_of_search
=
evaluate_picture
(
robot
,
predictor
,
BALLOON_SIZE_MM
)
print
(
'Result of Search: '
,
result_of_search
)
print
(
'Result of Search: '
,
result_of_search
)
...
...
support.py
View file @
ec2cb759
"""
"""
All necessary utilities (take and evaluate a picture, estimate position, drive towards position,...)
All necessary utilities (take and evaluate a picture, estimate position, drive towards position,...)
are implemented in this modul
are implemented in this modul
e
"""
"""
import
configparser
import
configparser
...
@@ -26,7 +26,7 @@ INITIALIZED = False
...
@@ -26,7 +26,7 @@ INITIALIZED = False
class
img_prediction
(
object
):
class
img_prediction
(
object
):
"""
"""
A class to perform a neccessary step
t
to evaluate a
n
picte:
A class to perform a neccessary step to evaluate a pict
ur
e:
Initialize a connection to cloud model
Initialize a connection to cloud model
1. Take a picture (in online or offline format)
1. Take a picture (in online or offline format)
2. Evaluate the picture online
2. Evaluate the picture online
...
@@ -371,12 +371,12 @@ def drive_towards_pose(robot, data, MAX_DRIVING_DISTANCE=600):
...
@@ -371,12 +371,12 @@ def drive_towards_pose(robot, data, MAX_DRIVING_DISTANCE=600):
def
evaluate_picture
(
robot
,
img_prediction
,
balloon_size
=
BALLOON_SIZE_MM
):
def
evaluate_picture
(
robot
,
img_prediction
,
balloon_size
=
BALLOON_SIZE_MM
):
"""
"""
Fundamental function that does the entire pictur
a
e evaluation process
Fundamental function that does the entire picture evaluation process
this includes:
this includes:
1. Taking a picture
1. Taking a picture
2. Getting information about the content
2. Getting information about the content
3. Dynamically setting the balloon size
3. Dynamically setting the balloon size
4. Calculating the turn degree
i
nd distance
4. Calculating the turn degree
a
nd distance
5. Evaluating the relation of robot and balloon
5. Evaluating the relation of robot and balloon
Optional: Uncomment for online image prediction
Optional: Uncomment for online image prediction
...
@@ -431,7 +431,7 @@ def evaluate_picture(robot, img_prediction, balloon_size=BALLOON_SIZE_MM):
...
@@ -431,7 +431,7 @@ def evaluate_picture(robot, img_prediction, balloon_size=BALLOON_SIZE_MM):
try
:
try
:
results
[
'robot'
]
results
[
'robot'
]
robot_left
=
results
[
'robot'
][
0
]
robot_left
=
results
[
'robot'
][
0
]
robot_right
=
robot_left
+
results
[
'
balloon
'
][
2
]
robot_right
=
robot_left
+
results
[
'
robot
'
][
2
]
robot_middle
=
(
robot_left
+
robot_right
)
/
2
robot_middle
=
(
robot_left
+
robot_right
)
/
2
if
not
INITIALIZED
:
if
not
INITIALIZED
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment