Skip to content

Commit f8fec3f

Browse files
authored
Edited spot_ros2 to work with new graphnav modules (#120)
1 parent d4e5eb9 commit f8fec3f

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

spot_driver/spot_driver/spot_ros2.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ def publish_graph_nav_pose_callback(self) -> None:
861861

862862
try:
863863
# noinspection PyProtectedMember
864-
state = self.spot_wrapper._graph_nav_client.get_localization_state()
864+
state = self.spot_wrapper.spot_graph_nav._graph_nav_client.get_localization_state()
865865
if not state.localization.waypoint_id:
866866
self.get_logger().warning("Robot is not localized; Please upload graph and localize.")
867867
return
@@ -1934,11 +1934,11 @@ def handle_graph_nav_set_localization(
19341934

19351935
try:
19361936
if request.method == "fiducial":
1937-
self.spot_wrapper._set_initial_localization_fiducial()
1937+
self.spot_wrapper.spot_graph_nav.set_initial_localization_fiducial()
19381938
response.success = True
19391939
response.message = "Success"
19401940
elif request.method == "waypoint":
1941-
self.spot_wrapper._set_initial_localization_waypoint([request.waypoint_id])
1941+
self.spot_wrapper.spot_graph_nav.set_initial_localization_waypoint([request.waypoint_id])
19421942
response.success = True
19431943
response.message = "Success"
19441944
else:
@@ -1964,7 +1964,7 @@ def handle_graph_nav_upload_graph(
19641964

19651965
try:
19661966
self.get_logger().info(f"Uploading GraphNav map: {request.upload_filepath}")
1967-
self.spot_wrapper._upload_graph_and_snapshots(request.upload_filepath)
1967+
self.spot_wrapper.spot_graph_nav.upload_graph(request.upload_filepath)
19681968
self.get_logger().info("Uploaded")
19691969
response.success = True
19701970
response.message = "Success"
@@ -1985,7 +1985,7 @@ def handle_graph_nav_clear_graph(
19851985

19861986
try:
19871987
self.get_logger().info("Clearing graph")
1988-
self.spot_wrapper._clear_graph()
1988+
self.spot_wrapper.spot_graph_nav.clear_graph()
19891989
self.get_logger().info("Cleared")
19901990
response.success = True
19911991
response.message = "Success"
@@ -2005,9 +2005,9 @@ def handle_list_graph(self, request: ListGraph.Request, response: ListGraph.Resp
20052005

20062006
try:
20072007
self.get_logger().error(f"handle_list_graph: {request}")
2008-
self.spot_wrapper._clear_graph()
2009-
self.spot_wrapper._upload_graph_and_snapshots(request.upload_filepath)
2010-
response.waypoint_ids = self.spot_wrapper.list_graph(request.upload_filepath)
2008+
self.spot_wrapper.spot_graph_nav.clear_graph()
2009+
self.spot_wrapper.spot_graph_nav.upload_graph(request.upload_filepath)
2010+
response.waypoint_ids = self.spot_wrapper.spot_graph_nav.list_graph(request.upload_filepath)
20112011
self.get_logger().error(f"handle_list_graph RESPONSE: {response}")
20122012
except Exception as e:
20132013
self.get_logger().error("Exception Error:{}".format(e))
@@ -2078,7 +2078,7 @@ def handle_navigate_to(self, goal_handle: ServerGoalHandle) -> NavigateTo.Result
20782078
return response
20792079

20802080
# run navigate_to
2081-
resp = self.spot_wrapper.navigate_to(
2081+
resp = self.spot_wrapper.spot_graph_nav.navigate_to(
20822082
upload_path=goal_handle.request.upload_path,
20832083
navigate_to=goal_handle.request.navigate_to,
20842084
initial_localization_fiducial=goal_handle.request.initial_localization_fiducial,

0 commit comments

Comments
 (0)