Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nav2_simple_commander/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ The methods provided by the basic navigator are shown below, with inputs and exp
| waitUntilNav2Active(navigator='bt_navigator, localizer='amcl') | Blocks until Nav2 is completely online and lifecycle nodes are in the active state. To be used in conjunction with autostart or external lifecycle bringup. Custom navigator and localizer nodes can be specified |
| lifecycleStartup() | Sends a request to all lifecycle management servers to bring them into the active state, to be used if autostart is `false` and you want this program to control Nav2's lifecycle. |
| lifecycleShutdown() | Sends a request to all lifecycle management servers to shut them down. |
| destroyNode() | Releases the resources used by the object. |

A general template for building applications is as follows:

Expand Down
15 changes: 15 additions & 0 deletions nav2_simple_commander/nav2_simple_commander/robot_navigator.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,21 @@ def __init__(self):
self.get_costmap_global_srv = self.create_client(GetCostmap, '/global_costmap/get_costmap')
self.get_costmap_local_srv = self.create_client(GetCostmap, '/local_costmap/get_costmap')

def destroyNode(self):
self.destroy_node()

def destroy_node(self):
self.nav_through_poses_client.destroy()
self.nav_to_pose_client.destroy()
self.follow_waypoints_client.destroy()
self.follow_path_client.destroy()
self.compute_path_to_pose_client.destroy()
self.compute_path_through_poses_client.destroy()
self.smoother_client.destroy()
self.spin_client.destroy()
self.backup_client.destroy()
super().destroy_node()

def setInitialPose(self, initial_pose):
"""Set the initial pose to the localization system."""
self.initial_pose_received = False
Expand Down