diff --git a/challenge_cleanup/src/challenge_r5/amigo/self_cleanup.py b/challenge_cleanup/src/challenge_r5/amigo/self_cleanup.py index 15f7e0c1b8..912f533caa 100644 --- a/challenge_cleanup/src/challenge_r5/amigo/self_cleanup.py +++ b/challenge_cleanup/src/challenge_r5/amigo/self_cleanup.py @@ -1,11 +1,9 @@ -import smach -import robot_smach_states import random +import robot_smach_states +import smach from robot_skills.util.kdl_conversions import FrameStamped -from robot_smach_states.util.designators import UnoccupiedArmDesignator, OccupiedArmDesignator, Designator - -from PyKDL import Frame +from robot_smach_states.util.designators import Designator, OccupiedArmDesignator, UnoccupiedArmDesignator class dropPoseDesignator(Designator): @@ -114,9 +112,9 @@ def __init__(self, robot, selected_entity_designator, location_id, segment_area) smach.StateMachine.add('CHECK_ARM_OCCUPIED', ArmOccupied(robot), transitions={"yes": "PLACE", "no": "done"}) smach.StateMachine.add('PLACE', - robot_smach_states.Place(robot, - selected_entity_designator, - place_pose, + robot_smach_states.Place(robot, + selected_entity_designator, + place_pose, OccupiedArmDesignator(robot.arms, robot.rightArm, name="occupied_arm_designator")), diff --git a/challenge_cleanup/src/challenge_r5/amigo/timeout.py b/challenge_cleanup/src/challenge_r5/amigo/timeout.py index 4d83413692..034f1008ff 100644 --- a/challenge_cleanup/src/challenge_r5/amigo/timeout.py +++ b/challenge_cleanup/src/challenge_r5/amigo/timeout.py @@ -1,6 +1,6 @@ import multiprocessing -import time import sys +import time def _target(queue, function, *args, **kwargs): diff --git a/challenge_demo/src/demo.py b/challenge_demo/src/demo.py index a90f738129..02cc5ba9fd 100755 --- a/challenge_demo/src/demo.py +++ b/challenge_demo/src/demo.py @@ -4,22 +4,22 @@ # By Matthijs van der Burgh, 2017 # ------------------------------------------------------------------------------------------------------------------------ -import sys -import rospy -import random -import json +from __future__ import print_function -import hmi +import json +import random +import sys +import rospy from action_server import Client as ActionClient +import hmi +from robocup_knowledge import load_knowledge +from robot_skills.util.kdl_conversions import FrameStamped from robot_smach_states.navigation import NavigateToWaypoint from robot_smach_states.startup import StartChallengeRobust -from robot_smach_states.utility import WaitForTrigger from robot_smach_states.util.designators import EntityByIdDesignator - -from robot_skills.util.kdl_conversions import FrameStamped -from robocup_knowledge import load_knowledge +from robot_smach_states.utility import WaitForTrigger def task_result_to_report(task_result): diff --git a/challenge_demo/test/grammar_test.py b/challenge_demo/test/grammar_test.py index 194e5869b5..cbf369e20c 100644 --- a/challenge_demo/test/grammar_test.py +++ b/challenge_demo/test/grammar_test.py @@ -1,11 +1,12 @@ import os import unittest -from ed_msgs.msg import EntityInfo -from robot_skills.mockbot import Mockbot -from robot_skills.util.entity import from_entity_info + from action_server.test_tools import test_grammar +from ed_msgs.msg import EntityInfo from robocup_knowledge import load_knowledge +from robot_skills.mockbot import Mockbot +from robot_skills.util.entity import from_entity_info class GrammarTest(unittest.TestCase): diff --git a/challenge_eegpsr/src/add_entities.py b/challenge_eegpsr/src/add_entities.py index af2b045739..8e6f119a3d 100755 --- a/challenge_eegpsr/src/add_entities.py +++ b/challenge_eegpsr/src/add_entities.py @@ -1,9 +1,9 @@ #!/usr/bin/python -import rospy import itertools import os +import rospy from fast_simulator import client if __name__ == "__main__": @@ -52,7 +52,3 @@ # People W.add_object("person-1", "loy", 4.196, 3.842, 0.0, 0, 0, 1) W.add_object("person-2", "loy", 1.416, -5.296, 0.0, 0, 0, 1) - - - - diff --git a/challenge_eegpsr/src/eegpsr.py b/challenge_eegpsr/src/eegpsr.py index a013a466d4..71904343b9 100755 --- a/challenge_eegpsr/src/eegpsr.py +++ b/challenge_eegpsr/src/eegpsr.py @@ -4,19 +4,19 @@ # By Sjoerd van den Dries, 2016 # ------------------------------------------------------------------------------------------------------------------------ +import argparse import os import sys -import rospy -import argparse import time +import rospy +from action_server.command_center import CommandCenter + +from robocup_knowledge import load_knowledge from robot_skills import get_robot from robot_smach_states.navigation import NavigateToWaypoint -from robot_smach_states.util.designators import EntityByIdDesignator -from robocup_knowledge import load_knowledge from robot_smach_states.startup import StartChallengeRobust - -from action_server.command_center import CommandCenter +from robot_smach_states.util.designators import EntityByIdDesignator # ------------------------------------------------------------------------------------------------------------------------ diff --git a/challenge_eegpsr/src/generate_command.py b/challenge_eegpsr/src/generate_command.py index df9fd1fe3e..7e7976de32 100755 --- a/challenge_eegpsr/src/generate_command.py +++ b/challenge_eegpsr/src/generate_command.py @@ -1,13 +1,14 @@ #! /usr/bin/python from __future__ import print_function -import sys import os import random +import sys from datetime import datetime from robocup_knowledge import load_knowledge + # ---------------------------------------------------------------------------------------------------- class CommandGenerator: diff --git a/challenge_eegpsr/src/test_recognition.py b/challenge_eegpsr/src/test_recognition.py index 349154493b..f095208dbe 100755 --- a/challenge_eegpsr/src/test_recognition.py +++ b/challenge_eegpsr/src/test_recognition.py @@ -1,14 +1,16 @@ #! /usr/bin/python +from __future__ import print_function + import os import sys + import rospy +from action_server.command_center import CommandCenter from robocup_knowledge import load_knowledge from robot_skills import get_robot_from_argv -import action_server -from action_server.command_center import CommandCenter # ---------------------------------------------------------------------------------------------------- diff --git a/challenge_eegpsr/test/navigate_in_front_of.py b/challenge_eegpsr/test/navigate_in_front_of.py index 0748681d63..646d6b0ea0 100755 --- a/challenge_eegpsr/test/navigate_in_front_of.py +++ b/challenge_eegpsr/test/navigate_in_front_of.py @@ -1,6 +1,12 @@ #!/usr/bin/env python -import rospy, sys, robot_smach_states, random +from __future__ import print_function + +import random +import robot_smach_states +import rospy +import sys + from robot_skills import get_robot_from_argv if __name__ == "__main__": @@ -46,6 +52,3 @@ robot.speech.speak(segmented_entities.error_msg) robot.head.close() - - - diff --git a/challenge_final/scripts/challenge_final b/challenge_final/scripts/challenge_final index 012c092b8e..54bee17470 100755 --- a/challenge_final/scripts/challenge_final +++ b/challenge_final/scripts/challenge_final @@ -3,12 +3,10 @@ # System import rospy -# TU/e Robotics -from robot_smach_states.util.startup import startup - # Challenge where is this from challenge_final import Final - +# TU/e Robotics +from robot_smach_states.util.startup import startup if __name__ == '__main__': rospy.init_node('state_machine_rwc2019') diff --git a/challenge_final/src/challenge_final/clustering.py b/challenge_final/src/challenge_final/clustering.py index 18ec679bb3..0321eb0dcd 100644 --- a/challenge_final/src/challenge_final/clustering.py +++ b/challenge_final/src/challenge_final/clustering.py @@ -1,11 +1,11 @@ +import matplotlib.pyplot as plt import pickle -from collections import defaultdict import pprint -import numpy as np +from collections import defaultdict +from sklearn.cluster import KMeans -import matplotlib.pyplot as plt +import numpy as np -from sklearn.cluster import KMeans # ToDo: replace with better algorithm diff --git a/challenge_final/src/challenge_final/display_orders_on_map.py b/challenge_final/src/challenge_final/display_orders_on_map.py index cf9eb741f9..3b139b6549 100644 --- a/challenge_final/src/challenge_final/display_orders_on_map.py +++ b/challenge_final/src/challenge_final/display_orders_on_map.py @@ -1,14 +1,17 @@ +from __future__ import print_function + import os -import cv2 -import numpy as np -from datetime import datetime +import rospkg import traceback +from datetime import datetime +import cv2 +import cv_bridge +import numpy as np # ROS import rospy + import smach -import cv_bridge -import rospkg def color_map(N=256, normalized=False): @@ -181,5 +184,3 @@ def execute(self, ud): sm = DisplayOrdersOnMap(robot=_robot) print(sm.execute(user_data)) - - diff --git a/challenge_final/src/challenge_final/find_people.py b/challenge_final/src/challenge_final/find_people.py index 606df39bff..e89fc88e5f 100644 --- a/challenge_final/src/challenge_final/find_people.py +++ b/challenge_final/src/challenge_final/find_people.py @@ -3,12 +3,11 @@ import math import os import pickle - -import numpy as np import time from collections import deque # ROS +import numpy as np import PyKDL as kdl import rospy import smach @@ -18,7 +17,6 @@ import robot_smach_states as states import robot_smach_states.util.designators as ds from robot_skills.util import kdl_conversions - from .clustering import cluster_people WAYPOINT_ID = "find_people_waypoint" diff --git a/challenge_final/src/challenge_final/get_orders.py b/challenge_final/src/challenge_final/get_orders.py index 88ac061e19..d77cb004ef 100644 --- a/challenge_final/src/challenge_final/get_orders.py +++ b/challenge_final/src/challenge_final/get_orders.py @@ -1,8 +1,9 @@ +from __future__ import print_function + # ROS import rospy import smach - # TU/e Robotics import robot_smach_states as states from challenge_final.select_option_for_image import SelectOptionForImage @@ -177,5 +178,3 @@ def speak(*args, **kwargs): print(sm.execute(user_data)) print([person_dict['selection'] for person_dict in user_data['detected_people']]) - - diff --git a/challenge_final/src/challenge_final/lightsaber.py b/challenge_final/src/challenge_final/lightsaber.py index 7f63506c79..2ddff27890 100644 --- a/challenge_final/src/challenge_final/lightsaber.py +++ b/challenge_final/src/challenge_final/lightsaber.py @@ -1,12 +1,10 @@ # ROS from threading import Event -import message_filters import rospy import smach import std_msgs.msg from geometry_msgs.msg import PoseStamped -from sensor_msgs.msg import CameraInfo, Image # TU/e Robotics import robot_smach_states as states diff --git a/challenge_final/src/challenge_final/navigate_to_and_grab_rack.py b/challenge_final/src/challenge_final/navigate_to_and_grab_rack.py index 0a0bde067b..ec0fd59967 100644 --- a/challenge_final/src/challenge_final/navigate_to_and_grab_rack.py +++ b/challenge_final/src/challenge_final/navigate_to_and_grab_rack.py @@ -5,17 +5,18 @@ # \author Rein Appeldoorn import math import os - import rospkg + import rospy from dynamic_reconfigure.client import Client from geometry_msgs.msg import PoseStamped, Quaternion +from tf.transformations import quaternion_from_euler + from robot_skills import Hero from robot_smach_states import NavigateToSymbolic from robot_smach_states.navigation.control_to_pose import ControlParameters, ControlToPose from robot_smach_states.util.designators import EdEntityDesignator -from smach import StateMachine, cb_interface, CBState -from tf.transformations import quaternion_from_euler +from smach import CBState, StateMachine, cb_interface class GrabRack(StateMachine): diff --git a/challenge_final/src/challenge_final/select_image_by_letter.py b/challenge_final/src/challenge_final/select_image_by_letter.py index fa19650197..ba4308a9ed 100644 --- a/challenge_final/src/challenge_final/select_image_by_letter.py +++ b/challenge_final/src/challenge_final/select_image_by_letter.py @@ -7,7 +7,7 @@ import math import os import pickle -import random +import rospkg import time from collections import deque from datetime import datetime @@ -15,14 +15,14 @@ import PyKDL import cv2 import numpy as np -import rospkg import rospy from cv_bridge import CvBridge from geometry_msgs.msg import PointStamped + +from challenge_find_my_mates.cluster import cluster_people from robot_skills import Hero from robot_skills.util import kdl_conversions -from smach import StateMachine, cb_interface, CBState -from challenge_find_my_mates.cluster import cluster_people +from smach import CBState, StateMachine, cb_interface NUM_LOOKS = 2 PERSON_DETECTIONS = [] diff --git a/challenge_final/src/challenge_final/select_option_for_image.py b/challenge_final/src/challenge_final/select_option_for_image.py index 9eb2f282a6..f81f22274c 100644 --- a/challenge_final/src/challenge_final/select_option_for_image.py +++ b/challenge_final/src/challenge_final/select_option_for_image.py @@ -1,18 +1,17 @@ from __future__ import print_function import sys -import cv2 from threading import Event -# ROS -import rospy -import smach +import cv2 import cv_bridge -from std_msgs.msg import String +import rospy from sensor_msgs.msg import Image - +from std_msgs.msg import String from telegram_ros.msg import Options +import smach + class SelectOptionForImage(smach.State): def __init__(self, robot, options, @@ -120,7 +119,6 @@ def _handle_reply(self, msg): if __name__ == '__main__': - from robot_skills import get_robot if len(sys.argv) > 1: robot_name = sys.argv[1] @@ -154,5 +152,3 @@ def speak(*args, **kwargs): else: print("Please provide robot name as argument.") exit(1) - - diff --git a/challenge_final/test/test_find_and_order.py b/challenge_final/test/test_find_and_order.py index cfd3d7acb1..bdc0423d49 100644 --- a/challenge_final/test/test_find_and_order.py +++ b/challenge_final/test/test_find_and_order.py @@ -1,7 +1,8 @@ import argparse + import rospy -import smach +import smach from challenge_final import FindPeople, GetOrders from robot_skills import get_robot diff --git a/challenge_final/test/test_find_people.py b/challenge_final/test/test_find_people.py index e2b04b617f..2eb18c13db 100644 --- a/challenge_final/test/test_find_people.py +++ b/challenge_final/test/test_find_people.py @@ -1,12 +1,12 @@ import argparse import pickle + import rospy + import smach -from challenge_final import FindPeople from challenge_final.find_people import _filter_and_cluster_images from robot_skills import get_robot - if __name__ == "__main__": parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) diff --git a/challenge_final/test/test_get_drinks.py b/challenge_final/test/test_get_drinks.py index 1833134c3c..0bc9248140 100644 --- a/challenge_final/test/test_get_drinks.py +++ b/challenge_final/test/test_get_drinks.py @@ -1,10 +1,10 @@ import argparse + import rospy from challenge_final import GetDrinks from robot_skills import get_robot - if __name__ == "__main__": parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) diff --git a/challenge_final/test/test_lightsaber.py b/challenge_final/test/test_lightsaber.py index 1c6722f3b3..58ec989d69 100644 --- a/challenge_final/test/test_lightsaber.py +++ b/challenge_final/test/test_lightsaber.py @@ -1,10 +1,10 @@ import argparse + import rospy from challenge_final import LightSaber from robot_skills import get_robot - if __name__ == "__main__": parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) diff --git a/challenge_find_my_mates/src/challenge_find_my_mates/cluster.py b/challenge_find_my_mates/src/challenge_find_my_mates/cluster.py index a25920dcb9..3049704800 100644 --- a/challenge_find_my_mates/src/challenge_find_my_mates/cluster.py +++ b/challenge_find_my_mates/src/challenge_find_my_mates/cluster.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import pickle from collections import defaultdict import pprint diff --git a/challenge_following_and_guiding/test/test_challenge_following_and_guiding.py b/challenge_following_and_guiding/test/test_challenge_following_and_guiding.py index f97d2991a4..785a68f2eb 100755 --- a/challenge_following_and_guiding/test/test_challenge_following_and_guiding.py +++ b/challenge_following_and_guiding/test/test_challenge_following_and_guiding.py @@ -1,5 +1,7 @@ #!/usr/bin/python +from __future__ import print_function + import rospy from fast_simulator import client diff --git a/challenge_gpsr/src/gpsr.py b/challenge_gpsr/src/gpsr.py index 7656b23b31..7a01be1ac4 100755 --- a/challenge_gpsr/src/gpsr.py +++ b/challenge_gpsr/src/gpsr.py @@ -4,23 +4,20 @@ # By Rokus Ottervanger, 2017 # ------------------------------------------------------------------------------------------------------------------------ -import sys -import rospy import random +import sys -import hmi - +import rospy from action_server import Client as ActionClient +import hmi +from conversation_engine import ConversationEngine +from robocup_knowledge import load_knowledge from robot_skills import get_robot from robot_smach_states.navigation import NavigateToWaypoint from robot_smach_states.startup import StartChallengeRobust from robot_smach_states.util.designators import EntityByIdDesignator -from robocup_knowledge import load_knowledge - -from conversation_engine import ConversationEngine - class ConversationEngineWithHmi(ConversationEngine): def __init__(self, robot, grammar, command_target, knowledge): diff --git a/challenge_gpsr/test/test_recognition.py b/challenge_gpsr/test/test_recognition.py index 8e4ebf342b..aa57400c87 100755 --- a/challenge_gpsr/test/test_recognition.py +++ b/challenge_gpsr/test/test_recognition.py @@ -1,11 +1,13 @@ #! /usr/bin/python +import random import sys + import rospy -import random -from robocup_knowledge import load_knowledge from hmi import TimeoutException +from robocup_knowledge import load_knowledge + knowledge = load_knowledge('challenge_gpsr') diff --git a/challenge_help_me_carry/test/test_challenge_help_me_carry.py b/challenge_help_me_carry/test/test_challenge_help_me_carry.py index 1771567dc3..6d6422e83d 100755 --- a/challenge_help_me_carry/test/test_challenge_help_me_carry.py +++ b/challenge_help_me_carry/test/test_challenge_help_me_carry.py @@ -1,5 +1,7 @@ #!/usr/bin/python +from __future__ import print_function + import rospy from fast_simulator import client diff --git a/challenge_manipulation/src/manipulation.py b/challenge_manipulation/src/manipulation.py index 9dfad7b950..e33f9fa2a6 100755 --- a/challenge_manipulation/src/manipulation.py +++ b/challenge_manipulation/src/manipulation.py @@ -19,6 +19,8 @@ - the bounding box of the object.' """ +from __future__ import print_function + import rospy import smach diff --git a/challenge_manipulation/src/pdf.py b/challenge_manipulation/src/pdf.py index 756c76d0d3..f3c46f846f 100755 --- a/challenge_manipulation/src/pdf.py +++ b/challenge_manipulation/src/pdf.py @@ -1,4 +1,7 @@ #!/usr/bin/python + +from __future__ import print_function + import rospy from xhtml2pdf import pisa diff --git a/challenge_navigation/src/challenge_navigation.py b/challenge_navigation/src/challenge_navigation.py index 297ff2b6d5..34b7de4875 100755 --- a/challenge_navigation/src/challenge_navigation.py +++ b/challenge_navigation/src/challenge_navigation.py @@ -1,5 +1,7 @@ #!/usr/bin/env python +from __future__ import print_function + import rospy import smach import sys diff --git a/challenge_presentation/src/challenge_presentation/presentation_hero.py b/challenge_presentation/src/challenge_presentation/presentation_hero.py index 35148406d1..d5eab8d88e 100755 --- a/challenge_presentation/src/challenge_presentation/presentation_hero.py +++ b/challenge_presentation/src/challenge_presentation/presentation_hero.py @@ -1,5 +1,7 @@ #!/usr/bin/env python +from __future__ import print_function + # ROS import rospy import smach diff --git a/challenge_receptionist/src/challenge_receptionist/find_empty_seat.py b/challenge_receptionist/src/challenge_receptionist/find_empty_seat.py index 65e757b717..f98599c466 100755 --- a/challenge_receptionist/src/challenge_receptionist/find_empty_seat.py +++ b/challenge_receptionist/src/challenge_receptionist/find_empty_seat.py @@ -1,4 +1,7 @@ #! /usr/bin/env python + +from __future__ import print_function + import rospy import robot_smach_states as states import robot_smach_states.util.designators as ds diff --git a/challenge_receptionist/src/challenge_receptionist/introduce_guest.py b/challenge_receptionist/src/challenge_receptionist/introduce_guest.py index 7f62fa87d7..1bbc9e4060 100644 --- a/challenge_receptionist/src/challenge_receptionist/introduce_guest.py +++ b/challenge_receptionist/src/challenge_receptionist/introduce_guest.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import rospy import robot_smach_states as states import robot_smach_states.util.designators as ds diff --git a/challenge_restaurant/src/challenge_restaurant/take_orders.py b/challenge_restaurant/src/challenge_restaurant/take_orders.py index d7154ad79a..48de87a910 100644 --- a/challenge_restaurant/src/challenge_restaurant/take_orders.py +++ b/challenge_restaurant/src/challenge_restaurant/take_orders.py @@ -1,5 +1,7 @@ #!/usr/bin/python +from __future__ import print_function + # System import random @@ -164,7 +166,7 @@ def execute(self, userdata=None): if len(sys.argv) < 2: print("Please provide robot name as argument.") sys.exit(1) - + robot_name = sys.argv[1] rospy.init_node('test_take_orders') @@ -184,4 +186,4 @@ def execute(self, userdata=None): sm.execute() rospy.loginfo("Orders {}".format(orders)) - + diff --git a/challenge_rips/src/challenge_rips/rips.py b/challenge_rips/src/challenge_rips/rips.py index 40fd6d8367..d24ff8ea8c 100755 --- a/challenge_rips/src/challenge_rips/rips.py +++ b/challenge_rips/src/challenge_rips/rips.py @@ -1,8 +1,9 @@ #!/usr/bin/env python import rospy -import smach +import smach +from robocup_knowledge import load_knowledge from robot_smach_states.human_interaction import AskContinue, Say from robot_smach_states.navigation import NavigateToWaypoint from robot_smach_states.reset import ResetED @@ -10,8 +11,6 @@ from robot_smach_states.util.designators import EntityByIdDesignator, analyse_designators from robot_smach_states.util.startup import startup -from robocup_knowledge import load_knowledge - challenge_knowledge = load_knowledge('challenge_rips') STARTING_POINT = challenge_knowledge.starting_point diff --git a/challenge_rips/src/challenge_rips/testexec.py b/challenge_rips/src/challenge_rips/testexec.py index f9286f54d7..79cd1d9bc2 100755 --- a/challenge_rips/src/challenge_rips/testexec.py +++ b/challenge_rips/src/challenge_rips/testexec.py @@ -1,25 +1,24 @@ #!/usr/bin/python +import sys + import rospy +import robot_smach_states as states from robot_skills.amigo import Amigo from robot_skills.sergio import Sergio -import robot_smach_states as states - -import sys - from robot_smach_states.util.designators import Designator # def setup_statemachine(robot): -# sm = smach.StateMachine(outcomes=['Done','Aborted']) +# sm = smach.StateMachine(outcomes=['Done','Aborted']) -# with sm: -# smach.StateMachine.add('DRIVE', -# states.NavigateToPose(robot, x = 1, y = 3, rz = -1.57), -# transitions={ 'arrived':'Done', -# 'unreachable':'Aborted', -# 'goal_not_defined':'Aborted'}) +# with sm: +# smach.StateMachine.add('DRIVE', +# states.NavigateToPose(robot, x = 1, y = 3, rz = -1.57), +# transitions={ 'arrived':'Done', +# 'unreachable':'Aborted', +# 'goal_not_defined':'Aborted'}) ############################## initializing program ############################## if __name__ == '__main__': @@ -28,11 +27,11 @@ if len(sys.argv) > 1: robot_name = sys.argv[1] if robot_name == 'sergio': - robot = Sergio() + robot = Sergio() elif robot_name == 'amigo': - robot = Amigo() + robot = Amigo() else: - robot = Amigo() + robot = Amigo() #testexec = states.NavigateToPose(robot, 3, 1, -1.57, 0.15) testexec = states.NavigateToObserve(robot, Designator("dinner_table")) diff --git a/challenge_serving_drinks/src/challenge_serving_drinks/get_order.py b/challenge_serving_drinks/src/challenge_serving_drinks/get_order.py index 9fccfd0ee7..c5c99409a2 100644 --- a/challenge_serving_drinks/src/challenge_serving_drinks/get_order.py +++ b/challenge_serving_drinks/src/challenge_serving_drinks/get_order.py @@ -1,3 +1,5 @@ +from __future__ import print_function + # ROS import smach diff --git a/challenge_set_a_table/src/challenge_set_a_table_states/fetch_command.py b/challenge_set_a_table/src/challenge_set_a_table_states/fetch_command.py index ae6a26e807..4913281c9d 100644 --- a/challenge_set_a_table/src/challenge_set_a_table_states/fetch_command.py +++ b/challenge_set_a_table/src/challenge_set_a_table_states/fetch_command.py @@ -1,5 +1,7 @@ #! /usr/bin/env python +from __future__ import print_function + # ROS import rospy import smach diff --git a/challenge_set_the_table/src/challenge_set_the_table/navigate_to_and_place_item_on_table.py b/challenge_set_the_table/src/challenge_set_the_table/navigate_to_and_place_item_on_table.py index beb11af8d8..6f2ec4c080 100644 --- a/challenge_set_the_table/src/challenge_set_the_table/navigate_to_and_place_item_on_table.py +++ b/challenge_set_the_table/src/challenge_set_the_table/navigate_to_and_place_item_on_table.py @@ -4,6 +4,8 @@ # # \author Rein Appeldoorn +from __future__ import print_function + import copy import math import os diff --git a/challenge_speech_recognition/src/direct_speech_recognition.py b/challenge_speech_recognition/src/direct_speech_recognition.py index e7fcb91246..91ae91c632 100644 --- a/challenge_speech_recognition/src/direct_speech_recognition.py +++ b/challenge_speech_recognition/src/direct_speech_recognition.py @@ -1,5 +1,7 @@ #!/usr/bin/python +from __future__ import print_function + import rospy import smach import sys diff --git a/challenge_speech_recognition/src/generate_random_question.py b/challenge_speech_recognition/src/generate_random_question.py index b3cfe1b4f7..bc646f4015 100755 --- a/challenge_speech_recognition/src/generate_random_question.py +++ b/challenge_speech_recognition/src/generate_random_question.py @@ -1,5 +1,7 @@ #!/usr/bin/python +from __future__ import print_function + import re import random diff --git a/challenge_speech_recognition/src/indirect_speech_recognition.py b/challenge_speech_recognition/src/indirect_speech_recognition.py index a72bb35088..b2ac57604f 100644 --- a/challenge_speech_recognition/src/indirect_speech_recognition.py +++ b/challenge_speech_recognition/src/indirect_speech_recognition.py @@ -1,5 +1,7 @@ #!/usr/bin/python +from __future__ import print_function + import rospy import smach import sys diff --git a/challenge_spr/src/challenge_spr.py b/challenge_spr/src/challenge_spr.py index a02f8f0861..d12c517524 100755 --- a/challenge_spr/src/challenge_spr.py +++ b/challenge_spr/src/challenge_spr.py @@ -1,20 +1,19 @@ #! /usr/bin/env python -import rospy -import smach import math -from robot_smach_states.human_interaction.answer_questions import HearAndAnswerQuestions +import rospy + +import robot_smach_states.util.designators as ds +import smach +from challenge_spr_states import bluff_game, detect +from robocup_knowledge import load_knowledge from robot_smach_states.human_interaction import Say, WaitForPersonInFront +from robot_smach_states.human_interaction.answer_questions import HearAndAnswerQuestions from robot_smach_states.navigation import ForceDrive -from robot_smach_states.utility import Initialize, WaitTime from robot_smach_states.util.startup import startup -import robot_smach_states.util.designators as ds - -from challenge_spr_states import detect -from challenge_spr_states import bluff_game +from robot_smach_states.utility import Initialize, WaitTime -from robocup_knowledge import load_knowledge knowledge = load_knowledge('challenge_spr') common_knowledge = load_knowledge('common') diff --git a/challenge_spr/src/challenge_spr_states/bluff_game.py b/challenge_spr/src/challenge_spr_states/bluff_game.py index 699b86f1b7..2debf4cea3 100755 --- a/challenge_spr/src/challenge_spr_states/bluff_game.py +++ b/challenge_spr/src/challenge_spr_states/bluff_game.py @@ -1,15 +1,14 @@ #!/usr/bin/python -import threading -import rospy -import smach import math +import threading -from robot_smach_states.util.startup import startup +import rospy +from riddle_game import answer, hear +import smach from robot_smach_states.util import Initialize - -from riddle_game import hear, answer +from robot_smach_states.util.startup import startup ############################################################################## # diff --git a/challenge_spr/src/challenge_spr_states/detect.py b/challenge_spr/src/challenge_spr_states/detect.py index 594e43868c..dc69893313 100755 --- a/challenge_spr/src/challenge_spr_states/detect.py +++ b/challenge_spr/src/challenge_spr_states/detect.py @@ -1,22 +1,16 @@ #!/usr/bin/env python -import sys -import time -import smach -import math import random + import rospy +from image_recognition_msgs.msg import FaceProperties +from tue_msgs.msg import People import robot_smach_states as states -import robot_smach_states.util.designators as ds -import robot_skills.util.msg_constructors as msgs - -from image_recognition_msgs.msg import FaceProperties -from robot_smach_states.util.startup import startup +import smach +from robot_skills.util.image_operations import img_cutout, img_recognitions_to_rois from robot_skills.util.kdl_conversions import VectorStamped -from robot_skills.util.image_operations import img_recognitions_to_rois, img_cutout -from robocup_knowledge import load_knowledge -from tue_msgs.msg import People +from robot_smach_states.util.startup import startup timeout = 10 diff --git a/challenge_storing_groceries/scripts/test_inspect_shelves b/challenge_storing_groceries/scripts/test_inspect_shelves index f1437bac13..3f5db79aac 100755 --- a/challenge_storing_groceries/scripts/test_inspect_shelves +++ b/challenge_storing_groceries/scripts/test_inspect_shelves @@ -1,5 +1,7 @@ #!/usr/bin/python +from __future__ import print_function + import rospy from robot_skills.amigo import Amigo from challenge_storing_groceries.inspect_shelves import InspectShelves diff --git a/challenge_storing_groceries/src/challenge_storing_groceries/inspect_shelves.py b/challenge_storing_groceries/src/challenge_storing_groceries/inspect_shelves.py index b7d65240ff..592ce8798e 100644 --- a/challenge_storing_groceries/src/challenge_storing_groceries/inspect_shelves.py +++ b/challenge_storing_groceries/src/challenge_storing_groceries/inspect_shelves.py @@ -1,3 +1,5 @@ +from __future__ import print_function + # System import os diff --git a/challenge_storing_groceries/src/challenge_storing_groceries/pdf.py b/challenge_storing_groceries/src/challenge_storing_groceries/pdf.py index 1ba00f5ef3..29206433ba 100755 --- a/challenge_storing_groceries/src/challenge_storing_groceries/pdf.py +++ b/challenge_storing_groceries/src/challenge_storing_groceries/pdf.py @@ -1,5 +1,7 @@ #!/usr/bin/python +from __future__ import print_function + from io import BytesIO import datetime import numpy as np diff --git a/robocup_knowledge/src/robocup_knowledge/environments/demo/challenge_gpsr.py b/robocup_knowledge/src/robocup_knowledge/environments/demo/challenge_gpsr.py index 1942e82235..184d61e8d6 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/demo/challenge_gpsr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/demo/challenge_gpsr.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/reo2016/common.py b/robocup_knowledge/src/robocup_knowledge/environments/reo2016/common.py index 743fa8cda0..3372dfbdd3 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/reo2016/common.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/reo2016/common.py @@ -1,5 +1,7 @@ # COMMON KNOWLEDGE FILE REO2016 +from __future__ import print_function + female_names = ["Emma", "Olivia", "Sophia", "Isabella", "Ava", "Mia", "Emily", "Abigail", "Madison", "Charlotte"] male_names = ["Noah", "Liam", "Mason", "Jacob", "William", "Ethan", "Michael", "Alexander", "James", "Daniel"] diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rgo2017/challenge_gpsr.py b/robocup_knowledge/src/robocup_knowledge/environments/rgo2017/challenge_gpsr.py index 136a37ab1b..e0a5e8d7af 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rgo2017/challenge_gpsr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rgo2017/challenge_gpsr.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rgo2017/common.py b/robocup_knowledge/src/robocup_knowledge/environments/rgo2017/common.py index e9f6028362..7e091a87e3 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rgo2017/common.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rgo2017/common.py @@ -1,5 +1,7 @@ # COMMON KNOWLEDGE FILE RGO2017 +from __future__ import print_function + female_names = ["emma","olivia","sophia","ava","isabella","mia","abigail","emily","charlotte","harper"] male_names = ["noah","liam","mason","jacob","william","ethan","james","alexander","michael","benjamin"] names = female_names + male_names diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_demo.py b/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_demo.py index 9919cf36bb..f657842634 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_demo.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_demo.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_eegpsr.py b/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_eegpsr.py index c01ac97141..f34e8acd84 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_eegpsr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_eegpsr.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_gpsr.py b/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_gpsr.py index 539c6848ed..63ac4abd57 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_gpsr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_gpsr.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_open.py b/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_open.py index cb6a5e9c8f..20402b15b7 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_open.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_open.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_spr.py b/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_spr.py index b540b7c560..619bde01df 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_spr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/challenge_spr.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/common.py b/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/common.py index 1afae014bb..6f257e452a 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/common.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rgo2018/common.py @@ -1,5 +1,7 @@ # COMMON KNOWLEDGE FILE RGO2018 +from __future__ import print_function + female_names = ["angie", "mary", "amy", "kimberley", "lisa", "melissa", "michelle", "jennifer", "elizabeth", "julie"] male_names = ["brian", "michael", "christopher", "william", "john", "david", "james", "robert", "scott", "richard"] names = female_names + male_names diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/challenge_eegpsr.py b/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/challenge_eegpsr.py index 012bdd692d..1fb97271b7 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/challenge_eegpsr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/challenge_eegpsr.py @@ -1,5 +1,7 @@ # EEGPSR KNOWLEDGE FILE RGO2019 +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/challenge_gpsr.py b/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/challenge_gpsr.py index 9deaf66c90..7857b48613 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/challenge_gpsr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/challenge_gpsr.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") spr = knowledge_loader.load_knowledge("challenge_spr") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/challenge_spr.py b/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/challenge_spr.py index 029cd67181..ee011bee41 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/challenge_spr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/challenge_spr.py @@ -1,5 +1,7 @@ # SPR KNOWLEDGE FILE RWC2018 +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/challenge_where_is_this.py b/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/challenge_where_is_this.py index d0bae7252b..7c32ebfe5f 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/challenge_where_is_this.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/challenge_where_is_this.py @@ -1,5 +1,7 @@ # RIPS KNOWLEDGE FILE RGO2019 +from __future__ import print_function + # TU/e Robotics from robocup_knowledge import knowledge_loader diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/common.py b/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/common.py index 21a27c5f6d..33fb74db7a 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/common.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rgo2019/common.py @@ -1,5 +1,7 @@ # COMMON KNOWLEDGE FILE RGO2019 +from __future__ import print_function + # Names female_names = ["sophia","isabella","emma","olivia","ava","emily","abigail","madison","mia","chloe"] diff --git a/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_cleanup.py b/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_cleanup.py index 74071773e3..98055cd5ef 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_cleanup.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_cleanup.py @@ -1,4 +1,7 @@ # CLEAN UP KNOWLEDGE FILE ROBOTICS_TESTLABS + +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_demo.py b/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_demo.py index 3c36f70158..22d5ff4668 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_demo.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_demo.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_gpsr.py b/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_gpsr.py index 9d7178710f..810ce84b3c 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_gpsr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_gpsr.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_person_recognition.py b/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_person_recognition.py index e9d50fa36b..64b3776633 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_person_recognition.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_person_recognition.py @@ -1,3 +1,5 @@ +from __future__ import print_function + ''' colors from printing on screen ''' class bcolors: HEADER = '\033[95m' diff --git a/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_spr.py b/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_spr.py index 301c81062e..ebe685c0f6 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_spr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_spr.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_test.py b/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_test.py index 7b4b6a95e8..f1a5c6a1c2 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_test.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_test.py @@ -1,4 +1,4 @@ - +from __future__ import print_function ''' printing shortcuts ''' def printOk(sentence): diff --git a/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_where_is_this.py b/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_where_is_this.py index 4f63e0f2bf..80d804e4a7 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_where_is_this.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/robotics_testlabs/challenge_where_is_this.py @@ -1,5 +1,7 @@ # WHERE IS THIS KNOWLEDGE FILE ROBOTICS TESTLABS +from __future__ import print_function + # System from collections import namedtuple diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rwc2015/challenge_person_recognition.py b/robocup_knowledge/src/robocup_knowledge/environments/rwc2015/challenge_person_recognition.py index 2d786021cd..8836b01f22 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rwc2015/challenge_person_recognition.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rwc2015/challenge_person_recognition.py @@ -1,3 +1,5 @@ +from __future__ import print_function + ''' colors from printing on screen ''' class bcolors: HEADER = '\033[95m' diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rwc2017/challenge_eegpsr.py b/robocup_knowledge/src/robocup_knowledge/environments/rwc2017/challenge_eegpsr.py index b47a57e75e..f748e30efc 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rwc2017/challenge_eegpsr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rwc2017/challenge_eegpsr.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rwc2017/challenge_gpsr.py b/robocup_knowledge/src/robocup_knowledge/environments/rwc2017/challenge_gpsr.py index bd1e172d81..7c7b25e344 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rwc2017/challenge_gpsr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rwc2017/challenge_gpsr.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rwc2017/challenge_spr.py b/robocup_knowledge/src/robocup_knowledge/environments/rwc2017/challenge_spr.py index 88190d0b70..2e10f8a342 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rwc2017/challenge_spr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rwc2017/challenge_spr.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rwc2017/common.py b/robocup_knowledge/src/robocup_knowledge/environments/rwc2017/common.py index 957dddd630..702d096bf4 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rwc2017/common.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rwc2017/common.py @@ -1,5 +1,7 @@ # COMMON KNOWLEDGE FILE RWC2017 +from __future__ import print_function + female_names = ["emma", "olivia", "sophia", "ava", "isabella", "mia", "abigail", "emily", "charlotte", "harper"] male_names = ["noah", "liam", "mason", "jacob", "william", "ethan", "james", "alexander", "michael", "benjamin"] names = female_names + male_names diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_demo.py b/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_demo.py index 727f69a8fe..2a10f6a39b 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_demo.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_demo.py @@ -1,5 +1,7 @@ # DEMO KNOWLEDGE FILE RWC2018 +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_eegpsr.py b/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_eegpsr.py index adeeea96f3..175220bd73 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_eegpsr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_eegpsr.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_final.py b/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_final.py index 23cef0bcf0..c94c38249e 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_final.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_final.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_gpsr.py b/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_gpsr.py index 612c4dc137..bd85d18719 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_gpsr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_gpsr.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_open.py b/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_open.py index 5131e72706..10fde62fa0 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_open.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_open.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_spr.py b/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_spr.py index 029cd67181..ee011bee41 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_spr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/challenge_spr.py @@ -1,5 +1,7 @@ # SPR KNOWLEDGE FILE RWC2018 +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/common.py b/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/common.py index 77aa7fbed1..6e91c05329 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/common.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rwc2018/common.py @@ -1,5 +1,7 @@ # COMMON KNOWLEDGE FILE RWC2018 +from __future__ import print_function + female_names = ["alex", "charlie", "elizabeth", "francis", "jennifer", "linda", "mary", "patricia", "robin", "skyler"] male_names = ["alex", "charlie", "francis", "james", "john", "michael", "robert", "robin", "skyler", "william"] diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rwc2019/challenge_cleanup.py b/robocup_knowledge/src/robocup_knowledge/environments/rwc2019/challenge_cleanup.py index 69cdc221f2..7a3cf5846b 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rwc2019/challenge_cleanup.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rwc2019/challenge_cleanup.py @@ -1,4 +1,7 @@ # CLEAN UP KNOWLEDGE FILE ROBOTICS_TESTLABS + +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/rwc2019/challenge_where_is_this.py b/robocup_knowledge/src/robocup_knowledge/environments/rwc2019/challenge_where_is_this.py index 6b20e17bdd..20b9c329d1 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/rwc2019/challenge_where_is_this.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/rwc2019/challenge_where_is_this.py @@ -1,3 +1,5 @@ +from __future__ import print_function + # System from collections import namedtuple diff --git a/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/challenge_demo.py b/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/challenge_demo.py index cadff84d40..5dfe69a40a 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/challenge_demo.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/challenge_demo.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/challenge_gpsr.py b/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/challenge_gpsr.py index f7faeb231d..8e0a159731 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/challenge_gpsr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/challenge_gpsr.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/challenge_spr.py b/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/challenge_spr.py index 950b90a245..8b2b379cb8 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/challenge_spr.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/challenge_spr.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/common.py b/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/common.py index 230921747c..a958488cfe 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/common.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/common.py @@ -1,4 +1,7 @@ # COMMON KNOWLEDGE FILE SIZA DEMO + +from __future__ import print_function + names = ['peter', 'josja'] # This dict holds all locations locations = [ diff --git a/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/siza_demo.py b/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/siza_demo.py index 33a4a27b12..d2012d6a33 100644 --- a/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/siza_demo.py +++ b/robocup_knowledge/src/robocup_knowledge/environments/siza_demo/siza_demo.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from robocup_knowledge import knowledge_loader common = knowledge_loader.load_knowledge("common") diff --git a/robot_skills/examples/example_arms.py b/robot_skills/examples/example_arms.py index 3f3fc60298..62d4913a43 100644 --- a/robot_skills/examples/example_arms.py +++ b/robot_skills/examples/example_arms.py @@ -1,10 +1,12 @@ #! /usr/bin/env python +from __future__ import print_function + import sys + import rospy import robot_skills.util.kdl_conversions as kdl_conversions - from robot_skills.util.robot_constructor import robot_constructor if len(sys.argv) < 2: diff --git a/robot_skills/examples/example_audio.py b/robot_skills/examples/example_audio.py index 58c789a7ae..28c47ccc0e 100644 --- a/robot_skills/examples/example_audio.py +++ b/robot_skills/examples/example_audio.py @@ -1,5 +1,7 @@ #! /usr/bin/env python +from __future__ import print_function + # System import random import time @@ -10,7 +12,6 @@ # TU/e Robotics from robot_skills import get_robot_from_argv - rospy.init_node("audio_test") robot = get_robot_from_argv(index=1) @@ -66,6 +67,3 @@ def ask(question, grammar, target): for i in range(0,4): ask("What can I get for you?", restaurant_grammar, "O") - - - diff --git a/robot_skills/examples/example_head.py b/robot_skills/examples/example_head.py index c6228ec9af..1b79947cd1 100644 --- a/robot_skills/examples/example_head.py +++ b/robot_skills/examples/example_head.py @@ -1,6 +1,9 @@ #! /usr/bin/env python +from __future__ import print_function + import sys + import rospy from robot_skills.util.robot_constructor import robot_constructor diff --git a/robot_skills/examples/example_move_down_until_force_sensor_edge_up.py b/robot_skills/examples/example_move_down_until_force_sensor_edge_up.py index 3b31a4aeea..ac2cd1f5d4 100755 --- a/robot_skills/examples/example_move_down_until_force_sensor_edge_up.py +++ b/robot_skills/examples/example_move_down_until_force_sensor_edge_up.py @@ -1,5 +1,6 @@ #!/usr/bin/env python import rospy + from robot_skills.util.robot_constructor import robot_constructor rospy.init_node('test_mode_down_until_force_sensor_edge_up', anonymous=True) diff --git a/robot_skills/examples/example_perception.py b/robot_skills/examples/example_perception.py index be972176c8..712a47ecba 100644 --- a/robot_skills/examples/example_perception.py +++ b/robot_skills/examples/example_perception.py @@ -1,8 +1,10 @@ #! /usr/bin/env python +from __future__ import print_function + import sys -import rospy +import rospy from sensor_msgs.msg import RegionOfInterest from robot_skills.util.robot_constructor import robot_constructor diff --git a/robot_skills/examples/example_person_recognition.py b/robot_skills/examples/example_person_recognition.py index 064fc25c1f..2b9af295be 100644 --- a/robot_skills/examples/example_person_recognition.py +++ b/robot_skills/examples/example_person_recognition.py @@ -1,6 +1,9 @@ #! /usr/bin/env python +from __future__ import print_function + import sys + import rospy from robot_skills.util.robot_constructor import robot_constructor diff --git a/robot_skills/examples/example_raytrace.py b/robot_skills/examples/example_raytrace.py index e226504446..f4fb1a54fc 100755 --- a/robot_skills/examples/example_raytrace.py +++ b/robot_skills/examples/example_raytrace.py @@ -1,11 +1,12 @@ #!/usr/bin/env python +import rospy from ed_sensor_integration.srv import RayTrace from geometry_msgs.msg import PoseStamped -from robot_skills import perception -import rospy from std_msgs.msg import Header from tf import TransformListener +from robot_skills import perception + rospy.init_node('ray_trace_example') p = perception.Perception("hero", None, None, camera_base_ns="hero/head_rgbd_sensor") diff --git a/robot_skills/examples/example_speech_recognition.py b/robot_skills/examples/example_speech_recognition.py index 40fed7274e..8f4f3c5201 100644 --- a/robot_skills/examples/example_speech_recognition.py +++ b/robot_skills/examples/example_speech_recognition.py @@ -1,5 +1,9 @@ #! /usr/bin/env python + +from __future__ import print_function + import rospy + from robot_skills import get_robot_from_argv rospy.init_node("audio_test") diff --git a/robot_skills/examples/example_spindle_goals.py b/robot_skills/examples/example_spindle_goals.py index 3703145827..496fab8304 100644 --- a/robot_skills/examples/example_spindle_goals.py +++ b/robot_skills/examples/example_spindle_goals.py @@ -1,11 +1,11 @@ #! /usr/bin/env python +import random +import time + import rospy import robot_skills.amigo -import random -import time - if __name__ == "__main__": rospy.init_node('amigo_skills_test_full') @@ -16,5 +16,3 @@ while not rospy.is_shutdown(): amigo.torso._send_goal([random.random()]) rospy.sleep(rospy.Duration(0.1)) - - diff --git a/robot_skills/examples/example_worldmodel.py b/robot_skills/examples/example_worldmodel.py index d74a1c3e8b..ec7887e4a4 100644 --- a/robot_skills/examples/example_worldmodel.py +++ b/robot_skills/examples/example_worldmodel.py @@ -1,11 +1,12 @@ #! /usr/bin/env python +from __future__ import print_function + import sys + import rospy import robot_skills.util.kdl_conversions as kdl_conversions -import PyKDL as kdl - from robot_skills.util.robot_constructor import robot_constructor if len(sys.argv) < 2: diff --git a/robot_skills/scripts/update_ed_entity_pose b/robot_skills/scripts/update_ed_entity_pose index ccb458b8ce..9839ea1613 100755 --- a/robot_skills/scripts/update_ed_entity_pose +++ b/robot_skills/scripts/update_ed_entity_pose @@ -1,12 +1,14 @@ #!/usr/bin/env python +import math + import PyKDL as kdl import rospy import tf -import math from geometry_msgs.msg import PoseStamped -from robot_skills.world_model_ed import ED + from robot_skills.util.kdl_conversions import FrameStamped, pose_msg_to_kdl_frame +from robot_skills.world_model_ed import ED def callback(msg): diff --git a/robot_skills/src/robot_skills/__init__.py b/robot_skills/src/robot_skills/__init__.py index 31b35241b8..b1f00e518a 100644 --- a/robot_skills/src/robot_skills/__init__.py +++ b/robot_skills/src/robot_skills/__init__.py @@ -1,32 +1,11 @@ from __future__ import absolute_import -from . import arm -from . import functionalities -from . import simulation -from . import util - -from . import api -from . import base -from . import battery -from . import classification_result -from . import ears -from . import ebutton -from . import head -from . import lights -from . import mockbot -from . import perception -from . import robot -from . import robot_part -from . import sound_source_localisation -from . import speech -from . import torso -from . import world_model_ed - +from . import api, arm, base, battery, classification_result, ears, ebutton, functionalities, head, lights, mockbot, \ + perception, robot, robot_part, simulation, sound_source_localisation, speech, torso, util, world_model_ed # Robots from .amigo import Amigo +# Helper methods +from .get_robot import get_robot, get_robot_from_argv from .hero import Hero from .mockbot import Mockbot from .sergio import Sergio - -# Helper methods -from .get_robot import get_robot, get_robot_from_argv diff --git a/robot_skills/src/robot_skills/amigo.py b/robot_skills/src/robot_skills/amigo.py index 7d0cd1f7f6..ced4e30fc3 100644 --- a/robot_skills/src/robot_skills/amigo.py +++ b/robot_skills/src/robot_skills/amigo.py @@ -1,9 +1,9 @@ from __future__ import print_function -from robot_skills import robot, api, base, ebutton, head, ears, lights, perception, speech, \ - sound_source_localisation, torso, world_model_ed +from robot_skills import api, base, ears, ebutton, head, lights, perception, robot, sound_source_localisation, speech, \ + torso, world_model_ed from robot_skills.arm import arms, gripper, handover_detector -from .simulation import is_sim_mode, SimEButton +from .simulation import SimEButton, is_sim_mode class Amigo(robot.Robot): diff --git a/robot_skills/src/robot_skills/api.py b/robot_skills/src/robot_skills/api.py index e0084c6b14..f3615f944d 100644 --- a/robot_skills/src/robot_skills/api.py +++ b/robot_skills/src/robot_skills/api.py @@ -2,11 +2,11 @@ import cv2 import rospy from cv_bridge import CvBridge +# TU/e Robotics +from hmi_msgs.msg import QueryAction from sensor_msgs.msg import CompressedImage from std_srvs.srv import Empty -# TU/e Robotics -from hmi_msgs.msg import QueryAction from hmi import Client, TimeoutException from robot_skills.robot_part import RobotPart @@ -107,5 +107,3 @@ def restart_dragonfly(self): self.restart_srv() except rospy.ServiceException as e: rospy.logerr("Service call failed: {0}".format(e)) - - diff --git a/robot_skills/src/robot_skills/arm/__init__.py b/robot_skills/src/robot_skills/arm/__init__.py index 744d89bbd8..d54b0ed27e 100644 --- a/robot_skills/src/robot_skills/arm/__init__.py +++ b/robot_skills/src/robot_skills/arm/__init__.py @@ -1,6 +1,3 @@ from __future__ import absolute_import -from . import arms -from . import force_sensor -from . import grasp_sensor -from . import gripper -from . import handover_detector + +from . import arms, force_sensor, grasp_sensor, gripper, handover_detector diff --git a/robot_skills/src/robot_skills/arm/arms.py b/robot_skills/src/robot_skills/arm/arms.py index 74744dc4e3..bf370499f0 100644 --- a/robot_skills/src/robot_skills/arm/arms.py +++ b/robot_skills/src/robot_skills/arm/arms.py @@ -1,24 +1,21 @@ +from __future__ import print_function + import time +import PyKDL as kdl # ROS import rospy -import std_msgs.msg -import PyKDL as kdl - import visualization_msgs.msg from actionlib import GoalStatus -from control_msgs.msg import FollowJointTrajectoryGoal, FollowJointTrajectoryAction -from robot_skills.arm.force_sensor import ForceSensor -from robot_skills.arm.gripper import ParrallelGripper +from control_msgs.msg import FollowJointTrajectoryAction, FollowJointTrajectoryGoal from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint - # TU/e Robotics -from tue_manipulation_msgs.msg import GraspPrecomputeGoal, GraspPrecomputeAction -from tue_manipulation_msgs.msg import GripperCommandGoal, GripperCommandAction -from tue_msgs.msg import GripperCommand +from tue_manipulation_msgs.msg import GraspPrecomputeAction, GraspPrecomputeGoal +from robot_skills.arm.gripper import ParrallelGripper from robot_skills.robot_part import RobotPart + # Constants for arm requirements. Note that "don't care at all" is not here, as # it can be expressed by not imposing a requirement (set it to None). diff --git a/robot_skills/src/robot_skills/arm/force_sensor.py b/robot_skills/src/robot_skills/arm/force_sensor.py index 93964e567a..23b839142d 100644 --- a/robot_skills/src/robot_skills/arm/force_sensor.py +++ b/robot_skills/src/robot_skills/arm/force_sensor.py @@ -1,13 +1,13 @@ from __future__ import absolute_import -from numpy import array as np_array -from numpy.linalg import norm as np_norm import rospy from geometry_msgs.msg import WrenchStamped -from robot_skills.util.exceptions import TimeOutException +from numpy import array as np_array +from numpy.linalg import norm as np_norm # TU/e Robotics from robot_skills.robot_part import RobotPart +from robot_skills.util.exceptions import TimeOutException class ForceSensor(RobotPart): diff --git a/robot_skills/src/robot_skills/arm/grasp_sensor.py b/robot_skills/src/robot_skills/arm/grasp_sensor.py index e1cc9ad027..cd54f5042b 100644 --- a/robot_skills/src/robot_skills/arm/grasp_sensor.py +++ b/robot_skills/src/robot_skills/arm/grasp_sensor.py @@ -1,6 +1,4 @@ from robot_skills.robot_part import RobotPart -from tue_manipulation_msgs.msg import GripperCommandGoal, GripperCommandAction -from tue_msgs.msg import GripperCommand class GripperMeasurement(object): diff --git a/robot_skills/src/robot_skills/arm/gripper.py b/robot_skills/src/robot_skills/arm/gripper.py index 9e21079776..ec9d000329 100644 --- a/robot_skills/src/robot_skills/arm/gripper.py +++ b/robot_skills/src/robot_skills/arm/gripper.py @@ -1,11 +1,12 @@ -import rospy import PyKDL as kdl - +import rospy from actionlib import GoalStatus -from robot_skills.robot_part import RobotPart -from tue_manipulation_msgs.msg import GripperCommandGoal, GripperCommandAction +from tue_manipulation_msgs.msg import GripperCommandAction, GripperCommandGoal from tue_msgs.msg import GripperCommand +from robot_skills.robot_part import RobotPart + + class GripperState(object): """ Specifies a State either OPEN or CLOSE diff --git a/robot_skills/src/robot_skills/arm/handover_detector.py b/robot_skills/src/robot_skills/arm/handover_detector.py index 41e01eb4ca..ab1daecc89 100644 --- a/robot_skills/src/robot_skills/arm/handover_detector.py +++ b/robot_skills/src/robot_skills/arm/handover_detector.py @@ -1,8 +1,9 @@ +from __future__ import print_function + import rospy -import PyKDL as kdl from robot_skills.robot_part import RobotPart -from tue_manipulation_msgs.msg import GripperCommandGoal, GripperCommandAction + class HandoverDetector(RobotPart): """ diff --git a/robot_skills/src/robot_skills/base.py b/robot_skills/src/robot_skills/base.py index cd7bb04f9a..2234044de0 100644 --- a/robot_skills/src/robot_skills/base.py +++ b/robot_skills/src/robot_skills/base.py @@ -5,20 +5,20 @@ # System import math -from numpy import sign -# ROS -from actionlib_msgs.msg import GoalStatus import geometry_msgs.msg import rospy import tf - +# ROS +from actionlib_msgs.msg import GoalStatus # TU/e Robotics -from cb_base_navigation_msgs.msg import LocalPlannerAction, OrientationConstraint, PositionConstraint, LocalPlannerGoal -from cb_base_navigation_msgs.srv import GetPlan, CheckPlan +from cb_base_navigation_msgs.msg import LocalPlannerAction, LocalPlannerGoal, OrientationConstraint, PositionConstraint +from cb_base_navigation_msgs.srv import CheckPlan, GetPlan +from numpy import sign + from robot_skills.robot_part import RobotPart -from robot_skills.util.kdl_conversions import kdl_frame_stamped_from_pose_stamped_msg from robot_skills.util import nav_analyzer, transformations +from robot_skills.util.kdl_conversions import kdl_frame_stamped_from_pose_stamped_msg class LocalPlanner(RobotPart): diff --git a/robot_skills/src/robot_skills/battery.py b/robot_skills/src/robot_skills/battery.py index 9435238a61..96cb915aeb 100644 --- a/robot_skills/src/robot_skills/battery.py +++ b/robot_skills/src/robot_skills/battery.py @@ -1,4 +1,5 @@ from sensor_msgs.msg import BatteryState + from robot_skills.robot_part import RobotPart diff --git a/robot_skills/src/robot_skills/functionalities/__init__.py b/robot_skills/src/robot_skills/functionalities/__init__.py index 7eb903270e..881e8d9a74 100644 --- a/robot_skills/src/robot_skills/functionalities/__init__.py +++ b/robot_skills/src/robot_skills/functionalities/__init__.py @@ -1,3 +1,4 @@ +# Don't change order of imports. That can lead to an ImportError from .robot_functionality import RobotFunc from .add_functionalities import add_functionalities from . import arm diff --git a/robot_skills/src/robot_skills/functionalities/arm/guarded_motion.py b/robot_skills/src/robot_skills/functionalities/arm/guarded_motion.py index 37fcc2a3f0..e59e13d0cb 100644 --- a/robot_skills/src/robot_skills/functionalities/arm/guarded_motion.py +++ b/robot_skills/src/robot_skills/functionalities/arm/guarded_motion.py @@ -1,12 +1,10 @@ -from robot_skills.functionalities import RobotFunc - -from robot_skills.arm.arms import Arm -from robot_skills.arm.force_sensor import ForceSensor - +import rospy from control_msgs.msg import FollowJointTrajectoryGoal from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint -import rospy +from robot_skills.arm.arms import Arm +from robot_skills.arm.force_sensor import ForceSensor +from robot_skills.functionalities import RobotFunc class GuardedMotionFunc(RobotFunc): diff --git a/robot_skills/src/robot_skills/get_robot.py b/robot_skills/src/robot_skills/get_robot.py index ebc522346a..f422f61d9d 100644 --- a/robot_skills/src/robot_skills/get_robot.py +++ b/robot_skills/src/robot_skills/get_robot.py @@ -4,14 +4,13 @@ # ROS import rospy -# Robot skills -from .robot import Robot from .amigo import Amigo from .hero import Hero from .mockbot import Mockbot +# Robot skills +from .robot import Robot from .sergio import Sergio - ROBOTS = { "amigo": Amigo, "hero": Hero, diff --git a/robot_skills/src/robot_skills/head.py b/robot_skills/src/robot_skills/head.py index f7ee197642..391c01b4f3 100644 --- a/robot_skills/src/robot_skills/head.py +++ b/robot_skills/src/robot_skills/head.py @@ -5,7 +5,7 @@ # TU/e Robotics from robot_skills.robot_part import RobotPart -from robot_skills.util.kdl_conversions import kdl_vector_stamped_to_point_stamped, VectorStamped +from robot_skills.util.kdl_conversions import VectorStamped, kdl_vector_stamped_to_point_stamped class Head(RobotPart): diff --git a/robot_skills/src/robot_skills/hero.py b/robot_skills/src/robot_skills/hero.py index b6a6900f5d..fcde20f239 100644 --- a/robot_skills/src/robot_skills/hero.py +++ b/robot_skills/src/robot_skills/hero.py @@ -1,9 +1,10 @@ -from . import robot, api, base, ebutton, head, ears, lights, perception, speech, torso, world_model_ed -from .arm import arms, force_sensor, gripper, handover_detector -from .simulation import is_sim_mode, SimEButton +import math import rospy -import math + +from . import api, base, ears, ebutton, head, lights, perception, robot, speech, torso, world_model_ed +from .arm import arms, force_sensor, gripper, handover_detector +from .simulation import SimEButton, is_sim_mode class Hero(robot.Robot): diff --git a/robot_skills/src/robot_skills/lights.py b/robot_skills/src/robot_skills/lights.py index b66943be49..daf85f05e9 100644 --- a/robot_skills/src/robot_skills/lights.py +++ b/robot_skills/src/robot_skills/lights.py @@ -1,9 +1,9 @@ # ROS import rospy from std_msgs.msg import ColorRGBA - # TU/e Robotics from tue_msgs.msg import RGBLightCommand + from robot_skills.robot_part import RobotPart LISTENING = ColorRGBA(0, 1, 0, 1) diff --git a/robot_skills/src/robot_skills/mockbot.py b/robot_skills/src/robot_skills/mockbot.py index 3248d85b6e..e5cf17ef4b 100755 --- a/robot_skills/src/robot_skills/mockbot.py +++ b/robot_skills/src/robot_skills/mockbot.py @@ -1,30 +1,30 @@ #! /usr/bin/env python -from __future__ import absolute_import +from __future__ import absolute_import, print_function +import os +import random # System from collections import defaultdict -import mock -import random -import os -import six +import PyKDL as kdl # ROS import geometry_msgs -import PyKDL as kdl +import mock import rospy +import six import std_msgs.msg import tf - # TU/e Robotics from ed_msgs.msg import EntityInfo from ed_sensor_integration_msgs.srv import UpdateResponse + +from hmi import HMIResult +from hmi.common import parse_sentence, random_sentence from robot_skills import robot -from robot_skills.util.kdl_conversions import VectorStamped, FrameStamped from robot_skills.classification_result import ClassificationResult from robot_skills.util.entity import from_entity_info -from hmi import HMIResult -from hmi.common import random_sentence, parse_sentence +from robot_skills.util.kdl_conversions import FrameStamped, VectorStamped def random_kdl_vector(): diff --git a/robot_skills/src/robot_skills/perception.py b/robot_skills/src/robot_skills/perception.py index 80f00be78e..f1f9681f71 100644 --- a/robot_skills/src/robot_skills/perception.py +++ b/robot_skills/src/robot_skills/perception.py @@ -1,20 +1,20 @@ # System from threading import Condition, Event +import message_filters # ROS import rospy +from image_recognition_msgs.msg import Annotation +# TU/e Robotics +from image_recognition_msgs.srv import Annotate, GetFaceProperties, Recognize, RecognizeResponse from people_recognition_msgs.srv import RecognizePeople3D -from sensor_msgs.msg import Image, CameraInfo +from rgbd_msgs.srv import Project2DTo3D +from sensor_msgs.msg import CameraInfo, Image from std_srvs.srv import Empty -import message_filters -# TU/e Robotics -from image_recognition_msgs.srv import Annotate, Recognize, RecognizeResponse, GetFaceProperties -from image_recognition_msgs.msg import Annotation -from rgbd_msgs.srv import Project2DTo3D from robot_skills.robot_part import RobotPart +from robot_skills.util.image_operations import img_cutout, img_recognitions_to_rois from robot_skills.util.kdl_conversions import VectorStamped -from robot_skills.util.image_operations import img_recognitions_to_rois, img_cutout class Perception(RobotPart): diff --git a/robot_skills/src/robot_skills/robot.py b/robot_skills/src/robot_skills/robot.py index b9f83332a0..b3cbb7b514 100755 --- a/robot_skills/src/robot_skills/robot.py +++ b/robot_skills/src/robot_skills/robot.py @@ -1,9 +1,11 @@ #! /usr/bin/env python +from collections import OrderedDict, Sequence + +import geometry_msgs # ROS import rospy import tf -import geometry_msgs from diagnostic_msgs.msg import DiagnosticArray from sensor_msgs.msg import Image, JointState from std_msgs.msg import String @@ -12,8 +14,6 @@ from .arm import arms from .functionalities.add_functionalities import add_functionalities -from collections import OrderedDict, Sequence - CONNECTION_TIMEOUT = 10.0 # Timeout: all ROS connections must be alive within this duration diff --git a/robot_skills/src/robot_skills/robot_part.py b/robot_skills/src/robot_skills/robot_part.py index 479f1ff578..be9ddf5511 100644 --- a/robot_skills/src/robot_skills/robot_part.py +++ b/robot_skills/src/robot_skills/robot_part.py @@ -3,9 +3,9 @@ # System import os +import actionlib # ROS import rospy -import actionlib # Determine simulation mode SIM_MODE = os.environ.get("ROBOT_REAL", "false").lower() != "true" diff --git a/robot_skills/src/robot_skills/sergio.py b/robot_skills/src/robot_skills/sergio.py index 22d6056eba..c6a3e59a75 100644 --- a/robot_skills/src/robot_skills/sergio.py +++ b/robot_skills/src/robot_skills/sergio.py @@ -1,6 +1,6 @@ -from robot_skills import robot, api, base, ebutton, head, ears, lights, perception, speech, \ - sound_source_localisation, torso, world_model_ed -from .simulation import is_sim_mode, SimEButton +from robot_skills import api, base, ears, ebutton, head, lights, perception, robot, sound_source_localisation, speech, \ + torso, world_model_ed +from .simulation import SimEButton, is_sim_mode class Sergio(robot.Robot): diff --git a/robot_skills/src/robot_skills/sound_source_localisation.py b/robot_skills/src/robot_skills/sound_source_localisation.py index 0844645ca9..0dfa7ec2ff 100644 --- a/robot_skills/src/robot_skills/sound_source_localisation.py +++ b/robot_skills/src/robot_skills/sound_source_localisation.py @@ -1,10 +1,10 @@ # System import math -# ROS -from geometry_msgs.msg import PoseStamped import rospy import tf +# ROS +from geometry_msgs.msg import PoseStamped # TU/e Robotics from robot_skills.robot_part import RobotPart diff --git a/robot_skills/src/robot_skills/speech.py b/robot_skills/src/robot_skills/speech.py index 0212539b90..54bb2a1490 100644 --- a/robot_skills/src/robot_skills/speech.py +++ b/robot_skills/src/robot_skills/speech.py @@ -1,9 +1,9 @@ # ROS import rospy +from text_to_speech.srv import Speak, SpeakRequest # TU/e Robotics from robot_skills.robot_part import RobotPart -from text_to_speech.srv import Speak, SpeakRequest class Speech(RobotPart): diff --git a/robot_skills/src/robot_skills/torso.py b/robot_skills/src/robot_skills/torso.py index 838a1609a4..27629c552d 100644 --- a/robot_skills/src/robot_skills/torso.py +++ b/robot_skills/src/robot_skills/torso.py @@ -1,11 +1,13 @@ +from __future__ import print_function + # System import time -# ROS -from actionlib_msgs.msg import GoalStatus import control_msgs.msg import rospy import trajectory_msgs.msg +# ROS +from actionlib_msgs.msg import GoalStatus # TU/e Robotics from robot_skills.robot_part import RobotPart diff --git a/robot_skills/src/robot_skills/util/__init__.py b/robot_skills/src/robot_skills/util/__init__.py index d8744cfd52..c140785465 100644 --- a/robot_skills/src/robot_skills/util/__init__.py +++ b/robot_skills/src/robot_skills/util/__init__.py @@ -1,14 +1,4 @@ from __future__ import absolute_import -from . import concurrent_util -from . import decorators -from . import entity -from . import exceptions -from . import image_operations -from . import kdl_conversions -from . import msg_constructors -from . import nav_analyzer -from . import robot_constructor -from . import shape -from . import transformations -from . import volume +from . import concurrent_util, decorators, entity, exceptions, image_operations, kdl_conversions, msg_constructors, \ + nav_analyzer, robot_constructor, shape, transformations, volume diff --git a/robot_skills/src/robot_skills/util/decorators.py b/robot_skills/src/robot_skills/util/decorators.py index eb946d5473..9ed8451de0 100644 --- a/robot_skills/src/robot_skills/util/decorators.py +++ b/robot_skills/src/robot_skills/util/decorators.py @@ -1,3 +1,5 @@ +from __future__ import print_function + # ROS import rospy diff --git a/robot_skills/src/robot_skills/util/entity.py b/robot_skills/src/robot_skills/util/entity.py index f9a85565d5..7a9789aae8 100644 --- a/robot_skills/src/robot_skills/util/entity.py +++ b/robot_skills/src/robot_skills/util/entity.py @@ -1,13 +1,13 @@ # System import yaml +import PyKDL as kdl # ROS import rospy -import PyKDL as kdl - # TU/e Robotics from ed_msgs.msg import EntityInfo -from robot_skills.util.kdl_conversions import pose_msg_to_kdl_frame, FrameStamped + +from robot_skills.util.kdl_conversions import FrameStamped, pose_msg_to_kdl_frame from robot_skills.util.shape import shape_from_entity_info from robot_skills.util.volume import volumes_from_entity_volumes_msg diff --git a/robot_skills/src/robot_skills/util/image_operations.py b/robot_skills/src/robot_skills/util/image_operations.py index 6f1b9b1d43..15f3e6f6ca 100644 --- a/robot_skills/src/robot_skills/util/image_operations.py +++ b/robot_skills/src/robot_skills/util/image_operations.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -from cv_bridge import CvBridge, CvBridgeError +from cv_bridge import CvBridge def img_recognitions_to_rois(recognitions): diff --git a/robot_skills/src/robot_skills/util/kdl_conversions.py b/robot_skills/src/robot_skills/util/kdl_conversions.py index 978e6d889b..587f35e996 100644 --- a/robot_skills/src/robot_skills/util/kdl_conversions.py +++ b/robot_skills/src/robot_skills/util/kdl_conversions.py @@ -1,9 +1,9 @@ # System from copy import deepcopy +import PyKDL as kdl # ROS import geometry_msgs.msg as gm -import PyKDL as kdl import rospy diff --git a/robot_skills/src/robot_skills/util/nav_analyzer.py b/robot_skills/src/robot_skills/util/nav_analyzer.py index 4a546eea2a..82e17122b1 100644 --- a/robot_skills/src/robot_skills/util/nav_analyzer.py +++ b/robot_skills/src/robot_skills/util/nav_analyzer.py @@ -5,9 +5,9 @@ import subprocess import xml.etree.ElementTree as ET +import PyKDL as kdl # ROS import nav_msgs.msg -import PyKDL as kdl import rospy # TU/e Robotics @@ -236,4 +236,3 @@ def indent(self, elem, level=0): else: if level and (not elem.tail or not elem.tail.strip()): elem.tail = i - diff --git a/robot_skills/src/robot_skills/util/shape.py b/robot_skills/src/robot_skills/util/shape.py index 9b338a5547..fe6c382cbe 100644 --- a/robot_skills/src/robot_skills/util/shape.py +++ b/robot_skills/src/robot_skills/util/shape.py @@ -1,5 +1,6 @@ # Robot skills import PyKDL as kdl + from robot_skills.util.kdl_conversions import point_msg_to_kdl_vector diff --git a/robot_skills/src/robot_skills/util/volume.py b/robot_skills/src/robot_skills/util/volume.py index 4d6d2eec44..85a5a15574 100644 --- a/robot_skills/src/robot_skills/util/volume.py +++ b/robot_skills/src/robot_skills/util/volume.py @@ -2,9 +2,10 @@ # ROS import PyKDL as kdl -from .kdl_conversions import point_msg_to_kdl_vector from numpy import abs +from .kdl_conversions import point_msg_to_kdl_vector + class Volume(object): """ Represents an volume of an entity diff --git a/robot_skills/src/robot_skills/world_model_ed.py b/robot_skills/src/robot_skills/world_model_ed.py index bdc8f9c8f5..09aade9d15 100644 --- a/robot_skills/src/robot_skills/world_model_ed.py +++ b/robot_skills/src/robot_skills/world_model_ed.py @@ -1,30 +1,30 @@ +from __future__ import print_function + # System import os -import yaml -from math import sqrt - # ROS import rospkg -import rospy -import visualization_msgs.msg +import yaml # TU/e import ed_msgs.srv -from ed_msgs.srv import SimpleQuery, SimpleQueryRequest, UpdateSrv, Configure import ed_sensor_integration_msgs.srv as ed_sensor_srv -from ed_people_recognition_msgs.srv import EdRecognizePeople -from ed_perception_msgs.srv import Classify +import rospy +import visualization_msgs.msg +from cb_base_navigation_msgs.msg import PositionConstraint from ed_gui_server_msgs.srv import GetEntityInfo, GetEntityInfoResponse +from ed_msgs.srv import Configure, SimpleQuery, SimpleQueryRequest, UpdateSrv from ed_navigation_msgs.srv import GetGoalConstraint -from cb_base_navigation_msgs.msg import PositionConstraint +from ed_people_recognition_msgs.srv import EdRecognizePeople +from ed_perception_msgs.srv import Classify +from robot_skills.classification_result import ClassificationResult +from robot_skills.robot_part import RobotPart # Robot skills from robot_skills.util import transformations from robot_skills.util.decorators import deprecated -from robot_skills.util.kdl_conversions import VectorStamped, kdl_vector_to_point_msg -from robot_skills.classification_result import ClassificationResult from robot_skills.util.entity import from_entity_info -from robot_skills.robot_part import RobotPart +from robot_skills.util.kdl_conversions import VectorStamped, kdl_vector_to_point_msg class Navigation(RobotPart): diff --git a/robot_skills/test/nosetest/test_doctest.py b/robot_skills/test/nosetest/test_doctest.py index 6f98a56b1b..c37316d7d6 100644 --- a/robot_skills/test/nosetest/test_doctest.py +++ b/robot_skills/test/nosetest/test_doctest.py @@ -1,6 +1,7 @@ -from test_tools.doctest_unittest import _TestDocTests import unittest +from test_tools.doctest_unittest import _TestDocTests + class DocTestsRobotSkills(_TestDocTests): def __init__(self, method_name="test_doctests"): diff --git a/robot_skills/test/rostest/test_compose_robot.py b/robot_skills/test/rostest/test_compose_robot.py index 46b5e3c217..03ff357468 100755 --- a/robot_skills/test/rostest/test_compose_robot.py +++ b/robot_skills/test/rostest/test_compose_robot.py @@ -1,13 +1,14 @@ #! /usr/bin/env python -import rospy import unittest +import rospy + +from robot_skills.functionalities import RobotFunc, add_functionalities # robot skills from robot_skills.robot import Robot from robot_skills.robot_part import RobotPart -from robot_skills.functionalities import add_functionalities, RobotFunc # robotpart subclass class TestPart(RobotPart): diff --git a/robot_smach_states/benchmark/analyse_grasping.py b/robot_smach_states/benchmark/analyse_grasping.py index 68ef5b3c12..47af02f591 100755 --- a/robot_smach_states/benchmark/analyse_grasping.py +++ b/robot_smach_states/benchmark/analyse_grasping.py @@ -1,5 +1,7 @@ #! /usr/bin/env python +from __future__ import print_function + import argparse from dateutil.parser import parse as parse_date import matplotlib.pyplot as plt diff --git a/robot_smach_states/examples/learn_objects.py b/robot_smach_states/examples/learn_objects.py index ab2a221143..598b8361b4 100644 --- a/robot_smach_states/examples/learn_objects.py +++ b/robot_smach_states/examples/learn_objects.py @@ -1,5 +1,7 @@ #! /usr/bin/env python +from __future__ import print_function + import sys import rospy diff --git a/robot_smach_states/src/robot_smach_states/manipulation/place.py b/robot_smach_states/src/robot_smach_states/manipulation/place.py index 50c2fd3c87..9f3dd22d8e 100644 --- a/robot_smach_states/src/robot_smach_states/manipulation/place.py +++ b/robot_smach_states/src/robot_smach_states/manipulation/place.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import absolute_import, print_function # ROS import rospy diff --git a/robot_smach_states/src/robot_smach_states/manipulation/place_designator.py b/robot_smach_states/src/robot_smach_states/manipulation/place_designator.py index 1a92f3683b..3b08eb2323 100644 --- a/robot_smach_states/src/robot_smach_states/manipulation/place_designator.py +++ b/robot_smach_states/src/robot_smach_states/manipulation/place_designator.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import absolute_import, print_function from builtins import range diff --git a/robot_smach_states/src/robot_smach_states/navigation/door_opening.py b/robot_smach_states/src/robot_smach_states/navigation/door_opening.py index 89bd3b42fb..1ab3c6ca12 100644 --- a/robot_smach_states/src/robot_smach_states/navigation/door_opening.py +++ b/robot_smach_states/src/robot_smach_states/navigation/door_opening.py @@ -1,3 +1,5 @@ +from __future__ import print_function + # System import numpy as np from threading import Event @@ -376,7 +378,7 @@ def _resolve(self): class OpenDoorByPushing(smach.StateMachine): """ Test in amigo-console with - door = ds.EdEntityDesignator(amigo, id='door1'); do = state_machine.OpenDoorByPushing(amigo, door); print do.execute(); + door = ds.EdEntityDesignator(amigo, id='door1'); do = state_machine.OpenDoorByPushing(amigo, door); print(do.execute()); """ def __init__(self, robot, door_start_wp_designator, door_dest_wp_designator, approach_speed=0.1, push_speed=0.05, attempts=10): """ diff --git a/robot_smach_states/src/robot_smach_states/navigation/follow_operator2_0.py b/robot_smach_states/src/robot_smach_states/navigation/follow_operator2_0.py index 6ccf9ccf8f..74f9e5fa85 100644 --- a/robot_smach_states/src/robot_smach_states/navigation/follow_operator2_0.py +++ b/robot_smach_states/src/robot_smach_states/navigation/follow_operator2_0.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import absolute_import, print_function # System import collections @@ -366,11 +366,9 @@ def execute(self, userdata): center_point=operator_pos_kdl, ignore_z=True) if recovered_operator: - print - "Found one!" + print("Found one!") self._operator_id = recovered_operator.id - print - "Recovered operator id: %s" % self._operator_id + print("Recovered operator id: %s" % self._operator_id) self._operator = recovered_operator self._robot.speech.speak("There you are! Go ahead, I'll follow you again", block=False) self._robot.head.close() @@ -378,8 +376,7 @@ def execute(self, userdata): userdata.recovered_operator = recovered_operator return 'follow' else: - print - "Could not find an entity {} meter near {}".format(self._lost_distance, operator_pos_kdl) + print("Could not find an entity {} meter near {}".format(self._lost_distance, operator_pos_kdl)) self._robot.head.close() return 'Failed' diff --git a/robot_smach_states/src/robot_smach_states/util/designators/utility.py b/robot_smach_states/src/robot_smach_states/util/designators/utility.py index b5d8965bf5..b41b7b0937 100755 --- a/robot_smach_states/src/robot_smach_states/util/designators/utility.py +++ b/robot_smach_states/src/robot_smach_states/util/designators/utility.py @@ -1,5 +1,5 @@ #! /usr/bin/env python -from __future__ import absolute_import +from __future__ import absolute_import, print_function # ROS import rospy diff --git a/test_tools/scripts/grasp-sensor-sim b/test_tools/scripts/grasp-sensor-sim index 4b72c95ce8..cb219f0689 100755 --- a/test_tools/scripts/grasp-sensor-sim +++ b/test_tools/scripts/grasp-sensor-sim @@ -2,19 +2,16 @@ # System import os +# ROS +import rospkg import sys +import rospy +import std_msgs.msg # Qt from python_qt_binding import loadUi from python_qt_binding.QtCore import QTimer -from python_qt_binding.QtWidgets import QApplication -from python_qt_binding.QtWidgets import QWidget - -# ROS -import rospkg -import rospy -import std_msgs.msg - +from python_qt_binding.QtWidgets import QApplication, QWidget SENSOR_RANGE = (5, 500) # Range in mm diff --git a/test_tools/scripts/odometer.py b/test_tools/scripts/odometer.py index dbe16d197b..05d86b897c 100755 --- a/test_tools/scripts/odometer.py +++ b/test_tools/scripts/odometer.py @@ -1,6 +1,7 @@ #! /usr/bin/env python import rospy + from test_tools import odometer rospy.init_node("odometer") diff --git a/test_tools/src/test_tools/data_collection/analyse-annotations.py b/test_tools/src/test_tools/data_collection/analyse-annotations.py index c438e9a593..8443d94e5b 100755 --- a/test_tools/src/test_tools/data_collection/analyse-annotations.py +++ b/test_tools/src/test_tools/data_collection/analyse-annotations.py @@ -1,12 +1,13 @@ #!/usr/bin/env python +from __future__ import print_function + # System import os # TU/e Robotics from robocup_knowledge import knowledge_loader - """ Counts the images in the subdirectories of ~/MEGA/data/training_data/annotated. Both the verified and diff --git a/test_tools/src/test_tools/data_collection/data_collector.py b/test_tools/src/test_tools/data_collection/data_collector.py index 8460d855b0..c5539aaad4 100755 --- a/test_tools/src/test_tools/data_collection/data_collector.py +++ b/test_tools/src/test_tools/data_collection/data_collector.py @@ -16,13 +16,16 @@ -h --help Show this screen. """ -from docopt import docopt -from datetime import datetime -import sys + +from __future__ import print_function + import os -from glob import glob import shutil -from util import parse_start_end, get_modification_date +from datetime import datetime +from docopt import docopt +from glob import glob + +from util import get_modification_date, parse_start_end GLOBS = { "faces": ["/tmp/faces/*.jpeg"], diff --git a/test_tools/src/test_tools/data_collection/hmi_logger.py b/test_tools/src/test_tools/data_collection/hmi_logger.py index e26549cf06..a0f7365b02 100755 --- a/test_tools/src/test_tools/data_collection/hmi_logger.py +++ b/test_tools/src/test_tools/data_collection/hmi_logger.py @@ -1,14 +1,12 @@ #!/usr/bin/python - -import rospy -from hmi_msgs.msg import QueryActionGoal, QueryActionResult - -from datetime import datetime -import os - # import pyaudio # import wave import json +import os +from datetime import datetime + +import rospy +from hmi_msgs.msg import QueryActionGoal, QueryActionResult # CHUNK = 1024 # FORMAT = pyaudio.paInt16 diff --git a/test_tools/src/test_tools/data_collection/log_audio.py b/test_tools/src/test_tools/data_collection/log_audio.py index 9386f1cb14..a9188361f7 100755 --- a/test_tools/src/test_tools/data_collection/log_audio.py +++ b/test_tools/src/test_tools/data_collection/log_audio.py @@ -1,14 +1,14 @@ #!/usr/bin/python -import rospy +from __future__ import print_function -from datetime import datetime +import json import os +import time +import wave +from datetime import datetime import pyaudio -import wave -import json -import time CHUNK = 1024 FORMAT = pyaudio.paInt16 diff --git a/test_tools/src/test_tools/data_collection/remote_data_collector.py b/test_tools/src/test_tools/data_collection/remote_data_collector.py index 34f5283875..2c4a0f191d 100755 --- a/test_tools/src/test_tools/data_collection/remote_data_collector.py +++ b/test_tools/src/test_tools/data_collection/remote_data_collector.py @@ -16,12 +16,13 @@ -h --help Show this screen. """ -from docopt import docopt -from datetime import datetime -import sys + +from __future__ import print_function + import os -from glob import glob -import shutil +from datetime import datetime +from docopt import docopt + from util import parse_start_end diff --git a/test_tools/src/test_tools/data_collection/robocup_recorder.py b/test_tools/src/test_tools/data_collection/robocup_recorder.py index 0a9b0d2086..1f9d9969ad 100755 --- a/test_tools/src/test_tools/data_collection/robocup_recorder.py +++ b/test_tools/src/test_tools/data_collection/robocup_recorder.py @@ -3,10 +3,13 @@ """Data collector """ +import os +import subprocess + import rospy -import subprocess, os from std_srvs.srv import Trigger, TriggerResponse + class Recorder(): def __init__(self): self._recording_process = None diff --git a/test_tools/src/test_tools/data_collection/util.py b/test_tools/src/test_tools/data_collection/util.py index e1f0351a76..5cd6697015 100644 --- a/test_tools/src/test_tools/data_collection/util.py +++ b/test_tools/src/test_tools/data_collection/util.py @@ -1,5 +1,9 @@ +from __future__ import print_function + +import os +import sys from datetime import datetime -import os, sys + def get_modification_date(file_name): try: diff --git a/test_tools/src/test_tools/doctest_unittest.py b/test_tools/src/test_tools/doctest_unittest.py index a1f88ec0d9..d0a42fd396 100644 --- a/test_tools/src/test_tools/doctest_unittest.py +++ b/test_tools/src/test_tools/doctest_unittest.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import doctest import importlib import os diff --git a/test_tools/src/test_tools/headless_smach_viewer.py b/test_tools/src/test_tools/headless_smach_viewer.py index 23c473ec9e..5fb4abc705 100755 --- a/test_tools/src/test_tools/headless_smach_viewer.py +++ b/test_tools/src/test_tools/headless_smach_viewer.py @@ -30,21 +30,15 @@ # # Author: Jonathan Bohren +from __future__ import print_function -import rospy - -from smach_msgs.msg import SmachContainerStatus,SmachContainerInitialStatusCmd,SmachContainerStructure - -import sys -import os -import threading import pickle -import pprint -import copy -import StringIO -import colorsys - +import threading import wxversion + +import rospy +from smach_msgs.msg import SmachContainerStatus, SmachContainerStructure + wxversion.select("2.8") import wx import wx.richtext diff --git a/test_tools/src/test_tools/odometer.py b/test_tools/src/test_tools/odometer.py index 8d749f4694..3979d1b61a 100644 --- a/test_tools/src/test_tools/odometer.py +++ b/test_tools/src/test_tools/odometer.py @@ -2,16 +2,16 @@ from __future__ import print_function +import csv import os import socket import time -import csv from fnmatch import fnmatch -import rospy -from math import sqrt, pow, pi -from tf.transformations import euler_from_quaternion +from math import pi, pow, sqrt +import rospy from nav_msgs.msg import Odometry +from tf.transformations import euler_from_quaternion DEFAULT_PATH = "~/odometer" DEFAULT_FILENAME = 'odometer'