compas-dev / compas_fab

Robotic fabrication package for the COMPAS Framework.
https://compas.dev/compas_fab/
MIT License
108 stars 32 forks source link

Call PyBulletPlanner.forward_kinematics with options={"check_collision":True} #317

Closed romanarust closed 2 years ago

romanarust commented 2 years ago

Describe the bug

Calling PyBulletPlanner.forward_kinematics with options={"check_collision":True} raises AttributeError: 'PyBulletClient' object has no attribute 'collision_check'

To Reproduce

Steps to reproduce the behavior:

import compas_fab
from compas.robots import Configuration
from compas_fab.backends import PyBulletClient

with PyBulletClient() as client:
    urdf_filename = compas_fab.get('universal_robot/ur_description/urdf/ur5.urdf')
    robot = client.load_robot(urdf_filename)
    configuration = Configuration.from_revolute_values([-2.238, -1.153, -2.174, 0.185, 0.667, 0.])
    frame_WCF = robot.forward_kinematics(configuration, options={"check_collision":True})

Raises

Traceback (most recent call last):
  File "c:\Users\rustr\Desktop\temp.py", line 9, in <module>
    frame_WCF = robot.forward_kinematics(configuration, options={"check_collision":True})
  File "c:\users\rustr\workspace\compas_fab\src\compas_fab\robots\robot.py", line 1286, in forward_kinematics
    frame_WCF = self.client.forward_kinematics(self,
  File "c:\users\rustr\workspace\compas_fab\src\compas_fab\backends\interfaces\client.py", line 31, in forward_kinematics
    return self.planner.forward_kinematics(*args, **kwargs)
  File "c:\users\rustr\workspace\compas_fab\src\compas_fab\backends\pybullet\planner.py", line 43, in forward_kinematics
    return PyBulletForwardKinematics(self.client)(*args, **kwargs)
  File "c:\users\rustr\workspace\compas_fab\src\compas_fab\backends\interfaces\backend_features.py", line 16, in __call__
    return self.forward_kinematics(robot, configuration, group, options)
  File "c:\users\rustr\workspace\compas_fab\src\compas_fab\backends\pybullet\backend_features\pybullet_forward_kinematics.py", line 48, in forward_kinematics
    self.client.collision_check()
AttributeError: 'PyBulletClient' object has no attribute 'collision_check'