Skip to content

Commit 79e56f7

Browse files
committed
(speech_recognition) apply pykdl_ros
1 parent 6be85db commit 79e56f7

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

challenge_speech_recognition/package.xml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,9 @@
1313

1414
<buildtool_depend>catkin</buildtool_depend>
1515

16-
<build_depend>geometry_msgs</build_depend>
17-
<build_depend>robot_skills</build_depend>
18-
<build_depend>robot_smach_states</build_depend>
19-
<build_depend>rospy</build_depend>
20-
<build_depend>tf</build_depend>
21-
22-
<exec_depend>geometry_msgs</exec_depend>
23-
<exec_depend>robot_skills</exec_depend>
24-
<exec_depend>robot_smach_states</exec_depend>
25-
<exec_depend>rospy</exec_depend>
26-
<exec_depend>tf</exec_depend>
16+
<depend>pykdl_ros</depend>
17+
<depend>robot_skills</depend>
18+
<depend>robot_smach_states</depend>
19+
<depend>rospy</depend>
2720

2821
</package>

challenge_speech_recognition/src/indirect_speech_recognition.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
from __future__ import print_function
44

5-
import rospy
6-
import smach
75
import sys
86
import random
97
import math
108
import time
119

10+
from pykdl_ros import VectorStamped
11+
import rospy
12+
import smach
1213

1314
import robot_smach_states as states
1415

@@ -53,7 +54,7 @@ def _turn_to_closest_entity(self):
5354
operator = None
5455
while not operator:
5556
operator = self.robot.ed.get_closest_entity(self, radius=1.9,
56-
center_point=self.robot.base.get_location().extractVectorStamped())
57+
center_point=VectorStamped.from_framestamped(self.robot.base.get_location()))
5758
print(operator)
5859
if not operator:
5960
vth = 0.5
@@ -66,8 +67,8 @@ def _turn_to_closest_entity(self):
6667
# Turn towards the operator
6768
current = self.robot.base.get_location()
6869
robot_th = current.frame.M.GetRPY()[2] # Get the Yaw, rotation around Z
69-
desired_th = math.atan2(operator._pose.p.y() - current.frame.p.y(),
70-
operator._pose.p.x() - current.frame.p.x())
70+
desired_th = math.atan2(operator.pose.frame.p.y() - current.frame.p.y(),
71+
operator.pose.frame.p.x() - current.frame.p.x())
7172

7273
# Calculate params
7374
th = desired_th - robot_th

0 commit comments

Comments
 (0)