Skip to content

Commit

Permalink
Removed pseudo-code
Browse files Browse the repository at this point in the history
  • Loading branch information
gwalck authored and destogl committed Jul 13, 2023
1 parent 8c771cf commit 7e8e4cd
Showing 1 changed file with 0 additions and 59 deletions.
59 changes: 0 additions & 59 deletions joint_limits/src/simple_joint_limiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,65 +30,6 @@ bool SimpleJointLimiter<JointLimits>::on_enforce(
trajectory_msgs::msg::JointTrajectoryPoint & current_joint_states,
trajectory_msgs::msg::JointTrajectoryPoint & desired_joint_states, const rclcpp::Duration & dt)
{
/*
Now a factorized version
if has_pos_cmd
compute expected_vel with pos_cmd and pos_state
if has_pos_limit
if has_pos_cmd
clamp pos_cmd
else
//nothing to do yet
if has_vel_limit
if has_pos_cmd // priority of pos_cmd
vel_cmd = expected_vel
if vel_cmd over limit
clamp vel_cmd
if clamped pos_cmd = integrate vel_cmd
if has_acc_limit
if has_vel_state
if has_vel_cmd
compute expected_acc2 with limited vel_cmd and vel_state
if has_pos_cmd
compute expected_acc with expected_vel and vel_state
else
or
we cannot compute the acc, we cannot derive acc from zero velocity this would be wrong
break
if has_pos_cmd
if expected_acc over limit
clamp expected_acc
integrate expected_vel to be compatible with limited expected_acc as well
integrate pos_cmd to be compatible with newly limited expected_vel and limited
expected_acc as well
if has_vel_cmd
if expected_acc2 over limit
clamp expected_acc2
integrate vel_cmd to be compatible with limited expected_acc2 as well
if has_pos_limit
if has_vel_cmd
compute expected_pos by integrating vel_cmd // check for next step
if expected_pos over limit
consider braking and compute ideal vel_cmd that would permit to slow down in time at full
deceleration in any case limit pos to max and recompute vel_cmd that would lead to pos_max (not
ideal as velocity would not be zero)
des_vel = vel_cmd or expected_vel
check if expected_pos might be reached at max braking // check for future steps
recompute vel_cmd or pos_cmd or both
*/

const auto dt_seconds = dt.seconds();
// negative or null is not allowed
if (dt_seconds <= 0.0) return false;
Expand Down

0 comments on commit 7e8e4cd

Please sign in to comment.