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

New isValidVelocityMove() for checking time between two waypoints given velocity #684

Merged
merged 4 commits into from
Mar 15, 2019

Conversation

davetcoleman
Copy link
Member

@davetcoleman davetcoleman commented Nov 13, 2017

This is a more computationally efficient version of the previously used isValidVelocityMove() functions added in #294

This allows faster Descartes-type functionality


bool isValidVelocityMove(const JointModelGroup* group, const double* from_joint_pose,
const double* to_joint_pose, std::size_t array_size, double dt) const;

Copy link
Contributor

Choose a reason for hiding this comment

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

why the overload with raw pointers? Convenience?

Copy link
Member Author

Choose a reason for hiding this comment

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

speed! this is used in a more MoveIt!-integrated version of Descartes, where it is called hundreds of thousands of times in an iterative IK brute force-type approach. It uses Boost-graph to save each raw array of joints

Copy link
Contributor

Choose a reason for hiding this comment

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

Passing a reference is slower than passing a pointer? Afaik they are basically the same, and the difference is purely syntactical.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh I thought you were asking why these two functions instead of the RobotState version. Its overloaded just as a convenience I suppose, I don't recall why I have both, I'm just trying to get my research code to work with mainstream moveit again and not my fork. I think this style is not unfounded within RobotState however - e.g. setJointPosition() has it overloaded.

Copy link
Member Author

Choose a reason for hiding this comment

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

robot state uses both vectors and raw pointers for lots of its functions, so i think this should remain.


double max_dtheta = dt * max_velocity;
if (dtheta > max_dtheta)
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

It's going to be less efficient, but would it be an idea to add a ROS_DEBUG.. here with the joint that makes the check fail?

Copy link
Member Author

Choose a reason for hiding this comment

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

ROS_DEBUG isn't used inside RobotState, but we could use logDebug. However I agree that its less efficient so would prefer not.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@Jmeyer1292
Copy link

Side note, @davetcoleman: Is this moveit-integrated version of Descartes something you plan on making open source or something you're going to keep internal to your company?

@Jmeyer1292
Copy link

In either case, is there a reason you've decided to clone the Descartes work rather than work with us to make it better or fit your needs?

@davetcoleman
Copy link
Member Author

@Jmeyer1292 my Descartes-MoveIt work is https://github.com/davetcoleman/bolt from my thesis last year, which was funded by NIST and a collaboration with you guys at SwRI. This patch was created then and I'm trying to get back to the mainstream MoveIt!. Let's have a phone call to discuss collaborations on this effort.

@mlautman
Copy link
Contributor

+1

@davetcoleman
Copy link
Member Author

ping @v4hn can I get a review? I already have one +1

@davetcoleman davetcoleman requested a review from v4hn March 29, 2018 14:21
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.

I think the old function RobotState::isValidVelocityMove(const RobotState& other, const JointModelGroup* group, double dt) const should call into these new functions. Currently the old function, doesn't protect against non-standard joints.


if (var_bounds->size() != 1)
{
logError("Attempting to check velocity bounds for waypoint move with joints that have multiple variables");
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 not sure, how to handle non-standard joints here. Why do you want to bail out? You could also skip those joints.
Now, it's not possible to use this function for JMG's containing non-standard joints.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a future todo. I'm not inclined to support it since its an uncommon use case, but when the need arises i welcome the change

I added a TODO as such

@davetcoleman
Copy link
Member Author

I think the old function RobotState::isValidVelocityMove(const RobotState& other, const JointModelGroup* group, double dt) const should call into these new functions. Currently the old function, doesn't protect against non-standard joints.

I disagree - the RobotState version supports arbitrary groups of joints that are not necessary inline, whereas these new ones are optimized for the most common use case of a simple kinematic chain where the vector is in order. This can't be easily configured to call into each other without a big performance hit.

@davetcoleman davetcoleman changed the base branch from kinetic-devel to melodic-devel October 25, 2018 21:02
@davetcoleman
Copy link
Member Author

Addressed feedback, retargeted for melodic

@henningkayser
Copy link
Member

I think the old function RobotState::isValidVelocityMove(const RobotState& other, const JointModelGroup* group, double dt) const should call into these new functions. Currently the old function, doesn't protect against non-standard joints.

I disagree - the RobotState version supports arbitrary groups of joints that are not necessary inline, whereas these new ones are optimized for the most common use case of a simple kinematic chain where the vector is in order. This can't be easily configured to call into each other without a big performance hit.

Then this should probably be documented in the API.
And as long as there is still the 'old' RobotState::isValidVelocityMove() supporting non-standard joints I don't really see an issue here.
Is anything else missing to get your approval @rhaschke .

@davetcoleman wouldn't it better fit as a member function of JointModelGroup since the robot state is not used?

@rhaschke
Copy link
Contributor

rhaschke commented Mar 4, 2019

No further complaints from my side. But I like Henning's idea to move this into the JointModelGroup.

@davetcoleman
Copy link
Member Author

That's a good point about not actually needing to be in RobotState but just JointModelGroup

I don't have time for this right now but we could go two routes:

  • Abandon this since we aren't currently working on Bolt
  • @henningkayser makes the quick move into JointModelGroup

Move isValidVelocityMove() to JointModelGroup
Copy link
Member

@henningkayser henningkayser left a comment

Choose a reason for hiding this comment

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

@rhaschke can we get this merged?

@rhaschke
Copy link
Contributor

rhaschke commented Mar 8, 2019

Should this be merged into master instead of melodic-devel?

@davetcoleman
Copy link
Member Author

I'm the only current user of this API (via the Bolt planner) so its only needed in master. Retargeting.

@davetcoleman davetcoleman changed the base branch from melodic-devel to master March 8, 2019 23:50
@davetcoleman
Copy link
Member Author

Looks like Travis has gotten a lot pickier... ?

@rhaschke
Copy link
Contributor

rhaschke commented Mar 9, 2019

@davetcoleman, I think pull requests shouldn't include merge commits (d6fb60c). Please obey our merge policies.

Looks like Travis has gotten a lot pickier... ?

Yes, and I'm very proud of the fact that I resolved all warnings such that Travis now can check for high code quality automatically. So please fix those warnings.
By the way, Travis only complains about warnings in the CI repo, i.e. the srdfdom warnings don't harm for MoveIt.

@davetcoleman
Copy link
Member Author

Applied fix to clang warning

@henningkayser henningkayser merged commit 4e7f360 into moveit:master Mar 15, 2019
v4hn pushed a commit to v4hn/moveit that referenced this pull request Mar 30, 2020
…en velocity (moveit#684)

* New isValidVelocityMove() for checking time between two waypoints given velocity

* Move isValidVelocityMove() to JointModelGroup

* Update moveit_core/robot_model/src/joint_model_group.cpp
v4hn pushed a commit to v4hn/moveit that referenced this pull request Mar 31, 2020
…en velocity (moveit#684)

* New isValidVelocityMove() for checking time between two waypoints given velocity

* Move isValidVelocityMove() to JointModelGroup

* Update moveit_core/robot_model/src/joint_model_group.cpp
JafarAbdi pushed a commit to JafarAbdi/moveit that referenced this pull request Mar 24, 2022
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

6 participants