-
Notifications
You must be signed in to change notification settings - Fork 523
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
Cleanup planning request adapter interface #2266
Cleanup planning request adapter interface #2266
Conversation
38ce711
to
ad9ccdc
Compare
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #2266 +/- ##
=======================================
Coverage 50.50% 50.50%
=======================================
Files 386 386
Lines 31732 31732
=======================================
Hits 16022 16022
Misses 15710 15710 ☔ View full report in Codecov by Sentry. |
c48bbd6
to
e47a152
Compare
...t_ros/planning/planning_request_adapter_plugins/res/default_plan_request_adapter_params.yaml
Show resolved
Hide resolved
...t_ros/planning/planning_request_adapter_plugins/res/default_plan_request_adapter_params.yaml
Outdated
Show resolved
Hide resolved
...t_ros/planning/planning_request_adapter_plugins/res/default_plan_request_adapter_params.yaml
Outdated
Show resolved
Hide resolved
...t_ros/planning/planning_request_adapter_plugins/res/default_plan_request_adapter_params.yaml
Outdated
Show resolved
Hide resolved
...t_ros/planning/planning_request_adapter_plugins/res/default_plan_request_adapter_params.yaml
Outdated
Show resolved
Hide resolved
...t_ros/planning/planning_request_adapter_plugins/res/default_plan_request_adapter_params.yaml
Outdated
Show resolved
Hide resolved
...t_ros/planning/planning_request_adapter_plugins/res/default_plan_request_adapter_params.yaml
Outdated
Show resolved
Hide resolved
e47a152
to
25531e9
Compare
...t_ros/planning/planning_request_adapter_plugins/res/default_plan_request_adapter_params.yaml
Outdated
Show resolved
Hide resolved
Co-authored-by: Sebastian Castro <4603398+sea-bass@users.noreply.github.com>
...t_ros/planning/planning_request_adapter_plugins/res/default_plan_request_adapter_params.yaml
Outdated
Show resolved
Hide resolved
...t_ros/planning/planning_request_adapter_plugins/res/default_plan_request_adapter_params.yaml
Outdated
Show resolved
Hide resolved
Co-authored-by: Sebastian Castro <4603398+sea-bass@users.noreply.github.com>
@sea-bass Thank you! |
moveit_ros/planning/planning_request_adapter_plugins/src/fix_workspace_bounds.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_request_adapter_plugins/src/fix_workspace_bounds.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_request_adapter_plugins/src/fix_start_state_collision.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/planning/planning_request_adapter_plugins/src/fix_start_state_collision.cpp
Outdated
Show resolved
Hide resolved
...t_ros/planning/planning_request_adapter_plugins/res/default_plan_request_adapter_params.yaml
Show resolved
Hide resolved
...t_ros/planning/planning_request_adapter_plugins/res/default_plan_request_adapter_params.yaml
Show resolved
Hide resolved
...t_ros/planning/planning_request_adapter_plugins/res/default_plan_request_adapter_params.yaml
Outdated
Show resolved
Hide resolved
const planning_scene::PlanningSceneConstPtr& planning_scene, | ||
const planning_interface::MotionPlanRequest& req, | ||
planning_interface::MotionPlanResponse& res, | ||
std::vector<std::size_t>& added_path_index = EMPTY_PATH_INDEX_VECTOR) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern of passing the default std::vector<std::size_t>& added_path_index = EMPTY_PATH_INDEX_VECTOR
isn't making sense to me. It is an out-parameter? If the user doesn't pass their own, does it not mutate the global EMPTY_PATH_INDEX_VECTOR
, which surely is not the intent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also note that clang-tidy CI is complaining about the naming of this and failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intend with this was to remove these functions:
bool PlanningRequestAdapterChain::adaptAndPlan(const planning_interface::PlannerManagerPtr& planner,
const planning_scene::PlanningSceneConstPtr& planning_scene,
const planning_interface::MotionPlanRequest& req,
planning_interface::MotionPlanResponse& res) const
{
std::vector<std::size_t> empty_added_path_index;
return adaptAndPlan(planner, planning_scene, req, res, empty_added_path_index);
}
As far as I understand there are no optional references, so like before we just write the path indices to a memory location we never read and dump them that way. Maybe another possible implementation would be to change this interface to use a pointer but that would be a bigger change. Do you have a smarter idea of how to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't you just use std::vector<std::size_t>& added_path_index = {}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@henningkayser C++ won't let you assign a default reference like that.
@sjahr I guess this pattern will technically work as long as adaptAndPlan
makes sure to clear the "empty" vector before it starts every time. Otherwise it's a memory leak!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh of course not... content-wise, this parameter would fit into the MotionPlanResponse as well, or at least the detailed response. I wouldn't sweat it too much since we should take another close look at this interface anyway.
moveit_ros/planning/planning_request_adapter_plugins/CMakeLists.txt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved pending 1 remaining comment above.
Description
Cleans up the planning_request_adapter code and updates param handling to use generate_paramters_library.
Checklist