Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug when checking a pose is empty and TOTG corner case #1274

Merged
merged 3 commits into from
May 25, 2022

Conversation

JafarAbdi
Copy link
Contributor

Description

Fix: moveit/moveit_task_constructor#350

The first commit fix isEmpty for ROS2 since w == 1
The second commit fix a corner case for TOTG where it might not use the last input waypoint when parameterizing the trajectory

To test run:

ros2 launch moveit_task_constructor_demo demo.launch.py
ros2 launch moveit_task_constructor_demo pickplace.launch.py

@@ -1096,6 +1096,10 @@ bool TimeOptimalTrajectoryGeneration::doTimeParameterizationCalculations(robot_t

if (diverse_point)
points.push_back(new_point);
// If the last point is not a diverse_point we replace the last added point with it to make sure to always have the
Copy link
Contributor

@jliukkonen jliukkonen May 25, 2022

Choose a reason for hiding this comment

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

The fix looks reasonable. But why is the variable called diverse_point when it seems to mean, based on the comments, simply "unique waypoint", which would be easier to understand?

Copy link
Member

Choose a reason for hiding this comment

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

I don't really understand the fix. If it's not a diverse_point, that means it's identical to the previous point, right? So it shouldn't matter if you use the previous point or if you use this one

Slightly agree with Jere that unique_point is more readable than diverse_point but I think that should be a separate PR.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe it's a matter of tolerances.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't really understand the fix. If it's not a diverse_point, that means it's identical to the previous point, right?

It's identical with some tolerance min_angle_change_, it was causing MTC to fail because the last waypoint after parameterizing the trajectory isn't the expected goal waypoint

Copy link
Member

Choose a reason for hiding this comment

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

OK, that makes sense

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I rename the variable in this PR or in a separate one?

Copy link
Member

Choose a reason for hiding this comment

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

separate PR

moveit_core/planning_scene/test/test_planning_scene.cpp Outdated Show resolved Hide resolved
@@ -1096,6 +1096,10 @@ bool TimeOptimalTrajectoryGeneration::doTimeParameterizationCalculations(robot_t

if (diverse_point)
points.push_back(new_point);
// If the last point is not a diverse_point we replace the last added point with it to make sure to always have the
Copy link
Member

Choose a reason for hiding this comment

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

I don't really understand the fix. If it's not a diverse_point, that means it's identical to the previous point, right? So it shouldn't matter if you use the previous point or if you use this one

Slightly agree with Jere that unique_point is more readable than diverse_point but I think that should be a separate PR.

@@ -1096,6 +1096,10 @@ bool TimeOptimalTrajectoryGeneration::doTimeParameterizationCalculations(robot_t

if (diverse_point)
points.push_back(new_point);
// If the last point is not a diverse_point we replace the last added point with it to make sure to always have the
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it's a matter of tolerances.

moveit_core/utils/src/message_checks.cpp Show resolved Hide resolved
@codecov
Copy link

codecov bot commented May 25, 2022

Codecov Report

Merging #1274 (71b1258) into main (298ab76) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1274      +/-   ##
==========================================
+ Coverage   61.44%   61.47%   +0.04%     
==========================================
  Files         274      274              
  Lines       24936    24940       +4     
==========================================
+ Hits        15319    15329      +10     
+ Misses       9617     9611       -6     
Impacted Files Coverage Δ
...cessing/src/time_optimal_trajectory_generation.cpp 88.42% <100.00%> (+0.04%) ⬆️
moveit_core/utils/src/message_checks.cpp 83.34% <100.00%> (ø)
...include/moveit/robot_trajectory/robot_trajectory.h 98.72% <0.00%> (+0.04%) ⬆️
moveit_core/planning_scene/src/planning_scene.cpp 52.53% <0.00%> (+0.17%) ⬆️
...nning_scene_monitor/src/planning_scene_monitor.cpp 45.73% <0.00%> (+0.44%) ⬆️

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 b6f0084...71b1258. Read the comment docs.

@AndyZe AndyZe merged commit d37aeac into moveit:main May 25, 2022
peterdavidfagan pushed a commit to peterdavidfagan/moveit2 that referenced this pull request Jul 14, 2022
…1274)

* Fix having empty object pose would use the shape pose as the object pose

* TOTG: Fix parameterizing a trajectory would produce a different last waypoint than the input last waypoint

* Update moveit_core/planning_scene/test/test_planning_scene.cpp

Co-authored-by: AndyZe <andyz@utexas.edu>

Co-authored-by: AndyZe <andyz@utexas.edu>
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.

ros2 pickplace.launch.py demo planning fails
3 participants