Skip to content

Commit

Permalink
Merge pull request #35 from ipa-jsk/noetic-devel
Browse files Browse the repository at this point in the history
Add service to get all frame names
  • Loading branch information
ipa-jsk authored Nov 11, 2024
2 parents 194e184 + f1ca98d commit ff6a724
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions frame_editor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ add_service_files(
AlignFrame.srv
EditFrame.srv
GetFrame.srv
GetFrameNames.srv
RemoveFrame.srv
SetFrame.srv
SetParentFrame.srv
Expand Down
13 changes: 13 additions & 0 deletions frame_editor/src/frame_editor/interface_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(self, frame_editor):
rospy.Service("~align_frame", AlignFrame, self.callback_align_frame)
rospy.Service("~edit_frame", EditFrame, self.callback_edit_frame)
rospy.Service("~get_frame", GetFrame, self.callback_get_frame)
rospy.Service("~get_frame_names", GetFrameNames, self.callback_get_frame_names)
rospy.Service("~remove_frame", RemoveFrame, self.callback_remove_frame)
rospy.Service("~set_frame", SetFrame, self.callback_set_frame)
rospy.Service("~set_parent", SetParentFrame, self.callback_set_parent_frame)
Expand Down Expand Up @@ -112,6 +113,18 @@ def callback_get_frame(self, request):
response.pose = ToPose(f.position, f.orientation)

return response


def callback_get_frame_names(self, request):
print("> Request to get frame names")

response = GetFrameNamesResponse()
response.error_code = 0

for frame in self.editor.frames.values():
response.names.append(frame.name)

return response


def callback_remove_frame(self, request):
Expand Down
3 changes: 3 additions & 0 deletions frame_editor/srv/GetFrameNames.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
int32 error_code
string[] names

0 comments on commit ff6a724

Please sign in to comment.