Skip to content

Commit

Permalink
Merge pull request #965 from tue-robotics/tak_out_the_garbage/fixes
Browse files Browse the repository at this point in the history
Fix(nosetest): add construction test and make sure it works
  • Loading branch information
MatthijsBurgh committed Dec 14, 2019
2 parents 58fd400 + 94408b4 commit ea423ba
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
CHALLENGE_KNOWLEDGE = load_knowledge('challenge_take_out_the_garbage')


class DropTrash(smach.StateMachine):
class DropTrash(smach.State):
"""
State that moves the robot to the drop bag position and opens the gripper
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ class MeasureForce(object):

def __init__(self, robot):
"""
Constructor
:param robot: robot object
"""
self._robot = robot

Expand Down Expand Up @@ -227,17 +229,19 @@ def __init__(self, robot, arm_designator, grabbed_entity_label="", grabbed_entit
transitions={'spoken': 'SHOW_IMAGE'})

smach.StateMachine.add("SHOW_IMAGE",
states.ShowImageState(robot=robot, package_name='challenge_take_out_the_garbage',
path_to_image_in_package=
'src/challenge_take_out_the_garbage/beun_picture.png',
seconds=5),
states.ShowImageState(
robot=robot,
image_filename="~/ros/kinetic/system/src/challenge_take_out_the_garbage/src"
"/challenge_take_out_the_garbage/beun_picture.png",
seconds=5),
transitions={'succeeded': 'CLOSE_AFTER_INSERT'})

smach.StateMachine.add('CLOSE_AFTER_INSERT', manipulation.CloseGripperOnHandoverToRobot(robot,
arm_designator,
grabbed_entity_label=grabbed_entity_label,
grabbed_entity_designator=grabbed_entity_designator,
timeout=timeout),
smach.StateMachine.add('CLOSE_AFTER_INSERT', manipulation.CloseGripperOnHandoverToRobot(
robot,
arm_designator,
grabbed_entity_label=grabbed_entity_label,
grabbed_entity_designator=grabbed_entity_designator,
timeout=timeout),
transitions={'succeeded': 'succeeded',
'timeout': 'failed',
'failed': 'failed'})
Expand Down
18 changes: 18 additions & 0 deletions challenge_take_out_the_garbage/test/test_construction.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import os
import unittest


class TestChallengeConstruction(unittest.TestCase):
def test_construction(self):
"""
If no exception is raised, this test will succeed
"""
os.environ["ROBOT_ENV"] = "robotics_testlabs"
from robot_skills.mockbot import Mockbot
from challenge_take_out_the_garbage.take_out_the_garbage import TakeOutGarbage
robot = Mockbot()
TakeOutGarbage(robot)


if __name__ == '__main__':
unittest.main()
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
trashbin_id = "trashbin"
trashbin_id2 = "trashbin"
drop_zone_id = "operator_table"
helper_waypoint = "initial_pose"
end_waypoint = "initial_pose"

0 comments on commit ea423ba

Please sign in to comment.