22#include <tf2/transform_datatypes.h>
26#include <rclcpp/rclcpp.hpp>
32#include <geometry_msgs/msg/point.hpp>
33#include <geometry_msgs/msg/pose.hpp>
34#include <nav2_msgs/action/navigate_to_pose.hpp>
35#include <nav_msgs/msg/odometry.hpp>
36#include <nav_msgs/msg/path.hpp>
38#include <std_msgs/msg/header.hpp>
58 CpOdomTracker(std::string odomtopicName =
"/odom", std::string odomFrame =
"odom");
79 void popPath(
int pathCount = 1,
bool keepPreviousPath =
false);
85 void setStartPoint(
const geometry_msgs::msg::PoseStamped & pose);
125 rclcpp::Subscription<nav_msgs::msg::Odometry>::SharedPtr
odomSub_;
158 std::optional<geometry_msgs::msg::PoseStamped>
goalPose;
180 const geometry_msgs::msg::Point & p1,
const geometry_msgs::msg::Point & p2)
182 double dx = (p1.x - p2.x);
183 double dy = (p1.y - p2.y);
184 double dz = (p2.z - p2.z);
185 double dist = sqrt(dx * dx + dy * dy + dz * dz);
void popPath(int pathCount=1, bool keepPreviousPath=false)
rclcpp::Subscription< nav_msgs::msg::Odometry >::SharedPtr odomSub_
std::string odomTopicName_
std::string currentPathName_
double clearPointDistanceThreshold_
rads
double clearAngularDistanceThreshold_
rads
virtual void processOdometryMessage(const nav_msgs::msg::Odometry::SharedPtr odom)
odom callback: Updates the path - this must be called periodically for each odometry message.
std::optional< geometry_msgs::msg::PoseStamped > currentMotionGoal_
virtual bool updateRecordPath(const nav_msgs::msg::Odometry &odom)
double recordPointDistanceThreshold_
How much distance there is between two points of the path.
nav_msgs::msg::Path baseTrajectory_
Processed path for the mouth of the reel.
virtual void rtPublishPaths(rclcpp::Time timestamp)
void setCurrentPathName(const std::string ¤tPathName)
nav_msgs::msg::Path getPath()
std::vector< PathInfo > pathInfos_
double recordAngularDistanceThreshold_
Meters.
rclcpp::Publisher< nav_msgs::msg::Path >::SharedPtr robotBasePathStackedPub_
void setCurrentMotionGoal(const geometry_msgs::msg::PoseStamped &pose)
nav_msgs::msg::Path aggregatedStackPathMsg_
virtual bool updateClearPath(const nav_msgs::msg::Odometry &odom)
std::vector< nav_msgs::msg::Path > pathStack_
void setPublishMessages(bool value)
void setWorkingMode(WorkingMode workingMode)
rclcpp::Publisher< nav_msgs::msg::Path >::SharedPtr robotBasePathPub_
bool subscribeToOdometryTopic_
void updateAggregatedStackPath()
std::optional< geometry_msgs::msg::PoseStamped > getCurrentMotionGoal()
void onInitialize() override
void setStartPoint(const geometry_msgs::msg::PoseStamped &pose)
void updateConfiguration()
void logStateString(bool debug=true)
double p2pDistance(const geometry_msgs::msg::Point &p1, const geometry_msgs::msg::Point &p2)
std::optional< geometry_msgs::msg::PoseStamped > goalPose