-
Notifications
You must be signed in to change notification settings - Fork 493
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
Replace PlanSolution with MotionPlanResponse #1542
Conversation
4ecb6c2
to
b1cac10
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1542 +/- ##
=======================================
Coverage ? 51.08%
=======================================
Files ? 381
Lines ? 31727
Branches ? 0
=======================================
Hits ? 16203
Misses ? 15524
Partials ? 0 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
666411d
to
3e54058
Compare
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.
I'm fine with these changes. Keep in mind that we are planning to simplify this class a lot, as most of it would be better implemented by a state-less MotionPlanRequest builder
3e54058
to
32fad11
Compare
double planning_time_; | ||
moveit_msgs::msg::MoveItErrorCodes error_code_; | ||
// Result status of the query | ||
moveit::core::MoveItErrorCode error_code_; |
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 change is not consistent with MotionPlanDetailedResponse
. Whatever you change here should be reflected in the other struct as well.
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.
I'll add it there as well 👍
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 What do you think about using inheritance
struct MotionPlanDetailedResponse : public MotionPlanResponse
{
// Make this a free function for both classes
// void getMessage(moveit_msgs::msg::MotionPlanDetailedResponse& msg) const;
std::vector<std::string> description_;
std::vector<double> processing_time_;
};
or aggregation here?
struct MotionPlanDetailedResponse
{
void getMessage(moveit_msgs::msg::MotionPlanDetailedResponse& msg) const;
MotionPlanResponse response;
std::vector<std::string> description_;
std::vector<double> processing_time_;
};
I think both would avoid changing the other if one changes in the future. Or to remove MotionPlanDetailedResponse
completely and make processing time and description std::optional
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.
well, this got stale... I think neither option is applicable, the detailed response includes a vector of trajectories.
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.
I see, why is it a vector of trajectories anyways?
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.
The message definition states
# Multiple solution paths are reported, each reflecting intermediate steps in the trajectory processing
# The list of reported trajectories
But is that used anywhere/ how is it interpretable when the response is just a vector of unlabeled trajectories?
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.
I'm not sure if it's being used anywhere, but my understanding is that the trajectories show you the result for each step in the process. For instance, you should be able to compare the raw planner solution with the smoothed output.
// Enable checking of query success or failure, for example if(response) ... | ||
explicit operator bool() const | ||
{ | ||
return bool(error_code_); |
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.
I don't think this is going to work. If error_code_
is negative, like int32 PLANNING_FAILED=-1
, it will cast to true.
int32 SUCCESS=1
also casts to true.
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.
return bool(error_code_); | |
return error_code_ == moveit::core::MoveItErrorCode::SUCCESS; |
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 is not the error code value. It's using the MoveItErrorCode
type which is convertible to bool. See https://github.com/ros-planning/moveit2/blob/main/moveit_core/utils/include/moveit/utils/moveit_error_code.h#L62
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.
I suggested to use the same in your PR. #1605 (comment)
32fad11
to
d351118
Compare
I'll close this PR since it is also included in #1420 and additional addressed reviews are included there |
Description
This PR breaks the moveit_cpp API!
Two small additions for PlanningComponent.Replace PlanSolution with MotionPlanResponse since both contain the same data.
Related PR: moveit2_tutorials#515 should be merged right after this PR to prevent the tutorials from bracking
Checklist