File tree Expand file tree Collapse file tree
include/nav2_bt_navigator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ class BtNavigator : public nav2_util::LifecycleNode
9696 std::string robot_frame_;
9797 std::string global_frame_;
9898 double transform_tolerance_;
99+ std::string odom_topic_;
99100
100101 // Spinning transform that can be used by the BT nodes
101102 std::shared_ptr<tf2_ros::Buffer> tf_;
Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ BtNavigator::on_configure(const rclcpp_lifecycle::State & /*state*/)
9797 global_frame_ = get_parameter (" global_frame" ).as_string ();
9898 robot_frame_ = get_parameter (" robot_base_frame" ).as_string ();
9999 transform_tolerance_ = get_parameter (" transform_tolerance" ).as_double ();
100+ odom_topic_ = get_parameter (" odom_topic" ).as_string ();
100101
101102 // Libraries to pull plugins (BT Nodes) from
102103 auto plugin_lib_names = get_parameter (" plugin_lib_names" ).as_string_array ();
@@ -123,7 +124,7 @@ BtNavigator::on_configure(const rclcpp_lifecycle::State & /*state*/)
123124 }
124125
125126 // Odometry smoother object for getting current speed
126- odom_smoother_ = std::make_unique<nav2_util::OdomSmoother>(shared_from_this (), 0.3 );
127+ odom_smoother_ = std::make_unique<nav2_util::OdomSmoother>(shared_from_this (), 0.3 , odom_topic_ );
127128
128129 return nav2_util::CallbackReturn::SUCCESS;
129130}
You can’t perform that action at this time.
0 commit comments