Skip to content

Commit bf25ba0

Browse files
committed
Refactor joint limit clamping logic
Removes detailed, multi-step comments from the documentation of the `clamp_joint_limits` and `handle_braking_near_position_limit` methods. These functions' internal workings are complex enough that the previous verbose description became overly long and hard to parse. Signed-off-by: Sachin Kumar <sachinkum123567@gmail.com>
1 parent b53bf25 commit bf25ba0

1 file changed

Lines changed: 0 additions & 29 deletions

File tree

joint_limits/include/joint_limits/joint_saturation_limiter.hpp

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -123,26 +123,6 @@ class JointSaturationLimiter : public JointLimiterInterface<JointLimitsStateData
123123
/**
124124
* @brief
125125
* Clamps the joint limits
126-
*
127-
* Steps:
128-
* 1. if has_desired_position -> has_position_limits -> clamp pos -> update desired_vel_
129-
* 2. has_velocity_limits -> if desired_vel not defined -> calc from (desired_pos -
130-
* current_position) . dt -> clamp vel -> if has_desired_position -> recalculate desired_pos ->
131-
* calc desired_acc from vel
132-
* 3. if has_acc_limits || has_dec_limits -> if desired_acc not defined -> cal from (desired_vel -
133-
* current_vel) / dt
134-
* -> if decelerating -> limit deceleration -> if accelerating -> limit acceleration -> if
135-
* limit_applied -> cal desired_vel from current_joint_vel + desried_acceleration . dt -> if
136-
* has_desired_positon -> calc desired_pos
137-
*
138-
* if has_position_limits -> if has_desired_velosity && !has_desired_position -> calc expected_pos
139-
* -> clamp pos -> if pos != expected_pos -> expected_pos = pos -> calc desired_vel
140-
*
141-
* stopping_deccel = desired_vel / dt -> update stopping_deccel based on max_dec or mac_acc -> cal
142-
* stopping_distance -> cal stopping_duration -> check if joint limits are beyond stopping_dist
143-
* and desired_velocity -> else distance_after_stopping_duration -> recheck if joint limits are
144-
* beyond -> update the bracking_near_pos_limit_trigger
145-
*
146126
*/
147127
void clamp_joint_limits(
148128
const bool has_desired_position, const bool has_desired_velocity,
@@ -155,15 +135,6 @@ class JointSaturationLimiter : public JointLimiterInterface<JointLimitsStateData
155135
/**
156136
* @brief
157137
* Handles the braking near position limit
158-
*
159-
* Steps:
160-
* for every joint -> cal desired_acc -> limit deceleration -> limit acceleration
161-
*
162-
* if has_desired_velocity -> update desired_vel = current_joint_velocity + desired_acc . dt
163-
*
164-
* if has_desired_position -> updated desired_pos = current_joint_position +
165-
* current_joint_velocities . dt + 0.5 * desired_acc . dt . dt
166-
*
167138
*/
168139
void handle_braking_near_position_limit(
169140
const std::vector<double> & current_joint_velocities, double dt_seconds,

0 commit comments

Comments
 (0)