Skip to content

Commit 31cb74e

Browse files
authored
Remove unnecessary publish_limited_velocity_ member (backport #2266) (#2269)
1 parent 211558a commit 31cb74e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

diff_drive_controller/include/diff_drive_controller/diff_drive_controller.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ class DiffDriveController : public controller_interface::ChainableControllerInte
134134
std::unique_ptr<SpeedLimiter> limiter_linear_;
135135
std::unique_ptr<SpeedLimiter> limiter_angular_;
136136

137-
bool publish_limited_velocity_ = false;
138137
std::shared_ptr<rclcpp::Publisher<TwistStamped>> limited_velocity_publisher_ = nullptr;
139138
std::shared_ptr<realtime_tools::RealtimePublisher<TwistStamped>>
140139
realtime_limited_velocity_publisher_ = nullptr;

diff_drive_controller/src/diff_drive_controller.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ controller_interface::return_type DiffDriveController::update_and_write_commands
270270
previous_two_commands_.push({{linear_command, angular_command}});
271271

272272
// Publish limited velocity
273-
if (publish_limited_velocity_ && realtime_limited_velocity_publisher_)
273+
if (params_.publish_limited_velocity && realtime_limited_velocity_publisher_)
274274
{
275275
limited_velocity_message_.header.stamp = time;
276276
limited_velocity_message_.twist.linear.x = linear_command;
@@ -331,7 +331,6 @@ controller_interface::CallbackReturn DiffDriveController::on_configure(
331331
odometry_.setVelocityRollingWindowSize(static_cast<size_t>(params_.velocity_rolling_window_size));
332332

333333
cmd_vel_timeout_ = rclcpp::Duration::from_seconds(params_.cmd_vel_timeout);
334-
publish_limited_velocity_ = params_.publish_limited_velocity;
335334

336335
// Allocate reference interfaces if needed
337336
const int nr_ref_itfs = 2;
@@ -357,7 +356,7 @@ controller_interface::CallbackReturn DiffDriveController::on_configure(
357356
// left and right sides are both equal at this point
358357
wheels_per_side_ = static_cast<int>(params_.left_wheel_names.size());
359358

360-
if (publish_limited_velocity_)
359+
if (params_.publish_limited_velocity)
361360
{
362361
limited_velocity_publisher_ = get_node()->create_publisher<TwistStamped>(
363362
DEFAULT_COMMAND_OUT_TOPIC, rclcpp::SystemDefaultsQoS());

0 commit comments

Comments
 (0)