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

Talos with simple collision boxes #168

Merged
merged 6 commits into from
Feb 19, 2022
Merged

Talos with simple collision boxes #168

merged 6 commits into from
Feb 19, 2022

Conversation

dalinel
Copy link
Contributor

@dalinel dalinel commented Jan 26, 2022

This adds two talos model :

  • talos_fast_collision.urdf (talos_fast.urdf visual + boxes for collision shapes)
  • talos_box.urdf (boxes for visual and collision shapes)

I have taken one box per significant body node
The boxes are entirely covering the talos mesh shapes
Hence the boxes are bigger than the talos mesh shape and collision will happen sooner than what we expect with meshes

You can see the box model here on rviz and robot_dart:
image

image

In my code I have added a collisionFilter to the world ConstraintSolver with the following bodynodes pairs:

body_pairs["leg_right_6_link"] = "leg_right_4_link";
body_pairs["leg_left_6_link"] = "leg_left_4_link";
body_pairs["leg_left_1_link"] = "leg_left_3_link";
body_pairs["leg_right_1_link"] = "leg_right_3_link";
body_pairs["arm_left_7_link"] = "arm_left_5_link";
body_pairs["arm_right_7_link"] = "arm_right_5_link";
body_pairs["torso_2_link"] = "base_link";
body_pairs["leg_right_2_link"] = "base_link";
body_pairs["leg_left_2_link"] = "base_link";
body_pairs["head_2_link"] = "torso_2_link";

This is because disableAdjacentBodyCheck(); is only taking directly adjacent bodynodes and it is not enough on some links.

@jbmouret
Copy link
Collaborator

Could we add the collision filters to the TalosFast class in robot_dart? (or to a new TalosFastCollisions class)?

@costashatz
Copy link
Member

@dalinel thanks for this. A few comments:

  • Please merge with latest master, I had a small bug in the CI script (this is why it is failing)
  • You haven't added any example code in this PR/branch
  • robot_dart already has collision filters (see here). Can't you use those inside a new class (as @jbmouret mentions)?

@costashatz
Copy link
Member

Ah and by the way, great work!

@dalinel
Copy link
Contributor Author

dalinel commented Jan 27, 2022

Ok so I have added a TalosFastCollision class
It includes a collision_vec() function https://github.com/resibots/robot_dart/blob/a528f67bb9f870fb71e38b291df06bb165e793eb/src/robot_dart/robots/talos.cpp#L77

It returns a vector of tuple with the body_name, category_mask and collision_maks to be used with
https://github.com/resibots/robot_dart/blob/2f60a43d945be8ec5bec3b6ca90576c02a09157f/src/robot_dart/robot_dart_simu.hpp#L122

I have used this in the examples talos_box.cpp and talos_fast_collision.cpp

@costashatz
Copy link
Member

I have used this in the examples talos_box.cpp and talos_fast_collision.cpp

To make this transparent to the user, I'd do this inside the _post_addition function (see here).

Otherwise this is looking niiiice! Thanks!

@dalinel
Copy link
Contributor Author

dalinel commented Jan 27, 2022

Your welcome! I hope it will help to have better Talos simulation !
Now the collision masks are set directly in _post_addition

@costashatz
Copy link
Member

@dalinel thanks for the work! I made a few minor fixes and clean-up. Once the tests/build pass, I will merge.. ;)

@costashatz costashatz added this to the RobotDART 1.0.0 milestone Feb 12, 2022
@costashatz costashatz merged commit ec02576 into master Feb 19, 2022
@costashatz costashatz deleted the talos_box branch February 19, 2022 01:02
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.

3 participants