-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix collision detection issue when using joints across nested models (#…
…268) When a joint is created between BodyNodes in different skeletons, the child BodyNode is moved to the skeleton of the parent BodyNode. When this happens, the BodyNode version of the child needs to be incremented. This is actually fixed by dartsim/dart#1445, but we don't have that merged into our fork. So in the meantime, we call incrementVersion after moveTo is called similar to #31. Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org> Co-authored-by: Louise Poubel <louise@openrobotics.org>
- Loading branch information
Showing
3 changed files
with
184 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
<?xml version="1.0"?> | ||
<sdf version="1.8"> | ||
<world name="default"> | ||
|
||
<model name="ground_plane"> | ||
<static>true</static> | ||
<link name="link"> | ||
<collision name="collision"> | ||
<geometry> | ||
<plane> | ||
<normal>0 0 1</normal> | ||
</plane> | ||
</geometry> | ||
</collision> | ||
<visual name="visual"> | ||
<geometry> | ||
<plane> | ||
<normal>0 0 1</normal> | ||
<size>100 100</size> | ||
</plane> | ||
</geometry> | ||
</visual> | ||
</link> | ||
</model> | ||
|
||
<model name="M1"> | ||
<pose>0 0 0.25 0 0.0 0</pose> | ||
<!-- link1 doesn't have a collision so it would fall indefinitely if the | ||
contraint created by joint j1 is not enforced --> | ||
<link name="link1"> | ||
<visual name="box_visual"> | ||
<geometry> | ||
<box> | ||
<size>1 1 0.5</size> | ||
</box> | ||
</geometry> | ||
<material> | ||
<ambient>1 0 0 1</ambient> | ||
<diffuse>1 0 0 1</diffuse> | ||
<specular>1 0 0 1</specular> | ||
</material> | ||
</visual> | ||
</link> | ||
<joint name="j1" type="fixed"> | ||
<parent>link1</parent> | ||
<child>nested_model::link2</child> | ||
</joint> | ||
|
||
<model name="nested_model"> | ||
<pose>1 0 0.0 0 0.0 0</pose> | ||
<link name="link2"> | ||
<collision name="box_collision"> | ||
<geometry> | ||
<box> | ||
<size>1 1 0.5</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
|
||
<visual name="box_visual"> | ||
<geometry> | ||
<box> | ||
<size>1 1 0.5</size> | ||
</box> | ||
</geometry> | ||
<material> | ||
<ambient>1 0 0 1</ambient> | ||
<diffuse>1 0 0 1</diffuse> | ||
<specular>1 0 0 1</specular> | ||
</material> | ||
</visual> | ||
</link> | ||
</model> | ||
</model> | ||
|
||
<!-- This model is the same as M1 except the model pose and the parent and child elements of joint j1--> | ||
<model name="M2"> | ||
<pose>0 5 0.25 0 0.0 0</pose> | ||
<!-- link1 doesn't have a collision so it would fall indefinitely if the | ||
contraint created by joint j1 is not enforced --> | ||
<link name="link1"> | ||
<visual name="box_visual"> | ||
<geometry> | ||
<box> | ||
<size>1 1 0.5</size> | ||
</box> | ||
</geometry> | ||
<material> | ||
<ambient>1 0 0 1</ambient> | ||
<diffuse>1 0 0 1</diffuse> | ||
<specular>1 0 0 1</specular> | ||
</material> | ||
</visual> | ||
</link> | ||
<joint name="j1" type="fixed"> | ||
<parent>nested_model::link2</parent> | ||
<child>link1</child> | ||
</joint> | ||
|
||
<model name="nested_model"> | ||
<pose>1.0 0 0.0 0 0.0 0</pose> | ||
<link name="link2"> | ||
<collision name="box_collision"> | ||
<geometry> | ||
<box> | ||
<size>1 1 0.5</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
|
||
<visual name="box_visual"> | ||
<geometry> | ||
<box> | ||
<size>1 1 0.5</size> | ||
</box> | ||
</geometry> | ||
<material> | ||
<ambient>1 0 0 1</ambient> | ||
<diffuse>1 0 0 1</diffuse> | ||
<specular>1 0 0 1</specular> | ||
</material> | ||
</visual> | ||
</link> | ||
</model> | ||
</model> | ||
</world> | ||
</sdf> |