Skip to content

Commit

Permalink
Add a warning for TOTG if vel/accel limits aren't specified. (#1186)
Browse files Browse the repository at this point in the history
Co-authored-by: Vatan Aksoy Tezer <[email protected]>
  • Loading branch information
AndyZe and Vatan Aksoy Tezer authored Apr 19, 2022
1 parent 7f04091 commit 6b985cc
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,12 @@ bool TimeOptimalTrajectoryGeneration::computeTimeStamps(robot_trajectory::RobotT
max_velocity[j] =
std::min(std::fabs(bounds.max_velocity_), std::fabs(bounds.min_velocity_)) * velocity_scaling_factor;
}
else
{
RCLCPP_WARN_STREAM_ONCE(
LOGGER, "Joint velocity limits are not defined. Using the default "
<< max_velocity[j] << " rad/s. You can define velocity limits in the URDF or joint_limits.yaml.");
}

max_acceleration[j] = 1.0;
if (bounds.acceleration_bounded_)
Expand All @@ -954,6 +960,13 @@ bool TimeOptimalTrajectoryGeneration::computeTimeStamps(robot_trajectory::RobotT
max_acceleration[j] = std::min(std::fabs(bounds.max_acceleration_), std::fabs(bounds.min_acceleration_)) *
acceleration_scaling_factor;
}
else
{
RCLCPP_WARN_STREAM_ONCE(LOGGER,
"Joint acceleration limits are not defined. Using the default "
<< max_acceleration[j]
<< " rad/s^2. You can define acceleration limits in the URDF or joint_limits.yaml.");
}
}

// Have to convert into Eigen data structs and remove repeated points
Expand Down

0 comments on commit 6b985cc

Please sign in to comment.