Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthijsBurgh committed Mar 29, 2021
1 parent 02fe4cb commit 9bece90
Show file tree
Hide file tree
Showing 155 changed files with 456 additions and 361 deletions.
14 changes: 6 additions & 8 deletions challenge_cleanup/src/challenge_r5/amigo/self_cleanup.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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")),
Expand Down
2 changes: 1 addition & 1 deletion challenge_cleanup/src/challenge_r5/amigo/timeout.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import multiprocessing
import time
import sys
import time


def _target(queue, function, *args, **kwargs):
Expand Down
18 changes: 9 additions & 9 deletions challenge_demo/src/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
7 changes: 4 additions & 3 deletions challenge_demo/test/grammar_test.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
6 changes: 1 addition & 5 deletions challenge_eegpsr/src/add_entities.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/python

import rospy
import itertools
import os

import rospy
from fast_simulator import client

if __name__ == "__main__":
Expand Down Expand Up @@ -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)




12 changes: 6 additions & 6 deletions challenge_eegpsr/src/eegpsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


# ------------------------------------------------------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion challenge_eegpsr/src/generate_command.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
6 changes: 4 additions & 2 deletions challenge_eegpsr/src/test_recognition.py
Original file line number Diff line number Diff line change
@@ -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

# ----------------------------------------------------------------------------------------------------

Expand Down
11 changes: 7 additions & 4 deletions challenge_eegpsr/test/navigate_in_front_of.py
Original file line number Diff line number Diff line change
@@ -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__":
Expand Down Expand Up @@ -46,6 +52,3 @@
robot.speech.speak(segmented_entities.error_msg)

robot.head.close()



6 changes: 2 additions & 4 deletions challenge_final/scripts/challenge_final
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
8 changes: 4 additions & 4 deletions challenge_final/src/challenge_final/clustering.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
15 changes: 8 additions & 7 deletions challenge_final/src/challenge_final/display_orders_on_map.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -181,5 +184,3 @@ def execute(self, ud):

sm = DisplayOrdersOnMap(robot=_robot)
print(sm.execute(user_data))


4 changes: 1 addition & 3 deletions challenge_final/src/challenge_final/find_people.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
5 changes: 2 additions & 3 deletions challenge_final/src/challenge_final/get_orders.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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']])


2 changes: 0 additions & 2 deletions challenge_final/src/challenge_final/lightsaber.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions challenge_final/src/challenge_final/select_image_by_letter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
import math
import os
import pickle
import random
import rospkg
import time
from collections import deque
from datetime import datetime

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 = []
Expand Down
14 changes: 5 additions & 9 deletions challenge_final/src/challenge_final/select_option_for_image.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -154,5 +152,3 @@ def speak(*args, **kwargs):
else:
print("Please provide robot name as argument.")
exit(1)


3 changes: 2 additions & 1 deletion challenge_final/test/test_find_and_order.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import argparse

import rospy
import smach

import smach
from challenge_final import FindPeople, GetOrders
from robot_skills import get_robot

Expand Down
Loading

0 comments on commit 9bece90

Please sign in to comment.