Skip to content

Commit

Permalink
Apply acceleration until both left and right reach targetspeed (#1009)
Browse files Browse the repository at this point in the history
Co-authored-by: Louise Poubel <louise@openrobotics.org>
  • Loading branch information
scgroot and chapulina authored Jun 19, 2020
1 parent aa18d71 commit 02e5f96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gazebo_plugins/src/gazebo_ros_diff_drive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,8 @@ void GazeboRosDiffDrivePrivate::OnUpdate(const gazebo::common::UpdateInfo & _inf
// If max_accel == 0, or target speed is reached
for (unsigned int i = 0; i < num_wheel_pairs_; ++i) {
if (max_wheel_accel_ == 0 ||
(fabs(desired_wheel_speed_[2 * i + LEFT] - current_speed[2 * i + LEFT]) < 0.01) ||
(fabs(desired_wheel_speed_[2 * i + RIGHT] - current_speed[2 * i + RIGHT]) < 0.01))
((fabs(desired_wheel_speed_[2 * i + LEFT] - current_speed[2 * i + LEFT]) < 0.01) &&
(fabs(desired_wheel_speed_[2 * i + RIGHT] - current_speed[2 * i + RIGHT]) < 0.01)))
{
joints_[2 * i + LEFT]->SetParam(
"vel", 0, desired_wheel_speed_[2 * i + LEFT] / (wheel_diameter_[i] / 2.0));
Expand Down

0 comments on commit 02e5f96

Please sign in to comment.