Skip to content

Commit 28dbc94

Browse files
smoother fix (#2822) (#2823)
(cherry picked from commit a6e2949) Co-authored-by: Pradheep Krishna <[email protected]>
1 parent 41f23a2 commit 28dbc94

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

nav2_bt_navigator/include/nav2_bt_navigator/bt_navigator.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class BtNavigator : public nav2_util::LifecycleNode
9595
std::string robot_frame_;
9696
std::string global_frame_;
9797
double transform_tolerance_;
98+
std::string odom_topic_;
9899

99100
// Spinning transform that can be used by the BT nodes
100101
std::shared_ptr<tf2_ros::Buffer> tf_;

nav2_bt_navigator/src/bt_navigator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ BtNavigator::on_configure(const rclcpp_lifecycle::State & /*state*/)
9393
global_frame_ = get_parameter("global_frame").as_string();
9494
robot_frame_ = get_parameter("robot_base_frame").as_string();
9595
transform_tolerance_ = get_parameter("transform_tolerance").as_double();
96+
odom_topic_ = get_parameter("odom_topic").as_string();
9697

9798
// Libraries to pull plugins (BT Nodes) from
9899
auto plugin_lib_names = get_parameter("plugin_lib_names").as_string_array();
@@ -119,7 +120,7 @@ BtNavigator::on_configure(const rclcpp_lifecycle::State & /*state*/)
119120
}
120121

121122
// Odometry smoother object for getting current speed
122-
odom_smoother_ = std::make_unique<nav2_util::OdomSmoother>(shared_from_this(), 0.3);
123+
odom_smoother_ = std::make_unique<nav2_util::OdomSmoother>(shared_from_this(), 0.3, odom_topic_);
123124

124125
return nav2_util::CallbackReturn::SUCCESS;
125126
}

0 commit comments

Comments
 (0)