0
$\begingroup$

I am trying to run neuroevolution of quadcopter agents in Gazebo (harmonic). The initial setup I want to achieve is one world with several duplicate models, each controlled externally by a neural network. I want the drone models not to collide with eachother, but still collide with everything else. Of course, I came across collision bitmasks, configurable through the sdf element. I read that the collide_bitmask element would specify which models this model could collide with, and the category_bitmask element would specify which other models should collide with this model. So I set the collide_bitmask for all collision elements of the drone model to 0xFE, and set the category_bitmask to 0x01. Logically, and given the documentation of these elements, I expected the 0x01 of one drone to & with the 0xFE of the other (0x01 & 0xFE = 0x00), therefore resulting in no collision. That did not work.

After some time, I copied the sdf of the drone model directly into the world (instead of using <include>), and duplicated it so I could tweak the bitmasks of two drones separately. I first set the collide_bitmask of drone 1 to 0x02 and drone 2 to 0x04, leaving the category_bitmask of both to 0x01. The drones did not collide and went through eachother as expected. Then, I set the category_bitmask of drone 2 to 0x02 (which is the collide_bitmask of drone 1). I expected a collision this time, but there was none and they went through eachother again. Based on this, it seems that the category_bitmask element does quite literally nothing, maybe instead being overridden with the value of collide_bitmask? I'm not sure, but this unexpected behavior is very frustrating and wasted a bunch of time.

I'd appreciate it if this were either fixed or at least noted in the sdf spec that there is an element that does nothing.

Also, I am using the dart physics engine.

The fix I'm currently considering is just trying to dynamically set each drone to have a unique collide_bitmask. Let me know if anyone has a better solution to this, maybe a custom plugin or something.

$\endgroup$

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.