Nav2 Navigation Stack - rolling  main
ROS 2 Navigation Stack
Public Types | Public Member Functions | List of all members
opennav_docking_core::NonChargingDock Class Referenceabstract

Abstract interface for a non-charging dock for the docking framework. More...

#include <nav2_docking/opennav_docking_core/include/opennav_docking_core/non_charging_dock.hpp>

Inheritance diagram for opennav_docking_core::NonChargingDock:
Inheritance graph
[legend]
Collaboration diagram for opennav_docking_core::NonChargingDock:
Collaboration graph
[legend]

Public Types

using Ptr = std::shared_ptr< NonChargingDock >
 
- Public Types inherited from opennav_docking_core::ChargingDock
using Ptr = std::shared_ptr< ChargingDock >
 

Public Member Functions

virtual ~NonChargingDock ()
 Virtual destructor.
 
virtual void configure (const nav2::LifecycleNode::WeakPtr &parent, const std::string &name, std::shared_ptr< tf2_ros::Buffer > tf)=0
 
virtual void cleanup ()=0
 Method to cleanup resources used on shutdown.
 
virtual void activate ()=0
 Method to active Behavior and any threads involved in execution.
 
virtual void deactivate ()=0
 Method to deactivate Behavior and any threads involved in execution.
 
virtual geometry_msgs::msg::PoseStamped getStagingPose (const geometry_msgs::msg::Pose &pose, const std::string &frame)=0
 Method to obtain the dock's staging pose. This method should likely be using TF and the dock's pose information to find the staging pose from a static or parameterized staging pose relative to the docking pose. More...
 
virtual bool getRefinedPose (geometry_msgs::msg::PoseStamped &pose, std::string id)=0
 Method to obtain the refined pose of the dock, usually based on sensors. More...
 
virtual bool isDocked ()=0
 Have we made contact with dock? This can be implemented in a variety of ways: by establishing communications with the dock, by monitoring the the drive motor efforts, etc. More...
 
bool isCharging () final
 Are we charging? If a charge dock requires any sort of negotiation to begin charging, that should happen inside this function as this function will be called repeatedly after the docking loop to check if successful. More...
 
bool disableCharging () final
 Undocking while current is still flowing can damage a charge dock so some charge docks provide the ability to disable charging before the robot physically disconnects. The undocking action will not command the robot to move until this returns true. More...
 
bool hasStoppedCharging () final
 Similar to isCharging() but called when undocking.
 
bool isCharger () final
 Gets if this is a charging-typed dock.
 
- Public Member Functions inherited from opennav_docking_core::ChargingDock
virtual ~ChargingDock ()
 Virtual destructor.
 
DockDirection getDockDirection ()
 Indicates the direction of the dock. This is used to determine if the robot should drive forwards or backwards onto the dock. More...
 
bool shouldRotateToDock ()
 Determines whether the robot should rotate 180ยบ to face away from the dock. For example, to perform a backward docking without detections. More...
 
std::string getName ()
 

Additional Inherited Members

- Protected Attributes inherited from opennav_docking_core::ChargingDock
std::string name_
 
DockDirection dock_direction_ {DockDirection::UNKNOWN}
 
bool rotate_to_dock_ {false}
 

Detailed Description

Abstract interface for a non-charging dock for the docking framework.

Definition at line 31 of file non_charging_dock.hpp.

Member Function Documentation

◆ configure()

virtual void opennav_docking_core::NonChargingDock::configure ( const nav2::LifecycleNode::WeakPtr &  parent,
const std::string &  name,
std::shared_ptr< tf2_ros::Buffer >  tf 
)
pure virtual
Parameters
parentpointer to user's node
nameThe name of this planner
tfA pointer to a TF buffer

Implements opennav_docking_core::ChargingDock.

Implemented in opennav_docking::SimpleNonChargingDock.

◆ disableCharging()

bool opennav_docking_core::NonChargingDock::disableCharging ( )
inlinefinalvirtual

Undocking while current is still flowing can damage a charge dock so some charge docks provide the ability to disable charging before the robot physically disconnects. The undocking action will not command the robot to move until this returns true.

NOTE: this function is expected to return QUICKLY. Blocking here will block the docking controller loop.

Implements opennav_docking_core::ChargingDock.

Definition at line 115 of file non_charging_dock.hpp.

◆ getRefinedPose()

virtual bool opennav_docking_core::NonChargingDock::getRefinedPose ( geometry_msgs::msg::PoseStamped &  pose,
std::string  id 
)
pure virtual

Method to obtain the refined pose of the dock, usually based on sensors.

Parameters
poseThe initial estimate of the dock pose.
frameThe frame of the initial estimate.

Implements opennav_docking_core::ChargingDock.

Implemented in opennav_docking::SimpleNonChargingDock.

◆ getStagingPose()

virtual geometry_msgs::msg::PoseStamped opennav_docking_core::NonChargingDock::getStagingPose ( const geometry_msgs::msg::Pose &  pose,
const std::string &  frame 
)
pure virtual

Method to obtain the dock's staging pose. This method should likely be using TF and the dock's pose information to find the staging pose from a static or parameterized staging pose relative to the docking pose.

Parameters
poseDock pose
frameDock's frame of pose
Returns
PoseStamped of staging pose in the specified frame

Implements opennav_docking_core::ChargingDock.

Implemented in opennav_docking::SimpleNonChargingDock.

◆ isCharging()

bool opennav_docking_core::NonChargingDock::isCharging ( )
inlinefinalvirtual

Are we charging? If a charge dock requires any sort of negotiation to begin charging, that should happen inside this function as this function will be called repeatedly after the docking loop to check if successful.

NOTE: this function is expected to return QUICKLY. Blocking here will block the docking controller loop.

Implements opennav_docking_core::ChargingDock.

Definition at line 101 of file non_charging_dock.hpp.

◆ isDocked()

virtual bool opennav_docking_core::NonChargingDock::isDocked ( )
pure virtual

Have we made contact with dock? This can be implemented in a variety of ways: by establishing communications with the dock, by monitoring the the drive motor efforts, etc.

NOTE: this function is expected to return QUICKLY. Blocking here will block the docking controller loop.

Implements opennav_docking_core::ChargingDock.

Implemented in opennav_docking::SimpleNonChargingDock.


The documentation for this class was generated from the following file: