Class BtNavigator

Inheritance Relationships

Base Type

  • public nav2_util::LifecycleNode

Class Documentation

class BtNavigator : public nav2_util::LifecycleNode

An action server that uses behavior tree for navigating a robot to its goal position.

Public Functions

explicit BtNavigator(rclcpp::NodeOptions options = rclcpp::NodeOptions())

A constructor for nav2_bt_navigator::BtNavigator class.

Parameters:

options – Additional options to control creation of the node.

~BtNavigator()

A destructor for nav2_bt_navigator::BtNavigator class.

Protected Functions

nav2_util::CallbackReturn on_configure(const rclcpp_lifecycle::State &state) override

Configures member variables.

Initializes action server for “NavigationToPose”; subscription to “goal_sub”; and builds behavior tree from xml file.

Parameters:

state – Reference to LifeCycle node state

Returns:

SUCCESS or FAILURE

nav2_util::CallbackReturn on_activate(const rclcpp_lifecycle::State &state) override

Activates action server.

Parameters:

state – Reference to LifeCycle node state

Returns:

SUCCESS or FAILURE

nav2_util::CallbackReturn on_deactivate(const rclcpp_lifecycle::State &state) override

Deactivates action server.

Parameters:

state – Reference to LifeCycle node state

Returns:

SUCCESS or FAILURE

nav2_util::CallbackReturn on_cleanup(const rclcpp_lifecycle::State &state) override

Resets member variables.

Parameters:

state – Reference to LifeCycle node state

Returns:

SUCCESS or FAILURE

nav2_util::CallbackReturn on_shutdown(const rclcpp_lifecycle::State &state) override

Called when in shutdown state.

Parameters:

state – Reference to LifeCycle node state

Returns:

SUCCESS or FAILURE

Protected Attributes

std::unique_ptr<nav2_bt_navigator::Navigator<nav2_msgs::action::NavigateToPose>> pose_navigator_
std::unique_ptr<nav2_bt_navigator::Navigator<nav2_msgs::action::NavigateThroughPoses>> poses_navigator_
nav2_bt_navigator::NavigatorMuxer plugin_muxer_
std::shared_ptr<nav2_util::OdomSmoother> odom_smoother_
std::string robot_frame_
std::string global_frame_
double transform_tolerance_
std::string odom_topic_
std::shared_ptr<tf2_ros::Buffer> tf_
std::shared_ptr<tf2_ros::TransformListener> tf_listener_