-
Notifications
You must be signed in to change notification settings - Fork 938
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
separating the cartesian planner #1149
Conversation
moveit_core/robot_state/include/moveit/robot_state/cartesian_planner.h
Outdated
Show resolved
Hide resolved
moveit_core/robot_state/include/moveit/robot_state/cartesian_planner.h
Outdated
Show resolved
Hide resolved
moveit_core/robot_state/include/moveit/robot_state/cartesian_planner.h
Outdated
Show resolved
Hide resolved
moveit_core/robot_state/include/moveit/robot_state/cartesian_planner.h
Outdated
Show resolved
Hide resolved
moveit_core/robot_state/include/moveit/robot_state/robot_state.h
Outdated
Show resolved
Hide resolved
moveit_core/robot_state/include/moveit/robot_state/robot_state.h
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.
The old functions should be definitely deprecated and replaced by the new ones throughout the code base.
moveit_core/robot_state/include/moveit/robot_state/robot_state.h
Outdated
Show resolved
Hide resolved
moveit_core/robot_state/include/moveit/robot_state/cartesian_planner.h
Outdated
Show resolved
Hide resolved
protected: | ||
void SetUp() override | ||
{ | ||
static const std::string MODEL2 = |
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.
static const std::string MODEL2 = | |
// TODO(rhaschke): Use new testing framework for loading models | |
// https://ros-planning.github.io/moveit_tutorials/doc/tests/tests_tutorial.html | |
static const std::string MODEL2 = |
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.
Sorry @davetcoleman, but I really cannot understand your reasoning behind putting me as the assignee for this TODO. The change I requested is a max-half-an-hour effort. If we don't tackle this now, it's probably never done - even though there is a TODO. Why don't you ask @mlautman, who is paid to work on MoveIt, to actually do this cleanup? I already put most of my free time into this project - unsalaried. I cannot do more. Rather, I need to reduce my efforts over time to also see my family from time to time.
This class really belongs in its own folder:
or maybe
But making this first step makes the most sense for now |
moveit_core/robot_state/include/moveit/robot_state/cartesian_planner.h
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.
See inline comments.
moveit_core/robot_state/include/moveit/robot_state/cartesian_planner.h
Outdated
Show resolved
Hide resolved
moveit_core/robot_state/include/moveit/robot_state/cartesian_planner.h
Outdated
Show resolved
Hide resolved
return percentage_solved; | ||
} | ||
|
||
double RobotState::testJointSpaceJump(const JointModelGroup* group, std::vector<RobotStatePtr>& traj, |
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.
Although these testing functions are currently only used in the Cartesian path generator, I suggest to keep them in RobotState, because they can be useful in other contexts 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.
the user can just as easily use the CartesianInterpolator version. I don't think that robot_state is the ideal place for joint trajectory validation code. Maybe robot_model..?
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 robot_model
too. CartesianInterpolator
is very specific though...
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 method is currently only used from within CartesianInterpolator. I am happy to see it moved but I don't see that as a necessary change for this PR to be merged in. I have added a todo
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.
Who should work on all these TODOs in future? Now, it's the time to clean this up.
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.
Anyone in the community who wants to make the change. There is no functional difference between what you are suggesting and the current state of the code. Sure we can go back and forth iterating until this relatively small change is philosophically perfect, but is that really worth our time? If you would like those methods put into robot_model
please open a follow on PR and I will approve it.
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.
@rhaschke I looked into it and moving the validation functions into moveit_trajectory_processing
(which is probably where they belong) creates a dependency cycle. While I am sure we could break the cycle with some work, I think we can leave it for a future PR that refactors the cartesian planning feature more fully.
protected: | ||
void SetUp() override | ||
{ | ||
static const std::string MODEL2 = |
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.
Sorry @davetcoleman, but I really cannot understand your reasoning behind putting me as the assignee for this TODO. The change I requested is a max-half-an-hour effort. If we don't tackle this now, it's probably never done - even though there is a TODO. Why don't you ask @mlautman, who is paid to work on MoveIt, to actually do this cleanup? I already put most of my free time into this project - unsalaried. I cannot do more. Rather, I need to reduce my efforts over time to also see my family from time to time.
@rhaschke I didn't mean to imply you needed to actually do the Asking Mike to refactor a test that's been in the moveit code for many years now seems to me like scope creep for the intent of this PR: to move a Cartesian path planner out of the robot state code. Yes, its a great idea to fix it, but we do not have unlimited resources either. I understand you need time with your family and certainly am not asking you to make sacrifices for this, either. Does this make senes? |
@@ -49,6 +49,8 @@ | |||
|
|||
#include <boost/assert.hpp> | |||
|
|||
// Eventually, this planner should be moved out of robot_state |
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 comment is in the wrong header file
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.
There is still an open request from Dave and I suggest to move the implementations of all deprecated functions from robot_state.cpp to robot_state.h (see motivation below).
NOTE: As of ROS-Melodic these are deprecated and should not be used | ||
*/ | ||
MOVEIT_DEPRECATED double | ||
computeCartesianPath(const JointModelGroup* group, std::vector<RobotStatePtr>& traj, const LinkModel* link, |
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.
All deprecated functions should have their implementation inline here in the header as this a) provides a hint how to replace those functions in own code and b) doesn't generate extra function call overhead.
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.
@rhaschke I tried that but unfortunately that would require that I move the include (#include <moveit/robot_state/cartesian_interpolator.h>
) from the src to header which fails to compile.
My understanding is that the implementation of computeCartesianPath
needs MaxEEFStep
and JumpThreshold
, which are defined in cartesian_interpolator.h
. cartesian_interpolator.h
in turn includes robot_state.h
to get the RobotState
class definition. If I move the implementations inline to robot_state.h
then I would have to include cartesian_interpolator.h
in robot_state.h
instead of robot_state.cpp
. This results in compiler errors where the cartesian_interpolater.h
included in robot_state.h
includes an empty robot_state.h
and fails to get the RobotState class definitions.
Also, I have moved the rogue comment that Dave found.
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 results in compiler errors where the cartesian_interpolater.h included in robot_state.h includes an empty robot_state.h
Why does robot_state.h
becomes empty??
@rhaschke At almost 50 comments, I feel we have debated this PR to death considering that it is a relatively trivial change that we all agree should happen. Let's get this merged |
@rhaschke The deprecated methods are causing travis to fail. |
@mlautman, as Travis fails, I don't see, how we can merge this PR in the present state.
Regarding the actual Travis issue: Travis complains about deprecation warnings. Obviously, when we suggest a new API, we should also change the whole MoveIt code base to use the new API. Doing so, you will get rid of those warnings. |
Seems to me deprecated functions should no cause Travis to fail. If we learn to ignore Travis because of harmless warnings, we may learn also to ignore it for important stuff. |
Description
This moves the Cartesian planner out of the robot_state class and into it's own class
Checklist