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

separating the cartesian planner #1149

Merged
merged 2 commits into from
Mar 24, 2019
Merged

separating the cartesian planner #1149

merged 2 commits into from
Mar 24, 2019

Conversation

mlautman
Copy link
Contributor

@mlautman mlautman commented Oct 26, 2018

Description

This moves the Cartesian planner out of the robot_state class and into it's own class

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Document API changes relevant to the user in the moveit/MIGRATION.md notes
  • Created tests, which fail without this PR reference
  • Decide if this should be cherry-picked to other current ROS branches

Copy link
Contributor

@rhaschke rhaschke left a 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.

@mlautman mlautman changed the base branch from kinetic-devel to master March 8, 2019 00:09
@mlautman mlautman changed the base branch from master to kinetic-devel March 8, 2019 00:10
@mlautman mlautman changed the base branch from kinetic-devel to master March 8, 2019 01:15
moveit_core/robot_state/src/cartesian_planner.cpp Outdated Show resolved Hide resolved
moveit_core/robot_state/test/test_cartesian_planner.cpp Outdated Show resolved Hide resolved
protected:
void SetUp() override
{
static const std::string MODEL2 =
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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 =

Copy link
Contributor

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.

@davetcoleman
Copy link
Member

This class really belongs in its own folder:

moveit/moveit_core/cartesian_planning

or maybe

moveit/moveit_planners/cartesian_planning

But making this first step makes the most sense for now

Copy link
Contributor

@rhaschke rhaschke left a 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/src/robot_state.cpp Outdated Show resolved Hide resolved
return percentage_solved;
}

double RobotState::testJointSpaceJump(const JointModelGroup* group, std::vector<RobotStatePtr>& traj,
Copy link
Contributor

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.

Copy link
Contributor Author

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..?

Copy link
Contributor

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...

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor Author

@mlautman mlautman Mar 11, 2019

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.

Copy link
Contributor Author

@mlautman mlautman Mar 12, 2019

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 =
Copy link
Contributor

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.

@davetcoleman
Copy link
Member

@rhaschke I didn't mean to imply you needed to actually do the TODO, but we've adopted a practice of adding a user name to all TODOs to provide more reference in the future of who wanted something done. It doesn't mean you need to do it. But we totally can leave your name off of there, or add my name.

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?

@mlautman mlautman requested a review from rhaschke March 12, 2019 17:46
@@ -49,6 +49,8 @@

#include <boost/assert.hpp>

// Eventually, this planner should be moved out of robot_state
Copy link
Member

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

Copy link
Contributor

@rhaschke rhaschke left a 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,
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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??

@mlautman mlautman requested a review from rhaschke March 21, 2019 21:01
@mlautman mlautman requested a review from v4hn as a code owner March 21, 2019 21:02
@mlautman
Copy link
Contributor Author

@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

@mlautman
Copy link
Contributor Author

@rhaschke The deprecated methods are causing travis to fail.

@rhaschke
Copy link
Contributor

Let's get this merged.

@mlautman, as Travis fails, I don't see, how we can merge this PR in the present state.

The deprecated methods are causing Travis CI to fail.

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.

@rhaschke rhaschke merged commit fb53bf3 into moveit:master Mar 24, 2019
@mlautman mlautman deleted the separate-cartesian branch March 25, 2019 19:59
@davetcoleman
Copy link
Member

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.

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.

None yet

4 participants