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>
39#include <std_msgs/msg/header.hpp>
66 std::string odomtopicName =
"/odom", std::string odomFrame =
"odom",
72 virtual void processNewPose(
const geometry_msgs::msg::PoseStamped & odom);
92 void popPath(
int pathCount = 1,
bool keepPreviousPath =
false);
98 void setStartPoint(
const geometry_msgs::msg::PoseStamped & pose);
122 getNode()->set_parameter(rclcpp::Parameter(
"odom_frame", odomFrame));
133 virtual bool updateRecordPath(
const geometry_msgs::msg::PoseStamped & odom);
136 virtual bool updateClearPath(
const geometry_msgs::msg::PoseStamped & odom);
147 rclcpp::Subscription<nav_msgs::msg::Odometry>::SharedPtr
odomSub_;
183 std::optional<geometry_msgs::msg::PoseStamped>
goalPose;
196 const std::vector<rclcpp::Parameter> & parameters);
209 const geometry_msgs::msg::Point & p1,
const geometry_msgs::msg::Point & p2)
211 double dx = (p1.x - p2.x);
212 double dy = (p1.y - p2.y);
213 double dz = (p2.z - p2.z);
214 double dist = sqrt(dx * dx + dy * dy + dz * dz);
void popPath(int pathCount=1, bool keepPreviousPath=false)
virtual bool updateRecordPath(const geometry_msgs::msg::PoseStamped &odom)
rclcpp::Subscription< nav_msgs::msg::Odometry >::SharedPtr odomSub_
std::string odomTopicName_
std::string currentPathName_
double clearPointDistanceThreshold_
rads
double clearAngularDistanceThreshold_
rads
cl_nav2z::Pose * robotPose_
void setOdomFrame(std::string odomFrame)
std::optional< geometry_msgs::msg::PoseStamped > currentMotionGoal_
virtual void processNewPose(const geometry_msgs::msg::PoseStamped &odom)
odom callback: Updates the path - this must be called periodically for each odometry message.
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)
rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr param_callback_handle_
void setCurrentPathName(const std::string ¤tPathName)
nav_msgs::msg::Path getPath()
virtual void odomMessageCallback(const nav_msgs::msg::Odometry::SharedPtr odom)
std::vector< PathInfo > pathInfos_
double recordAngularDistanceThreshold_
Meters.
rclcpp::TimerBase::SharedPtr robotPoseTimer_
rclcpp::Publisher< nav_msgs::msg::Path >::SharedPtr robotBasePathStackedPub_
void setCurrentMotionGoal(const geometry_msgs::msg::PoseStamped &pose)
virtual bool updateClearPath(const geometry_msgs::msg::PoseStamped &odom)
nav_msgs::msg::Path aggregatedStackPathMsg_
std::vector< nav_msgs::msg::Path > pathStack_
void setPublishMessages(bool value)
void setWorkingMode(WorkingMode workingMode)
rclcpp::Publisher< nav_msgs::msg::Path >::SharedPtr robotBasePathPub_
void updateAggregatedStackPath()
rcl_interfaces::msg::SetParametersResult parametersCallback(const std::vector< rclcpp::Parameter > ¶meters)
std::optional< geometry_msgs::msg::PoseStamped > getCurrentMotionGoal()
void onInitialize() override
void setStartPoint(const geometry_msgs::msg::PoseStamped &pose)
void updateConfiguration()
OdomTrackerStrategy strategy_
CpOdomTracker(std::string odomtopicName="/odom", std::string odomFrame="odom", OdomTrackerStrategy strategy=OdomTrackerStrategy::ODOMETRY_SUBSCRIBER)
void logStateString(bool debug=true)
rclcpp::Node::SharedPtr getNode()
double p2pDistance(const geometry_msgs::msg::Point &p1, const geometry_msgs::msg::Point &p2)
std::optional< geometry_msgs::msg::PoseStamped > goalPose