forked from SUTURO/pycram
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request SUTURO#51 from Julislz/MS2
[Receptionist] alternate gaze during introduction and expanded Human …
- Loading branch information
Showing
5 changed files
with
104 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,16 @@ | ||
import rospy | ||
|
||
from pycram.designators.action_designator import DetectAction, NavigateAction | ||
from pycram.designators.motion_designator import TalkingMotion | ||
from pycram.fluent import Fluent | ||
from demos.pycram_receptionist_demo.utils.misc import * | ||
from pycram.helper import axis_angle_to_quaternion | ||
from pycram.process_module import real_robot | ||
import pycram.external_interfaces.giskard as giskardpy | ||
from pycram.external_interfaces.knowrob import get_guest_info | ||
from pycram.ros.robot_state_updater import RobotStateUpdater | ||
from pycram.ros.viz_marker_publisher import VizMarkerPublisher | ||
from pycram.designators.location_designator import * | ||
from pycram.designators.object_designator import * | ||
from pycram.bullet_world import BulletWorld, Object | ||
from std_msgs.msg import String, Bool | ||
from demos.pycram_receptionist_demo.deprecated import talk_actions | ||
import pycram.external_interfaces.navigate as moveBase | ||
|
||
world = BulletWorld("DIRECT") | ||
# /pycram/viz_marker topic bei Marker Array | ||
v = VizMarkerPublisher() | ||
|
||
robot = Object("hsrb", "robot", "../../resources/" + robot_description.name + ".urdf") | ||
robot_desig = ObjectDesignatorDescription(names=["hsrb"]).resolve() | ||
robot.set_color([0.5, 0.5, 0.9, 1]) | ||
|
||
# carefull that u spawn the correct kitchen | ||
kitchen = Object("kitchen", "environment", "kitchen.urdf") | ||
giskardpy.init_giskard_interface() | ||
RobotStateUpdater("/tf", "/giskard_joint_states") | ||
|
||
pub_nlp = rospy.Publisher('/startListener', String, queue_size=10) | ||
|
||
|
||
def test(): | ||
with real_robot: | ||
print("start demo") | ||
#TalkingMotion("Hello we will test NLP now").resolve().perform() | ||
#rospy.sleep(1) | ||
import demos.pycram_receptionist_demo.utils.misc as misc | ||
|
||
TalkingMotion("Hello, i am Toya and my favorite drink is oil. What about you, talk to me?").resolve().perform() | ||
rospy.sleep(6) | ||
pub_nlp.publish("start listening") | ||
|
||
# failure handling | ||
rospy.loginfo("before Subscriber") | ||
def doorbell_fct(): | ||
|
||
# failure handling | ||
rospy.Subscriber("nlp_feedback", Bool, talk_error) | ||
rospy.Subscriber("doorbell", Bool, misc.doorbell_cb) | ||
while not misc.doorbell: | ||
rospy.sleep(1) | ||
|
||
# receives name and drink via topic | ||
rospy.Subscriber("nlp_out", String, talk_request_nlp) | ||
print("doorbell sound was heard!") | ||
|
||
while True: | ||
print("Hello") | ||
|
||
|
||
if __name__ == '__main__': | ||
test() | ||
doorbell_fct() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters