Class OdomSubscriber

Class Documentation

class OdomSubscriber

Wrapper for some common odometry operations. Subscribes to the topic with a mutex.

Public Functions

inline explicit OdomSubscriber(nav2_util::LifecycleNode::SharedPtr nh, std::string default_topic = "odom")

Constructor that subscribes to an Odometry topic.

Parameters:
  • nh – NodeHandle for creating subscriber

  • default_topic – Name of the topic that will be loaded of the odom_topic param is not set.

inline nav_2d_msgs::msg::Twist2D getTwist()
inline nav_2d_msgs::msg::Twist2DStamped getTwistStamped()

Protected Functions

inline void odomCallback(const nav_msgs::msg::Odometry::SharedPtr msg)

Protected Attributes

rclcpp::Subscription<nav_msgs::msg::Odometry>::SharedPtr odom_sub_
nav_2d_msgs::msg::Twist2DStamped odom_vel_
std::mutex odom_mutex_