pybullet_planning.interfaces.robots.get_floating_body_collision_fn

pybullet_planning.interfaces.robots.get_floating_body_collision_fn(body, obstacles=[], attachments=[], disabled_collisions={}, **kwargs)[source]

get collision checking function collision_fn(joint_values) -> bool for a floating body (no movable joint).

Parameters
  • body (int) – the main moving body (usually the robot). We refer to this body as ‘the main body’ in this function’s docstring.

  • obstacles (list of int) – body indices for collision objects, by default []

  • attachments (list of Attachment, optional) – list of attachment, by default []

  • disabled_collisions (set of tuples, optional) –

    list of tuples for specifying disabled collisions, the tuple must be of the following format:

    ((int, int), (int, int)) : (body index, link index), (body index, link index)

    If the body considered is a single-link (floating) body, assign the link index to BASE_LINK. reversing the order of the tuples above is also acceptable, by default {}

Returns

function handle – collision_fn: (conf, diagnosis) -> False if no collision found, True otherwise. if need diagnosis information for the collision, set diagnosis to True will help you visualize which link is colliding to which.