Skip to content

Commit

Permalink
changes made to fix issues after testing and added a new kitchen.urdf
Browse files Browse the repository at this point in the history
  • Loading branch information
Celina1272001 committed Mar 1, 2024
1 parent c2b036e commit c30f911
Show file tree
Hide file tree
Showing 7 changed files with 677 additions and 27 deletions.
23 changes: 11 additions & 12 deletions demos/pycram_hsrb_real_test_demos/pick-up-real.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from pycram.ros.viz_marker_publisher import VizMarkerPublisher
import pycram.external_interfaces.giskard as giskardpy
from demos.pycram_hsrb_real_test_demos.utils.misc import *
#from pycram.external_interfaces.knowrob import get_table_pose
from pycram.external_interfaces.knowrob import get_table_pose

# Initialize the Bullet world for simulation
world = BulletWorld()
Expand All @@ -28,7 +28,7 @@
robot.set_color([0.5, 0.5, 0.9, 1])

# Create environmental objects
apartment = Object("kitchen", ObjectType.ENVIRONMENT, "couch-kitchen.urdf")
apartment = Object("kitchen", ObjectType.ENVIRONMENT, "couch-kitchenmarch1.urdf")

# Define orientation for objects
object_orientation = axis_angle_to_quaternion([0, 0, 1], 180)
Expand Down Expand Up @@ -116,7 +116,7 @@ def pickup_and_place_objects(robot, sorted_obj):
PlaceGivenObjAction([sorted_obj[value].type], ["left"], [Pose([4.86, y_pos, 0])],
["front"]).resolve().perform()
else:
PlaceAction(sorted_obj[value], ["left"], [grasp], [Pose([4.85, y_pos, z])]).resolve().perform()
PlaceAction(sorted_obj[value], ["left"], [grasp], [Pose([4.87, y_pos, z])]).resolve().perform()

ParkArmsAction([Arms.LEFT]).resolve().perform()
TalkingMotion("Navigating").resolve().perform()
Expand Down Expand Up @@ -145,10 +145,10 @@ def get_z(obj_type: str):
return PlacingZPose[obj_type.upper()].value

def navigate_to(x,y, table_name):
if table_name == "popcorn table":
NavigateAction(target_locations=[Pose([x, y, 0], [0, 0, 1, 0])]).resolve().perform()
elif table_name == "long table":
NavigateAction(target_locations=[Pose([x, y, 0], [0, 0, 0, 1])]).resolve().perform()
if table_name == "popcorn table":
NavigateAction(target_locations=[Pose([x, y, 0], [0, 0, 1, 0])]).resolve().perform()
elif table_name == "long table":
NavigateAction(target_locations=[Pose([x, y, 0], [0, 0, 0, 1])]).resolve().perform()


# def navigate_to(turn_around, y, table_name):
Expand All @@ -160,7 +160,8 @@ def navigate_to(x,y, table_name):
# :param orientation: defines the orientation of the robot respectively the name of the table to move to
# """
# table = get_table_pose(table_name)
# print(f"table_pose: {table}")
#
# print(f"table_pose: {table.posestamped.pose.position.x}")
# if turn_around:
# NavigateAction(target_locations=[Pose([2, y, table.pose.position.z], table.pose.orentation)]).resolve().perform()
# else:
Expand All @@ -175,12 +176,10 @@ def navigate_and_detect():
"""
TalkingMotion("Navigating").resolve().perform()
#navigate_to(False, 1.8, "popcorn table")
navigate_to(1.6, 1.8, "popcorn table")
navigate_to(1.7, 1.8, "popcorn table") # 1.6

# popcorntable
# todo gucken ob ein aufruf genügt
#LookAtAction(targets=[Pose([0.8, 1.8, 0.21], object_orientation)]).resolve().perform()
LookAtAction(targets=[Pose([0.8, 1.8, 0.21], object_orientation)]).resolve().perform()
LookAtAction(targets=[Pose([0.8, 1.8, 0.21], object_orientation)]).resolve().perform() # 0.18 vanessa
TalkingMotion("Perceiving").resolve().perform()
try:
object_desig = DetectAction(technique='all').resolve().perform()
Expand Down
4 changes: 3 additions & 1 deletion demos/pycram_receptionist_demo/M2_Demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def demo_ms2(area):

# guest_data format is = ['person infos: "name', 'drink"']
guest_data = get_guest_info("1.0")
print(get_guest_info("1.0"))
while guest_data == ['person_infos: "No name saved under this ID!"']:
talk_error("no name")
rospy.sleep(13)
Expand All @@ -78,6 +79,7 @@ def demo_ms2(area):
# set heard name and drink of guest
guest1.set_name(guest_data[0][13:])
guest1.set_drink(guest_data[1])
rospy.loginfo("after while")
talk_request(guest_data)
rospy.sleep(1)

Expand Down Expand Up @@ -113,4 +115,4 @@ def demo_ms2(area):


# demo_test('from_couch')
demo_ms2('to_couch')
demo_ms2('now')
Loading

0 comments on commit c30f911

Please sign in to comment.