Skip to content

[For testing, do not merge] Debug Bullet self collision checks#560

Closed
AndyZe wants to merge 4 commits intomoveit:masterfrom
AndyZe:andyz/bullet_self_collision
Closed

[For testing, do not merge] Debug Bullet self collision checks#560
AndyZe wants to merge 4 commits intomoveit:masterfrom
AndyZe:andyz/bullet_self_collision

Conversation

@AndyZe
Copy link
Copy Markdown
Member

@AndyZe AndyZe commented Nov 30, 2020

checkSelfCollision() reports that the robot is always in collision.

Test with: roslaunch moveit_tutorials bullet_collision_checker_tutorial.launch

always_in_self_collision

@j-petit
Copy link
Copy Markdown
Contributor

j-petit commented Nov 30, 2020

Thanks, I'll look into it on the weekend

@AndyZe
Copy link
Copy Markdown
Member Author

AndyZe commented Nov 30, 2020

I believe this is a solution for this problem. Although I still have a different setup with other issues.

Add to collision_env_bullet.cpp checkSelfCollisionHelper():

manager_->setActiveCollisionObjects(active_);

@j-petit
Copy link
Copy Markdown
Contributor

j-petit commented Dec 5, 2020

Can someone give me a hint what this warning means? Appears when shutting down the interactive robot.

[WARN] [1607162645.234141136] [ros.rosconsole_bridge.class_loader.ClassLoader]: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded.

@rhaschke
Copy link
Copy Markdown
Contributor

rhaschke commented Dec 5, 2020

In the context of MoveIt, a typical reason for this warning is that you are releasing the RobotModelLoader while the corresponding RobotModel is still in use.

@j-petit
Copy link
Copy Markdown
Contributor

j-petit commented Dec 5, 2020

Thanks Robert. I am having some workflow issues, maybe you (or anyone else) can help me out here too: I want to build moveit_core in the state from one-year ago to use git bisect and see if this bug was introduced somewhere along the way.

Of course I can do a git checkout one_year_old_commit in moveit_core. However, the other dependency repositories are then still in a different state which leads to a build error in moveit_core. Is there a quick way to reset all the dependency repos to a specific state in the past?

@AndyZe
Copy link
Copy Markdown
Member Author

AndyZe commented Dec 21, 2020

@j-petit I'm back to working on this a bit. I started visualizing the collision points always. When it fails, it seems to be that the link transforms aren't right. See pink dot here...

visualize_collision_location

@AndyZe
Copy link
Copy Markdown
Member Author

AndyZe commented Dec 21, 2020

Although if I stop using this version:

planning_scene->checkSelfCollision(req, res);

And use this version instead...

planning_scene->getCollisionEnv()->checkSelfCollision(req, res, state);

the result is reasonable. 👍

@AndyZe
Copy link
Copy Markdown
Member Author

AndyZe commented Dec 21, 2020

So it seems this isn't actually a bug and I should close this PR. What do you think, @j-petit ?

@AndyZe
Copy link
Copy Markdown
Member Author

AndyZe commented Dec 21, 2020

Closing until somebody comments otherwise

@AndyZe AndyZe closed this Dec 21, 2020
@JafarAbdi
Copy link
Copy Markdown
Member

JafarAbdi commented Dec 21, 2020

@AndyZe I think this's a bug in the tutorial calling planning_scene->checkCollision(req, res); will check the collision for the current state in the planning scene (which we don't change here), to fix this we need to change this line to be a reference to the current state of the planning scene robot_state::RobotState& state = planning_scene->getCurrentStateNonConst();

@AndyZe
Copy link
Copy Markdown
Member Author

AndyZe commented Dec 21, 2020

I think this's a bug in the tutorial ...

Well, if you pass the RobotState as an arg (like the tutorial does) it works fine. It was just my modification that had an issue.

j-petit added a commit to j-petit/moveit_tutorials that referenced this pull request Dec 29, 2020
@j-petit
Copy link
Copy Markdown
Contributor

j-petit commented Dec 29, 2020

Both of your solutions are working, but I think changing the robot_state::RobotState& state = planning_scene->getCurrentStateNonConst(); is clearer. I made a PR #568 for this, thanks Jafar for the suggestion. I am just wondering how it worked in the first place, I am pretty sure that the tutorial showed no collision when I first wrote it 🤷‍♂️ .

AndyZe pushed a commit that referenced this pull request Dec 29, 2020
Abishalini pushed a commit to Abishalini/moveit_tutorials that referenced this pull request Apr 29, 2021
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.

4 participants