Class OdometryHelper

Class Documentation

class OdometryHelper

Public Functions

OdometryHelper(const rclcpp::Node::SharedPtr &node, const std::string &odom_topic = "")

Constructor.

Parameters:
  • node – Shared pointer to the node handle via which the OdometryHelper shall subscribe to topics and publish log messages.

  • odom_topic – The topic on which to subscribe to Odometry messages. If the empty string is given (the default), no subscription is done.

inline ~OdometryHelper()
void odomCallback(const nav_msgs::msg::Odometry::ConstSharedPtr &msg)

Callback for receiving odometry data.

Parameters:

msg – An Odometry message

void getOdom(nav_msgs::msg::Odometry &base_odom) const

Copy over the information.

Parameters:

base_odom – Copied odometry msg

void setOdomTopic(const std::string &odom_topic)

Set the odometry topic. This overrides what was set in the constructor, if anything.

This unsubscribes from the old topic (if any) and subscribes to the new one (if any).

If odom_topic is the empty string, this just unsubscribes from the previous topic.

inline std::string getOdomTopic() const

Return the current odometry topic.