From 954cf2c8dfbd1c5f3fa713c1dc9ffc9943db2326 Mon Sep 17 00:00:00 2001 From: AndyZe Date: Mon, 18 Apr 2022 07:00:16 -0500 Subject: [PATCH] Add a warning for TOTG if vel/accel limits aren't specified. --- .../src/time_optimal_trajectory_generation.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp b/moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp index 295bf964cf..294f2e94ec 100644 --- a/moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp +++ b/moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp @@ -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_) @@ -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