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

Normalize quaternions when adding new or moving collision objects (#1119) #1420

Merged
merged 6 commits into from
Apr 11, 2019

Conversation

j-petit
Copy link
Contributor

@j-petit j-petit commented Mar 27, 2019

Fixes #1119.

Description

As proposed in #1119 I implemented quaternion normalization when adding a new collision object and also when providing a new pose (move operation). Instead of using tf2::fromMsg as before I wrote a new function which includes orientation normalization and replaced it in the appropriate spots.

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Created tests, which fail without this PR reference
  • Decide if this should be cherry-picked to other current ROS branches

@welcome
Copy link

welcome bot commented Mar 27, 2019

Thanks for helping in improving MoveIt!

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.

In general looks good to me. Please consider renaming the function as suggested.

@rhaschke rhaschke added this to Low priority in MoveIt & Co Mar 29, 2019
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.

Thanks for fixing the name. One minor remark.

@rhaschke rhaschke added the awaits 2nd review one maintainer approved this request label Mar 29, 2019
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.

There are still a lot of calls to tf2::fromMsg(), for instance inside processAttachedCollisionObjectMsg() and processOctomapMsg(). Shouldn't these be changed as well?

{
Eigen::Translation3d translation(msg.position.x, msg.position.y, msg.position.z);
Eigen::Quaterniond quaternion(msg.orientation.w, msg.orientation.x, msg.orientation.y, msg.orientation.z);
quaternion.normalize();
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be added to tf2_eigen.h or even all conversion functions with quaternions? fromMsg() could have a default parameter normalize_quaternion=false.

Copy link
Contributor

Choose a reason for hiding this comment

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

This would be indeed a nice to have. However, OSRF wasn't very responsive for ROS1 changes in the recent past.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can change the calls to tf2::fromMsg() in other places, however I am not so sure I this is really desired as then quaternion normlization is done more often. I read up on the discussion here, and for me it sounded like we don't want to normalize the quaternions everywhere. But maybe @rhaschke can clarify that?

Copy link
Member

Choose a reason for hiding this comment

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

If that's the case it's fine with me. It just seems odd that collision objects are affected while attached collision objects are not. I approve this patch as is. @rhaschke do you have something to add here? Otherwise lgtm.

Copy link
Contributor

Choose a reason for hiding this comment

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

I looked into this briefly a week ago and I agree that we should consider normalization in more places. Investigating the extent of required changes, I found some nasty code duplication between PlanningScene code and robot_state/.../conversions.cpp. I wanted to clean this up but didn't find time yet to do so.

Copy link
Contributor

Choose a reason for hiding this comment

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

@henningkayser, let's merge for now. Remember to cherry-pick to master. This PR is targeted at melodic-devel currently.

Co-Authored-By: j-petit <petit.jens@gmail.com>
@rhaschke rhaschke changed the base branch from melodic-devel to master April 10, 2019 20:32
@rhaschke rhaschke changed the base branch from master to melodic-devel April 10, 2019 20:33
@henningkayser henningkayser merged commit 8fde277 into moveit:melodic-devel Apr 11, 2019
MoveIt & Co automation moved this from Low priority to Closed Apr 11, 2019
@welcome
Copy link

welcome bot commented Apr 11, 2019

Congrats on getting your first MoveIt! pull request merged and improving open source robotics!

henningkayser pushed a commit to henningkayser/moveit that referenced this pull request Apr 11, 2019
…veit#1420)

* normalize quaternion for added collision object (moveit#1119)

* Refactered normalization into fcn

* Added normalization for processNormalizationMove

* Cleanup of artefacts

* Changed fcn name and added docstring

* Adapt docstring for doxygen

Co-Authored-By: j-petit <petit.jens@gmail.com>
@j-petit j-petit deleted the normalize_quaternions branch April 12, 2019 00:47
@rhaschke rhaschke mentioned this pull request Apr 14, 2019
@gbiggs gbiggs removed this from Closed in MoveIt & Co Apr 29, 2024
sjahr added a commit to sjahr/moveit that referenced this pull request Jun 21, 2024
* Add setTrajectoryConstraints() to PlanningComponent

* Add planning time to PlanningComponent::PlanSolution

* Replace PlanSolution with MotionPlanResponse

* Address review

* Add MultiPipelinePlanRequestParameters

Add plan(const MultiPipelinePlanRequestParameters& parameters)

Add mutex to avoid segfaults

Add optional stop_criterion_callback and solution_selection_callback

Remove stop_criterion_callback

Make default solution_selection_callback = nullptr

Remove parameter handling copy&paste code in favor of a template

Add TODO to refactor pushBack() method into insert()

Fix selection criteria and add RCLCPP_INFO output

Changes due to rebase and formatting

Fix race condition and segfault when no solution is found

Satisfy clang tidy

Remove mutex and thread safety TODOs

Add stopping functionality to parallel planning

Remove unnecessary TODOs

* Fix unused plan solution with failure

* Add sanity check for number of parallel planning problems

* Check stopping criterion when new solution is generated + make thread safe

* Add terminatePlanningPipeline() to MoveItCpp interface

* Format!

* Bug fixes

* Move getShortestSolution callback into own function

* No east const

* Remove PlanSolutions and make planner_id accessible

* Make solution executable

* Rename update_last_solution to store_solution

* Alphabetize includes and include plan_solutions.hpp instead of .h

* Address review

* Add missing header

* Apply suggestions from code review

Co-authored-by: AndyZe <andyz@utexas.edu>

Co-authored-by: AndyZe <andyz@utexas.edu>
sjahr added a commit to sjahr/moveit that referenced this pull request Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaits 2nd review one maintainer approved this request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants