def set_all_static():
    from pybullet_planning.interfaces.env_manager.simulation import disable_gravity
    from pybullet_planning.interfaces.robots.body import get_bodies
    # TODO: mass saver
    disable_gravity()
    for body in get_bodies():
        set_static(body)
Exemple #2
0
def image_from_segmented(segmented, color_from_body=None):
    if color_from_body is None:
        from pybullet_planning.interfaces.robots.body import get_bodies
        bodies = get_bodies()
        color_from_body = dict(zip(bodies, spaced_colors(len(bodies))))
    image = np.zeros(segmented.shape[:2] + (3, ))
    for r in range(segmented.shape[0]):
        for c in range(segmented.shape[1]):
            body, link = segmented[r, c, :]
            image[r, c, :] = color_from_body.get(body, (0, 0, 0))
    return image
Exemple #3
0
 def __init__(self):
     from pybullet_planning.interfaces.robots.body import get_bodies
     self.body_savers = [BodySaver(body) for body in get_bodies()]
Exemple #4
0
def single_collision(body1, **kwargs):
    for body2 in get_bodies():
        if (body1 != body2) and pairwise_collision(body1, body2, **kwargs):
            return True
    return False