Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ class DiffDriveController : public controller_interface::ChainableControllerInte
std::unique_ptr<SpeedLimiter> limiter_linear_;
std::unique_ptr<SpeedLimiter> limiter_angular_;

bool publish_limited_velocity_ = false;
std::shared_ptr<rclcpp::Publisher<TwistStamped>> limited_velocity_publisher_ = nullptr;
std::shared_ptr<realtime_tools::RealtimePublisher<TwistStamped>>
realtime_limited_velocity_publisher_ = nullptr;
Expand Down
5 changes: 2 additions & 3 deletions diff_drive_controller/src/diff_drive_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ controller_interface::return_type DiffDriveController::update_and_write_commands
previous_two_commands_.push({{linear_command, angular_command}});

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

cmd_vel_timeout_ = rclcpp::Duration::from_seconds(params_.cmd_vel_timeout);
publish_limited_velocity_ = params_.publish_limited_velocity;

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

if (publish_limited_velocity_)
if (params_.publish_limited_velocity)
{
limited_velocity_publisher_ = get_node()->create_publisher<TwistStamped>(
DEFAULT_COMMAND_OUT_TOPIC, rclcpp::SystemDefaultsQoS());
Expand Down
Loading