Commit ec2cb759 authored by JoelMXLinux's avatar JoelMXLinux
Browse files

Merge branch 'master' of git.scc.kit.edu:prog3-2019/yoshi

parents 1208a28c ea3ee5f1
...@@ -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)
......
""" """
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 module
""" """
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 stept to evaluate an picte: A class to perform a neccessary step to evaluate a picture:
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 picturae 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 ind distance 4. Calculating the turn degree and 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:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment