-
Notifications
You must be signed in to change notification settings - Fork 957
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
MoveitCommander support for TrajectoryConstraints #793
MoveitCommander support for TrajectoryConstraints #793
Conversation
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 approve this request as is.
But I think we really have to document/define semantics of the trajectory_constraints
field!
By message specification, it is just a vector of constraints that seem to play the same role as path_constraints
.
Our OMPL interface rejects requests that have the field set.
If I read this benchmark code correctly, the vector should be interpreted as waypoints, where each Constraints
message has to be fulfilled at some point during the trajectory in order. (excluding the goal state?)
This is not documented as far as I am aware and it would be nice to add this to this request...
In case this agrees with your interpretation: How do you pass in multiple alternative waypoint-lists/trajectories?
(@rhaschke we could provide a task constructor wrapper to fulfill such requests 😎)
Thanks for the excellent summary @v4hn ! Indeed, that is my interpretation of this field. Unfortunately even this doesn't really allow for a clean way of defining multiple trajectories. The definition of
and while both Of course allowing for multiple Position and OrientationConstraints points beyond controlling a single point, which is a nice and general abstraction, we should keep it that way. Having a vector of these constraints allows to define a set of these constraints, hence a single trajectory. I don't think this issue is critical enough to change message definitions but I'd like to mention that passing in trajectories could also be implemented by passing in a trajectory message but that implies adding a new field to |
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.
Some minor remarks. I agree to @v4hn to better document the trajectory_constraints field, both in the message and in corresponding setter functions.
So far, the field is not used in any planner in MoveIt. As mentioned by @v4hn, OMPL even rejects planning requests having this field filled. Hence, I guess you are free to define the semantics.
I think, @v4hn and @bmagyar proposed two different semantics:
- @bmagyar wants to use this field as a trajectory seed for planning, while the waypoints of the finally optimized trajectory might violate the "constraints".
- @v4hn considered them as real constraints, i.e. the final solution should satisfy them with some waypoint in the given order.
While the latter interpretation actually asks for a sequential planner (as we implement it currently in https://github.com/ros-planning/moveit_task_constructor), the former one asks for a renaming of the field from trajectory_constraints into trajectory_seed
/ initial_trajectory
. As pointed out in #793 (comment), a trajectory message would be more suitable for a seed.
I think this fundamental questions requires more discussion.
return c | ||
|
||
def set_trajectory_constraints(self, value): | ||
""" Specify the trajectory constraints to be used (as read from the database) """ |
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.
Which database do you refer to?
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.
None actually. It's a ctrl+c&ctrl+v leftover
def set_trajectory_constraints(self, value): | ||
""" Specify the trajectory constraints to be used (as read from the database) """ | ||
if value == None: | ||
self.clear_path_constraints() |
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.
Why this relays to path constraints, while the function is about trajectory constraints?
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.
It's a ctrl+c&ctrl+v leftover, fixed now
@@ -906,6 +906,11 @@ class MoveGroupInterface | |||
This removes any path constraints set in previous calls to setPathConstraints(). */ | |||
void clearPathConstraints(); | |||
|
|||
moveit_msgs::TrajectoryConstraints getTrajectoryConstraints() const; | |||
bool setTrajectoryConstraints(const std::string& constraints); |
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 variant doesn't seem to have an implementation. I think, it's superfluous.
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.
Nice catch! Removed
It is. As mentioned above: STOMP Thank you @rhaschke for summing that up. Short term: I think this should be merged into kinetic-devel. This is a fix for an interface that wasn't fully transparent with the C++ one before. My motivation for doing it is not relevant. Long term: We discovered an ambiguity in the interface, we should aim to correct it. This deserves its own issue where we discuss the solution and then implement it. We should touch on this at the maintainers meeting!
|
I would agree that this can be merged without resolving the underlying problem. Let's talk about the rest shortly next week, but feel free to open an issue already. I'll leave it to @rhaschke to raise further discussion here or merge. |
Description
TLDR:
trajectory_constraints
is a member ofMotionPlanRequest
yet the MoveGroupInterface doesn't allow for specifying it.trajectory_constraints
can carry entire trajectories whilepath_constraints
can't (in a clean way).The
MotionPlanRequest
message has a fieldtrajectory_constraints
butclass MoveGroupInterface (C++)
doesn't allow for setting them. I've added support for this both to the C++ class and the Python wrapper.What's the motivation for this? Passing in initial trajectories, initial guesses or seed trajectories to optimization-based planners such as the case of STOMP.
This was on #790 , now separated.
We should probably add some tests.
Checklist