Skip to content
Alex Zastrow edited this page Jul 6, 2023 · 23 revisions

Collision objects in Phobos

Collision objects in Phobos are basic meshes of phobostype collision. Basically, you can use any mesh (be it CAD data or a simple cube) to represent a collision object.

It is important though, that the actual collision type is determined by Define Geometry, which allows you to set a collision box for an ever complex mesh or handle a simple sphere as a mesh collision.

Defining the geometry of a box collision object

Collision objects just need two steps to be configured properly: Set Phobostype (to collision) and Define Geometry (at your liking).

Additional features include adjustments of the collision groups.

Please note, that when you can represent an objects collision shape reasonably precise with a primitive like box, sphere, cylinder you should always prefer this over a mesh collision, as this is way easier to compute for your simulator.

Primitives

For some cases, especially when computation time is key, it is a good idea to represent collisions as primitives like box, cylinder, sphere. If you still need a mesh collision you can annotate this mesh collision with the primitive information. Just create a primitive collision for the mesh collision it represents and parent it to the mesh collision. You can also parent multiple primitives to one mesh collision. Those primitives will be written to SMURF.

Editing Collision Groups

The Set Collision Group button allows to select multiple layers of objects with which an object can collide. Clicking the respective fields, the bits of the underlying collision bitmask are flipped.

Edit collision groups in Phobos

Phobos uses Blender's existing functionality to define collision groups for physics simulation. Thus, its operator simply displays the collision 'layers' that can be found in the Physics tab of the Properties GUI area:

Collision groups in Blender

Although 20 collision layers are supported by Blender, the MARS simulation environment only supports 16. Thus, only the first 16 Blender layers serve this purpose, while any objects using one of the last 4 layers consequently do not use collision bitmasks. When exporting the model this will be presented as a warning if applicable.

Special cases in URDF, MARS, SMURF

In URDF, any collision object will collide with any other collision object, ergo there is no inherent collision avoidance between links. This poses a problem if collision geometries are approximations and might sometimes collide even though the real robot would not. A classic case may be box geometries used for limbs of a robot that will collide at the joint if turned. For this reason, it is in most cases necessary to define which collision objects of a model can collide with which other collision objects. In the ROS community, the solution for this problem comes in the form of SRDF and Phobos does currently not support export of this format due to refactoring, it will be re-added in v2.1.0. However the MARS simulation does not currently read SRDF and therefore the same information is by default exported to SMURF.

Important Note: As a default, Phobos (and MARS, for that matter) assumes that no collision objects of a link can collide with collision objects of its parent link or child link. If you need such close collisions, consider using additional joints.

Collision groups in ODE (MARS/GAZEBO)

MARS internally uses collision bitmasks to efficiently exclude collisions between objects. This makes it easy to assign multiple objects to the same group of collision behaviour. For instance, this can be used if all limbs on the left side of a robot should be able to collide with all limbs on the right side of the robot, but not with the main body. This feature is also helpful to exclude such parts of the robot from collision which can kinematically never collide in the first place, thereby speeding up the simulation by avoiding unnecessary collision checks. While SRDF explicitly excludes pairs of links from colliding, Phobos allows to group together collision properties, effectively recreating the bitmasks used in ODE anyways.

Clone this wiki locally