Skip to content
Open
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 @@ -321,7 +321,11 @@ namespace ackermann_steering_controller{
}

// Limit velocities and accelerations:
const double cmd_dt(period.toSec());
const double cmd_dt = (period.toSec() > 0) ? period.toSec() : 0.0;
if(period.toSec() < 0)
{
ROS_ERROR("Invalid time interval, delta time cannot be negative");
}

limiter_lin_.limit(curr_cmd.lin, last0_cmd_.lin, last1_cmd_.lin, cmd_dt);
limiter_ang_.limit(curr_cmd.ang, last0_cmd_.ang, last1_cmd_.ang, cmd_dt);
Expand Down
6 changes: 5 additions & 1 deletion diff_drive_controller/src/diff_drive_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,11 @@ namespace diff_drive_controller{
}

// Limit velocities and accelerations:
const double cmd_dt(period.toSec());
const double cmd_dt = (period.toSec() > 0) ? period.toSec() : 0.0;
if(period.toSec() > 0 < 0)
{
ROS_ERROR("Invalid time interval, delta time cannot be negative");
}

limiter_lin_.limit(curr_cmd.lin, last0_cmd_.lin, last1_cmd_.lin, cmd_dt);
limiter_ang_.limit(curr_cmd.ang, last0_cmd_.ang, last1_cmd_.ang, cmd_dt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,11 @@ namespace four_wheel_steering_controller{
curr_cmd_4ws.rear_steering = 0.0;
}

const double cmd_dt(period.toSec());
const double cmd_dt = (period.toSec() > 0) ? period.toSec() : 0.0;
if(period.toSec() < 0)
{
ROS_ERROR("Invalid time interval, delta time cannot be negative");
}

const double angular_speed = odometry_.getAngular();
const double steering_track = track_-2*wheel_steering_y_offset_;
Expand Down