Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Receptionist #274

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion skills/src/lasr_skills/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from .detect_gesture import DetectGesture
from .look_at_person import LookAtPerson
from .wait import Wait
from .find_gesture_person import FindGesturePerson
from .adjust_camera import AdjustCamera
from .guide import Guide
from .detect_clothing import DetectClothing
Expand Down
26 changes: 11 additions & 15 deletions tasks/receptionist/src/receptionist/state_machine.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
from typing import List, Tuple

import rospy
import smach
import smach_ros

from lasr_vision_msgs.srv import Recognise
from geometry_msgs.msg import Pose, Point, PointStamped
from shapely.geometry import Polygon
from geometry_msgs.msg import Point, PointStamped, Pose
from lasr_skills import (
GoToLocation,
WaitForPersonInArea,
Say,
AskAndListen,
PlayMotion,
GoToLocation,
LookToPoint,
PlayMotion,
Say,
Wait,
WaitForPersonInArea,
)
from std_msgs.msg import Header, Empty
from receptionist.states import (
HandleGuest,
IntroduceAndSeatGuest,
)

import rospy
from lasr_vision_msgs.srv import Recognise
from receptionist.states import HandleGuest, IntroduceAndSeatGuest
from shapely.geometry import Polygon
from std_msgs.msg import Empty, Header


class Receptionist(smach.StateMachine):
Expand Down
9 changes: 5 additions & 4 deletions tasks/receptionist/src/receptionist/states/introduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

"""

from typing import Any, Dict, List, Optional

import rospy
import smach
from lasr_skills import LookToPoint, Say
from smach import UserData
from lasr_skills import Say, LookToPoint
from typing import Dict, List, Any, Optional


def stringify_guest_data(
Expand All @@ -27,8 +28,6 @@ def stringify_guest_data(

relevant_guest_data = guest_data[guest_id]

relevant_guest_data["attributes"]["has_hair"] = 0.5

guest_str = f"{relevant_guest_data['name']}, their favourite drink is {relevant_guest_data['drink']}. "

if (
Expand All @@ -38,6 +37,8 @@ def stringify_guest_data(
):
return guest_str

relevant_guest_data["attributes"]["has_hair"] = 0.5

if relevant_guest_data["attributes"]["long_hair"]:
guest_str += "They have long hair. "
else:
Expand Down