Skip to content

Commit a6e2949

Browse files
smoother fix (#2822)
1 parent f370dfa commit a6e2949

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
@@ -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_;

nav2_bt_navigator/src/bt_navigator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)