Nav2 Navigation Stack - rolling  main
ROS 2 Navigation Stack
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
nav2_costmap_2d::CostmapSubscriber Class Reference

Subscribes to the costmap via a ros topic. More...

#include <nav2_costmap_2d/include/nav2_costmap_2d/costmap_subscriber.hpp>

Collaboration diagram for nav2_costmap_2d::CostmapSubscriber:
Collaboration graph
[legend]

Public Member Functions

 CostmapSubscriber (const nav2::LifecycleNode::WeakPtr &parent, const std::string &topic_name)
 A constructor.
 
template<typename NodeT >
 CostmapSubscriber (const NodeT &parent, const std::string &topic_name)
 
 ~CostmapSubscriber ()
 A destructor.
 
std::shared_ptr< Costmap2DgetCostmap ()
 Get current costmap.
 
void costmapCallback (const nav2_msgs::msg::Costmap::SharedPtr msg)
 Callback for the costmap topic.
 
void costmapUpdateCallback (const nav2_msgs::msg::CostmapUpdate::SharedPtr update_msg)
 Callback for the costmap's update topic.
 
std::string getFrameID () const
 

Protected Member Functions

bool isCostmapReceived ()
 
void processCurrentCostmapMsg ()
 
bool haveCostmapParametersChanged ()
 
bool hasCostmapSizeChanged ()
 
bool hasCostmapResolutionChanged ()
 
bool hasCostmapOriginPositionChanged ()
 

Protected Attributes

nav2::Subscription< nav2_msgs::msg::Costmap >::SharedPtr costmap_sub_
 
nav2::Subscription< nav2_msgs::msg::CostmapUpdate >::SharedPtr costmap_update_sub_
 
std::shared_ptr< Costmap2Dcostmap_
 
nav2_msgs::msg::Costmap::SharedPtr costmap_msg_
 
std::string topic_name_
 
std::string frame_id_
 
std::mutex costmap_msg_mutex_
 
rclcpp::Logger logger_ {rclcpp::get_logger("nav2_costmap_2d")}
 

Detailed Description

Subscribes to the costmap via a ros topic.

Definition at line 33 of file costmap_subscriber.hpp.


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