Class TFRepublisher

Inheritance Relationships

Base Type

  • public rclcpp::Node

Class Documentation

class TFRepublisher : public rclcpp::Node

Public Functions

explicit TFRepublisher(const rclcpp::NodeOptions &options = rclcpp::NodeOptions())
~TFRepublisher() override = default
rclcpp_action::CancelResponse handle_cancel(std::shared_ptr<rclcpp_action::ServerGoalHandle<TFSubscriptionAction>> gh)

Handle cancel request for action server.

Parameters:

gh – Goal handle to be canceled

Returns:

Cancel response indicating acceptance or rejection

std::string clean_tf_frame(const std::string &frame_id) const

Clean TF frame name by removing leading slash if present.

Parameters:

frame_id – Frame ID to clean

Returns:

Cleaned frame ID string

std::optional<TransformStampedMsg> thread_safe_lookup(const std::string &target_frame, const std::string &source_frame)

Thread-safe lookup of transform between two frames.

Parameters:
  • target_frame – Target frame for transformation

  • source_frame – Source frame for transformation

Returns:

Optional transform stamped message, empty if lookup fails

rclcpp_action::GoalResponse handle_goal(const rclcpp_action::GoalUUID&, const std::shared_ptr<const TFSubscriptionAction::Goal> &goal)

Handle incoming goal request for action server.

Parameters:
  • uuid – Unique identifier for the goal

  • goal – Goal message containing subscription parameters

Returns:

Goal response indicating acceptance or rejection

void handle_accepted(const std::shared_ptr<rclcpp_action::ServerGoalHandle<TFSubscriptionAction>> &goal_handle)

Handle accepted goal by spawning execution thread.

Parameters:

goal_handle – Goal handle for the accepted goal

void execute(const std::shared_ptr<rclcpp_action::ServerGoalHandle<TFSubscriptionAction>> &goal_handle)

Execute the TF subscription action in a separate thread.

Parameters:

goal_handle – Goal handle containing subscription parameters

Protected Attributes

std::shared_ptr<tf2_ros::Buffer> tf_buffer_