33 v_out = (*it)->enforceLimits(v_out);
44 q_dot_norm = (*it)->enforceLimits(q_dot_norm, q);
154 double max_factor = 1.0;
155 int joint_index = -1;
157 for (
unsigned int i = 0; i < q_dot_ik.
rows(); i++)
162 ROS_ERROR_STREAM(
"Joint " << i <<
" violates its limits. Setting to Zero!");
173 if (temp > max_factor)
187 if (temp > max_factor)
196 if (max_factor > 1.0)
198 ROS_ERROR_STREAM_THROTTLE(1,
"Position tolerance surpassed (by Joint " << joint_index <<
"): Scaling ALL VELOCITIES with factor = " << max_factor);
199 for (
unsigned int i = 0; i < q_dot_ik.
rows(); i++)
201 q_dot_norm(i) = q_dot_ik(i) / max_factor;
217 double max_factor = 1.0;
218 int joint_index = -1;
220 for (
unsigned int i = 0; i < q_dot_ik.
rows(); i++)
229 if (max_factor > 1.0)
231 ROS_WARN_STREAM_THROTTLE(1,
"Velocity limit surpassed (by Joint " << joint_index <<
"): Scaling ALL VELOCITIES with factor = " << max_factor);
232 for (
unsigned int i = 0; i < q_dot_ik.
rows(); i++)
234 q_dot_norm(i) = q_dot_ik(i) / max_factor;
251 ROS_WARN(
"LimiterAllJointAccelerations not yet implemented");
266 double max_factor = 1.0;
274 if (max_factor > 1.0)
276 ROS_WARN_STREAM_THROTTLE(1,
"Cartesian velocity limit surpassed: Scaling ALL VELOCITIES with factor = " << max_factor);
277 v_out.
rot.
x(v_in.
rot.
x()/max_factor);
278 v_out.
rot.
y(v_in.
rot.
y()/max_factor);
279 v_out.
rot.
z(v_in.
rot.
z()/max_factor);
280 v_out.
vel.
x(v_in.
vel.
x()/max_factor);
281 v_out.
vel.
y(v_in.
vel.
y()/max_factor);
282 v_out.
vel.
z(v_in.
vel.
z()/max_factor);
300 for (
unsigned int i = 0; i < q_dot_ik.
rows(); i++)
305 ROS_ERROR_STREAM(
"Joint " << i <<
" violates its limits. Setting to Zero!");
312 if (q_dot_ik(i) > 0.0)
316 factor = (temp > factor) ? temp : factor;
322 if (q_dot_ik(i) < 0.0)
326 factor = (temp > factor) ? temp : factor;
329 q_dot_norm(i) = q_dot_norm(i) / factor;
345 for (
unsigned int i = 0; i < q_dot_ik.
rows(); i++)
351 q_dot_norm(i) = q_dot_ik(i) / factor;
368 ROS_WARN(
"LimiterIndividualJointAccelerations not yet implemented");
Class for joint velocity limiter (all scaled to keep direction), implementing interface methods...
std::vector< double > limits_min
bool enforce_input_limits
unsigned int rows() const
virtual KDL::JntArray enforceLimits(const KDL::JntArray &q_dot_ik, const KDL::JntArray &q) const
virtual ~LimiterContainer()
const LimiterParams & limiter_params_
virtual KDL::JntArray enforceLimits(const KDL::JntArray &q_dot_ik, const KDL::JntArray &q) const
std::vector< const LimiterJointBase * >::const_iterator output_LimIter_t
std::vector< const LimiterCartesianBase * > input_limiters_
Class for a limiter, declaring a method to limit joint positions individually.
Base class for joint/output limiters, defining interface methods.
virtual KDL::JntArray enforceLimits(const KDL::JntArray &q_dot_ik, const KDL::JntArray &q) const
virtual KDL::Twist enforceLimits(const KDL::Twist &v_in) const
virtual KDL::JntArray enforceLimits(const KDL::JntArray &q_dot_ik, const KDL::JntArray &q) const
Class for limiting the cartesian velocities commands in order to guarantee a BIBO system (all scaled ...
std::vector< const LimiterCartesianBase * >::const_iterator input_LimIter_t
Class for joint acceleration limiter (individually scaled -> changes direction), implementing interfa...
std::vector< const LimiterJointBase * > output_limiters_
Class for joint velocity limiter (individually scaled -> changes direction), implementing interface m...
#define LIMIT_SAFETY_THRESHOLD
#define ROS_WARN_STREAM_THROTTLE(rate, args)
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
std::vector< double > limits_max
void SetToZero(Jacobian &jac)
virtual KDL::Twist enforceLimits(const KDL::Twist &v_in) const
virtual KDL::Twist enforceLimits(const KDL::Twist &v_in) const
Class for limiting the cartesian velocities commands in order to guarantee a BIBO system (individuall...
void add(const LimiterCartesianBase *lb)
virtual KDL::JntArray enforceLimits(const KDL::JntArray &q_dot_ik, const KDL::JntArray &q) const
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
Class for joint acceleration limiter (all scaled to keep direction), implementing interface methods...
#define ROS_ERROR_STREAM(args)
#define ROS_ERROR_STREAM_THROTTLE(rate, args)
Class for limiters, declaring the method to limit all joint positions.
Base class for cartesian/input limiters, defining interface methods.
virtual KDL::JntArray enforceLimits(const KDL::JntArray &q_dot_ik, const KDL::JntArray &q) const
std::vector< double > limits_vel