Skip to content

Fix Ruckig smoothing infinite loop - #777

Closed
AndyZe wants to merge 4 commits into
moveit:mainfrom
AndyZe:andyz/infinite_loop_in_ruckig_smoothing
Closed

AndyZe wants to merge 4 commits into
moveit:mainfrom
AndyZe:andyz/infinite_loop_in_ruckig_smoothing

Conversation

@AndyZe

@AndyZe AndyZe commented Nov 2, 2021 •

Copy link
Copy Markdown
Member

For identical waypoints, Ruckig smoothing could get stuck in an infinite loop. The reason was, the continue went to the next iteration of while, instead of continuing to the next waypoint.

Also, I didn't have to copy the waypoint here since we just checked it was identical. We can leave it as it was.

*next_waypoint = trajectory.getWayPoint(waypoint_idx);

@AndyZe
AndyZe force-pushed the andyz/infinite_loop_in_ruckig_smoothing branch from a7c6b92 to 352d4ae Compare November 2, 2021 21:45
@codecov

codecov Bot commented Nov 2, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #777 (352d4ae) into main (b426a1c) will decrease coverage by 0.71%.
The diff coverage is 75.00%.

❗ Current head 352d4ae differs from pull request most recent head 009c949. Consider uploading reports for the commit 009c949 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #777      +/-   ##
==========================================
- Coverage   55.58%   54.88%   -0.70%     
==========================================
  Files         198      196       -2     
  Lines       21420    21360      -60     
==========================================
- Hits        11905    11722     -183     
- Misses       9515     9638     +123     
Impacted Files Coverage Δ
...rajectory_processing/src/ruckig_traj_smoothing.cpp 85.86% <75.00%> (+5.25%) ⬆️
.../planning_scene_monitor/src/trajectory_monitor.cpp 0.00% <0.00%> (-66.07%) ⬇️
...eit_core/robot_trajectory/src/robot_trajectory.cpp 24.68% <0.00%> (-29.48%) ⬇️
...eit/planning_scene_monitor/current_state_monitor.h 77.78% <0.00%> (-22.22%) ⬇️
...include/moveit/robot_trajectory/robot_trajectory.h 86.05% <0.00%> (-10.05%) ⬇️
...anning_scene_monitor/src/current_state_monitor.cpp 75.34% <0.00%> (-1.79%) ⬇️
...sion_plugin_loader/src/collision_plugin_loader.cpp 35.72% <0.00%> (-1.49%) ⬇️
moveit_core/robot_state/src/robot_state.cpp 34.27% <0.00%> (-1.35%) ⬇️
moveit_ros/moveit_servo/src/servo_parameters.cpp 69.48% <0.00%> (-0.62%) ⬇️
...e/collision_detection_fcl/src/collision_common.cpp 74.89% <0.00%> (-0.23%) ⬇️
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b426a1c...009c949. Read the comment docs.

@jliukkonen jliukkonen left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple code related comments. As for the idea itself, well I don't really know what the range of possible side-effects is so I leave that to someone else.

RCLCPP_ERROR(LOGGER, "Trajectory does not have enough points to smooth with Ruckig");
return false;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really related to this PR, but something to keep in mind... The applySmoothing function is almost 200 lines long and contains complex logic. That's too long and should be, at some point, split into pieces. I'm thinking about just having helper functions that capture the phases of the smoothing correctly.

The trajectory processing functions are also all static class member functions meaning they really don't have to be in a class but can instead just be simple functions in some suitable namespace.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jliukkonen. I'm going to close this PR because some refactoring was done and it no longer applies. But I will try to do what you suggest in that PR.

@AndyZe
AndyZe force-pushed the andyz/infinite_loop_in_ruckig_smoothing branch from 72d544f to 009c949 Compare November 16, 2021 16:58
@AndyZe AndyZe closed this Feb 14, 2022
@AndyZe

AndyZe commented Feb 14, 2022

Copy link
Copy Markdown
Member Author

Deprecated by #1076

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants