I wrote this script for a project that has a very long list of "disabled collisions" which have been manually added over time. It would have been very difficult to go through manually to find the duplicates and sort them properly. So, here's a simple linter.
I don't intend to put a ton of time into improving this script, so I won't be surprised if it doesn't get approved and the issue sits open. I think it would still be a valuable resource to some people.
The script:
Removes duplicate "disabled collisions"
Sorts disabled collisions alphabetically.
The output looks like this:
This script will clean up issues and make suggestions for an SRDF.
Original list of disabled collision pairs:
[['ground', 'seg_0_bed', 'Adjacent'], ['ground', 'seg_0_base_link', 'Adjacent'], ...
Removing duplicate entries from the list of allowed collisions
Originally there were 141 entries in the Allowed Collision Matrix.
These entries are duplicated. Removing them:
seg_0_eef seg_0_shoulder_link_1
Now there are 140 entries in the Allowed Collision Matrix.
Checking if there are any duplicates when the order is reversed, e.g. (l1,l2) vs (l2,l1)
These entries are duplicated. Removing them:
Now there are 140 entries in the Allowed Collision Matrix.
Sorting the list of allowed collisions
Output. Please copy/paste this into the SRDF:
<disable_collisions link1="ground" link2="seg_0_base_link" reason="Adjacent"/>
<disable_collisions link1="ground" link2="seg_0_bed" reason="Adjacent"/>
...
I wrote this script for a project that has a very long list of "disabled collisions" which have been manually added over time. It would have been very difficult to go through manually to find the duplicates and sort them properly. So, here's a simple linter.
I don't intend to put a ton of time into improving this script, so I won't be surprised if it doesn't get approved and the issue sits open. I think it would still be a valuable resource to some people.
The script:
The output looks like this: