from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def forward_docstring(backend_feature):
def dec(obj):
obj.__doc__ = backend_feature.__dict__[obj.__name__].__doc__
return obj
return dec
[docs]class ClientInterface(object):
"""Interface for all backend clients. Forwards all planning services and
planning scene management to the planner.
"""
[docs] def __init__(self):
self.planner = PlannerInterface(self)
[docs] def inverse_kinematics(self, *args, **kwargs):
"""Forwards call to appropriate method in the planner."""
return self.planner.inverse_kinematics(*args, **kwargs)
[docs] def forward_kinematics(self, *args, **kwargs):
"""Forwards call to appropriate method in the planner."""
return self.planner.forward_kinematics(*args, **kwargs)
[docs] def plan_cartesian_motion(self, *args, **kwargs):
"""Forwards call to appropriate method in the planner."""
return self.planner.plan_cartesian_motion(*args, **kwargs)
[docs] def plan_motion(self, *args, **kwargs):
"""Forwards call to appropriate method in the planner."""
return self.planner.plan_motion(*args, **kwargs)
[docs] def get_planning_scene(self, *args, **kwargs):
"""Forwards call to appropriate method in the planner."""
return self.planner.get_planning_scene(*args, **kwargs)
[docs] def add_collision_mesh(self, *args, **kwargs):
"""Forwards call to appropriate method in the planner."""
return self.planner.add_collision_mesh(*args, **kwargs)
[docs] def remove_collision_mesh(self, *args, **kwargs):
"""Forwards call to appropriate method in the planner."""
return self.planner.remove_collision_mesh(*args, **kwargs)
[docs] def append_collision_mesh(self, *args, **kwargs):
"""Forwards call to appropriate method in the planner."""
return self.planner.append_collision_mesh(*args, **kwargs)
[docs] def add_attached_collision_mesh(self, *args, **kwargs):
"""Forwards call to appropriate method in the planner."""
return self.planner.add_attached_collision_mesh(*args, **kwargs)
[docs] def remove_attached_collision_mesh(self, *args, **kwargs):
"""Forwards call to appropriate method in the planner."""
return self.planner.remove_attached_collision_mesh(*args, **kwargs)
[docs]class PlannerInterface(object):
"""Interface for all planners associated with a backend client. Provides default
behavior for all planning services and planning scene management methods. To be
use in conjunction with backend feature interfaces.
"""
[docs] def __init__(self, client):
super(PlannerInterface, self).__init__()
self.client = client
[docs] def inverse_kinematics(self, *args, **kwargs):
"""Default method for planner.
Raises
------
Exception
Planner does not have this feature.
"""
raise Exception('Assigned planner does not have this feature.')
[docs] def forward_kinematics(self, *args, **kwargs):
"""Default method for planner.
Raises
------
Exception
Planner does not have this feature.
"""
raise Exception('Assigned planner does not have this feature.')
[docs] def plan_motion(self, *args, **kwargs):
"""Default method for planner.
Raises
------
Exception
Planner does not have this feature.
"""
raise Exception('Assigned planner does not have this feature.')
[docs] def plan_cartesian_motion(self, *args, **kwargs):
"""Default method for planner.
Raises
------
Exception
Planner does not have this feature.
"""
raise Exception('Assigned planner does not have this feature.')
[docs] def get_planning_scene(self, *args, **kwargs):
"""Default method for planner.
Raises
------
Exception
Planner does not have this feature.
"""
raise Exception('Assigned planner does not have this feature.')
[docs] def add_collision_mesh(self, *args, **kwargs):
"""Default method for planner.
Raises
------
Exception
Planner does not have this feature.
"""
raise Exception('Assigned planner does not have this feature.')
[docs] def remove_collision_mesh(self, *args, **kwargs):
"""Default method for planner.
Raises
------
Exception
Planner does not have this feature.
"""
raise Exception('Assigned planner does not have this feature.')
[docs] def append_collision_mesh(self, *args, **kwargs):
"""Default method for planner.
Raises
------
Exception
Planner does not have this feature.
"""
raise Exception('Assigned planner does not have this feature.')
[docs] def add_attached_collision_mesh(self, *args, **kwargs):
"""Default method for planner.
Raises
------
Exception
Planner does not have this feature.
"""
raise Exception('Assigned planner does not have this feature.')
[docs] def remove_attached_collision_mesh(self, *args, **kwargs):
"""Default method for planner.
Raises
------
Exception
Planner does not have this feature.
"""
raise Exception('Assigned planner does not have this feature.')