mirte_lc_nav2.navigation module
LabClean navigation server implementation for ROS 2.
This module implements the LabCleanActionServer node, which exposes a /labclean_navigator/coverage action and a /labclean_navigator/set_state service. It coordinates coverage planning, pause/resume handling, and integration with the Nav2 costmap.
- class mirte_lc_nav2.navigation.LabCleanActionServer
Bases:
rclpy.node.NodeAction server node for LabClean coverage navigation.
The node accepts NavigateCoverage goals, executes coverage segments using planner classes from
mirte_lc_nav2.navigators, and supports pause/resume/stop commands through a service interface.- cancel_callback(goal_handle)
Accept cancel requests for the current coverage goal.
- Args:
goal_handle: Handle for the currently executing action goal.
- Returns:
CancelResponse: Response indicating cancellation acceptance.
- costmap_callback(msg)
Store the latest occupancy grid costmap message.
- Args:
msg (nav_msgs.msg.OccupancyGrid): Costmap message.
- execute_callback(goal_handle)
Execute a accepted coverage navigation goal.
This callback plans coverage segments, sends navigation poses to the selected planner, and monitors pause, resume, and cancellation states.
- Args:
goal_handle: Handle for the accepted NavigateCoverage goal.
- Returns:
NavigateCoverage.Result: Action result containing success status.
- get_robot_position()
Retrieve the current robot position in the map frame.
- Returns:
numpy.ndarray | None: Robot position as [x, y] or None if unavailable.
- goal_callback(goal_request)
Accept or reject incoming coverage action goals.
- Args:
goal_request: Incoming action goal request.
- Returns:
GoalResponse: Acceptance decision for the goal.
- lookup_planner(planner_name)
Select a coverage planner implementation by name.
- Args:
planner_name (str): Requested planner identifier.
- Returns:
Callable: Planner class associated with the name.
- save_path()
Save the remaining coverage path when navigation is paused.
This method attempts to compute the remaining segment from the current robot pose and inserts the remaining path back into the queue.
- status_callback(request, response)
Handle pause/resume/stop service requests for coverage execution.
- Args:
request: ServeCoverageStatus service request. response: ServeCoverageStatus service response.
- Returns:
ServeCoverageStatus.Response: Response with success state and remaining poses.
- mirte_lc_nav2.navigation.main()
Run the LabClean navigation action server node.