Skip to content

Commit

Permalink
feat: return waypoints in result.
Browse files Browse the repository at this point in the history
  • Loading branch information
jws-1 committed Jul 17, 2024
1 parent 6034c5e commit eccde99
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions common/navigation/lasr_person_following/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ find_package(catkin REQUIRED COMPONENTS
genmsg
actionlib_msgs
actionlib
geometry_msgs
)

## System dependencies are found with CMake's conventions
Expand Down Expand Up @@ -73,6 +74,7 @@ add_action_files(
generate_messages(
DEPENDENCIES
actionlib_msgs
geometry_msgs
)

################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
#result definition
geometry_msgs/Pose[] waypoints
---
#feedback
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@

from pal_interaction_msgs.msg import TtsGoal, TtsAction

from lasr_person_following.msg import (
FollowAction,
FollowGoal,
FollowResult,
FollowFeedback,
)

MAX_VISION_DIST: float = 5.0


Expand Down Expand Up @@ -381,7 +388,9 @@ def _tts(self, text: str, wait: bool) -> None:
else:
self._tts_client.send_goal(tts_goal)

def follow(self) -> None:
def follow(self) -> FollowResult:

result = FollowResult()

person_trajectory: PoseArray = PoseArray()
person_trajectory.header.frame_id = "odom"
Expand Down Expand Up @@ -489,7 +498,8 @@ def follow(self) -> None:
):
rospy.logwarn("Goal was aborted, retrying")
self._move_base(prev_goal)
self._waypoints.append(prev_goal)
result.waypoints.append(prev_goal)
# self._waypoints.append(prev_goal)
# check if the person has been static for too long
elif (
(
Expand Down Expand Up @@ -522,3 +532,4 @@ def follow(self) -> None:
rospy.loginfo("")
rospy.loginfo(np.mean([np.linalg.norm(vel) for vel in track_vels]))
rospy.loginfo("")
return result

0 comments on commit eccde99

Please sign in to comment.