-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #409 from compas-dev/new-planning-target-class
Introduce `compas_fab.robot.Target` class
- Loading branch information
Showing
29 changed files
with
1,109 additions
and
511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,4 +51,3 @@ Authors | |
* Chen Kasirer <[email protected]> `@chenkasirer <https://github.com/chenkasirer>`_ | ||
* Edvard Bruun <[email protected]> `@ebruun <https://github.com/ebruun>`_ | ||
* Victor Pok Yin Leung <[email protected]> `@yck011522 <https://github.com/yck011522>`_ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
docs/examples/01_fundamentals/01_frame_and_transformation.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.. _targets: | ||
|
||
******************************************************************************* | ||
Targets | ||
******************************************************************************* | ||
|
||
----------------------- | ||
Single Targets (Static) | ||
----------------------- | ||
|
||
Target classes are used to describe the goal condition (i.e. end condition) of a robot | ||
for motion planning. They can be used for both Free Motion Planning (FMP) and Cartesian | ||
Motion Planning (CMP). | ||
|
||
The :class:`compas_fab.robots.FrameTarget` is the most common target for motion planning. | ||
It defines the complete pose of the end-effector (or the robot flange, if no tool is attached). | ||
A frame target is commonly created from a :class:`compas.geometry.Frame` object, or alternatively from a :class:`compas.geometry.Transformation` object. | ||
|
||
The :class:`compas_fab.robots.PointAxisTarget` class is used for specifying a target | ||
based on a point (`target_point`) and a Z-Axis (`target_z_axis`). | ||
This is useful for example when the robot is using a cylindrical tool to perform a task, | ||
for example 3D printing, welding or drilling. | ||
In a more general case, it can be used for any tools for which the rotation | ||
around its own Z axis is acceptable during use. | ||
The point and the Z-Axis are defined relative to the tool coordinate frame (TCF). | ||
The goal is (1) for the tool's TCF point to coincide with the `target_point`, | ||
and (2) for the TCF's Z-axis to become parallel to the `target_z_axis`. | ||
Note that the exact orientatio of the TCF is not determined until after the target is planned. | ||
|
||
The :class:`compas_fab.robots.ConfigurationTarget` class is used to specify a target | ||
based on a specific robot configuration (joint values). | ||
For example, it can be used to move the robot to a taught position acquired by jogging. | ||
Typically, the ConfigurationTarget should have the same number of joints as the planning group | ||
of the robot. However, it is possible to specify a subset of the joints, in which | ||
case the remaining joints are left unspecified. | ||
|
||
The :class:`compas_fab.robots.ConstraintSetTarget` class is used to specify a list of | ||
constraints as a planning target. This is intended for advanced users who want to create custom | ||
combination of constraints. See :class:`compas_fab.robots.Constraint` for available | ||
constraints. At the moment, only the ROS MoveIt planning backend supports this target type. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/compas_fab/ghpython/components/Cf_ConfigurationTarget/code.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
""" | ||
Create configuration target for the robot's end-effector motion planning. | ||
COMPAS FAB v1.0.2 | ||
""" | ||
|
||
import math | ||
|
||
from ghpythonlib.componentbase import executingcomponent as component | ||
|
||
from compas_fab.robots import ConfigurationTarget | ||
|
||
|
||
class ConfigurationTargetComponent(component): | ||
DEFAULT_TOLERANCE_METERS = 0.001 | ||
DEFAULT_TOLERANCE_RADIANS = math.radians(1) | ||
|
||
def RunScript(self, robot, target_configuration, tolerances_above, tolerances_below): | ||
if robot and target_configuration: | ||
default_tolerances_above, default_tolerances_below = ConfigurationTarget.generate_default_tolerances( | ||
target_configuration, self.DEFAULT_TOLERANCE_METERS, self.DEFAULT_TOLERANCE_RADIANS | ||
) | ||
|
||
target = ConfigurationTarget( | ||
target_configuration=target_configuration, | ||
tolerances_above=tolerances_above or default_tolerances_above, | ||
tolerances_below=tolerances_below or default_tolerances_below, | ||
) | ||
|
||
return target |
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.