Function nav2_util::getCurrentPose

Function Documentation

bool nav2_util::getCurrentPose(geometry_msgs::msg::PoseStamped &global_pose, tf2_ros::Buffer &tf_buffer, const std::string global_frame = "map", const std::string robot_frame = "base_link", const double transform_timeout = 0.1, const rclcpp::Time stamp = rclcpp::Time())

get the current pose of the robot

Parameters:
  • global_pose – Pose to transform

  • tf_buffer – TF buffer to use for the transformation

  • global_frame – Frame to transform into

  • robot_frame – Frame to transform from

  • transform_timeout – TF Timeout to use for transformation

Returns:

bool Whether it could be transformed successfully