Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Action and SceneState #390

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
67aef25
Initial intro of Action and State classes
yck011522 Nov 6, 2023
57c7881
doc string wip
yck011522 Nov 7, 2023
2e10350
Merge remote-tracking branch 'compas-dev/main' into introduce_actions
yck011522 Nov 9, 2023
87c8a10
Refactor SceneState, WorkpieceState, ToolState and
yck011522 Nov 9, 2023
b7157a1
Improved documentation of Planning Module
yck011522 Nov 9, 2023
1920e28
Fix formatting and typos in planning module
yck011522 Nov 9, 2023
9253e24
Added more details to Linear and Free Movement
yck011522 Nov 14, 2023
33711f6
CartesianMovement
yck011522 Nov 15, 2023
2b881b8
Naming change
yck011522 Nov 16, 2023
8e69346
Renaming
yck011522 Nov 16, 2023
d657568
lint
yck011522 Nov 16, 2023
20cd04d
tests
yck011522 Nov 16, 2023
ba607cb
lint
yck011522 Nov 16, 2023
aebb0a3
HideWorkpieces and ShowWorkpieces Actions
yck011522 Nov 17, 2023
0c3cd1c
Change Naming: CartesianMotion to LinearMotion
yck011522 Nov 22, 2023
2779bc9
Update LinearMotion class to include multiple
yck011522 Nov 22, 2023
8775f35
missing HideWorkpieces and ShowWorkpieces in action.all
yck011522 Nov 22, 2023
1e120e9
Add doc to Action Class about check preconditions and apply effects
yck011522 Nov 22, 2023
f0ceebe
update test
yck011522 Nov 22, 2023
97bbbb4
Apply suggestions (docstrings) from code review
yck011522 Dec 7, 2023
11dfe5c
Rename ManuallyMoveWorkpiece to ManualWorkpieceMotion
yck011522 Dec 7, 2023
77b61e3
Fixed Missing autosummary classes
yck011522 Dec 7, 2023
3aab57b
fix multiple import per line
yck011522 Dec 7, 2023
af5788d
Better Doc String for States,
yck011522 Dec 7, 2023
ecc8cea
Fix import WorkpieceState error in example oode
yck011522 Dec 11, 2023
8c83e2e
Try something else with the example code
yck011522 Dec 11, 2023
38e6de0
Update src/compas_fab/planning/action.py
yck011522 Dec 11, 2023
b5da572
Added Planning Group as attribute. Remove planned results.
yck011522 Dec 13, 2023
1ff8d20
docstring typo
yck011522 Dec 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

* Added `compas_fab.planning` that contains `Action` classes and `SceneState`
* Added `RoboticAction`, `LinearMotion`, `FreeMotion`, `OpenGripper`, `CloseGripper`, `ManualWorkpieceMotion`, `HideWorkpieces` and `ShowWorkpieces`.
* Added `SceneState` as container for `WorkpieceState`, `ToolState` and `RobotState`.

### Changed

* `CollisionMesh` now inherit from `compas.data.Data`
Expand Down
2 changes: 2 additions & 0 deletions docs/api/compas_fab.planning.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

.. automodule:: compas_fab.planning
16 changes: 14 additions & 2 deletions src/compas_fab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,27 @@
Robots
------

The core features are located in the ``robots`` module with the specific backend
implementations in the ``backends`` modules:
Features for modeling robots and methods to perform static inverse kinematics and
single-action motion planning.
The user-facing features are located in the ``robots`` module.
The implementations of planning backends are located in the ``backends`` modules:

.. toctree::
:maxdepth: 1

compas_fab.robots
compas_fab.backends

Planning
--------

Features for modeling multi-action robotic processes and methods for planning them.

.. toctree::
:maxdepth: 1

compas_fab.planning

CAD integration
---------------

Expand Down
107 changes: 107 additions & 0 deletions src/compas_fab/planning/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
"""
yck011522 marked this conversation as resolved.
Show resolved Hide resolved
********************************************************************************
compas_fab.planning
********************************************************************************

.. currentmodule:: compas_fab.planning

This package contains data classes for modeling robotic process and algorithms for planning robotic motions.
The current implementation supports single-robot (:class:`compas_fab.robots.Robot`)
processes with one or more workpieces (:class:`Workpiece`) and tools (:class:`compas_fab.robots.Tool`).
The processes contains actions that are assumed to be sequentially executed by the robot
or by the operator (manually). Concurrent actions are not supported.

The FabricationProcess class and its subclasses (such as :class:`PickAndPlaceProcess` and
:class:`ExtrusionProcess`) are used to model a process. They provide helper methods for
creating a ordered list of actions that are used for planning and execution. The beining of the
process is defined by the initial state of the scene, which is a container for the state of all
objects in the scene (see :class:`SceneState`). The initial state is used to plan the first action
in the process. The resulting state of the first action is used as the initial state for the next
action, and so on. See tutorial on :ref:`planning_process` for more details.


Actions
--------

Action classes are abstractions of the robot's (and, or the operator's) capability to manipulate tools and
workpieces in the scene. Action classes are used for modeling a process for the following purpose:

* To plan trajectories for robotic motions
* To simulate and visualize the process in a virtual environment
* To execute the process on a real robot or a human-robot collaboration process

.. autosummary::
:toctree: generated/
:nosignatures:

Action
RoboticAction
LinearMotion
FreeMotion
OpenGripper
CloseGripper
ManualWorkpieceMotion
HideWorkpieces
ShowWorkpieces

yck011522 marked this conversation as resolved.
Show resolved Hide resolved
States
------

State classes are used to model the immutable, static state of objects in the planning scene. These include:
:class:`RobotState` for :class:`compas_fab.robots.Robot`,
:class:`ToolState` for :class:`compas_fab.robots.Tool` and
:class:`WorkpieceState` for :class:`compas_fab.robots.Workpiece`.
The :class:`SceneState` class is a container that holds the state of all objects in the scene.

Typically a robotic process will have an initial (starting) state that is defined manually.
If sequential planning is used, the initial state is used to plan the first action in the process.
The resulting state of the first action is used as the initial state for the next action, and so on.
If non-sequential planning is used, the starting state of actions are inferred from the list of
actions in the process. See tutorial on :ref:`planning_process` for more details.

.. autosummary::
:toctree: generated/
:nosignatures:

SceneState
WorkpieceState
ToolState
RobotState


"""

from .action import (
Action,
RoboticAction,
LinearMotion,
FreeMotion,
OpenGripper,
CloseGripper,
ManualWorkpieceMotion,
HideWorkpieces,
ShowWorkpieces,
)

from .state import (
SceneState,
WorkpieceState,
ToolState,
RobotState,
)

__all__ = [
"Action",
"RoboticAction",
"LinearMotion",
"FreeMotion",
"OpenGripper",
"CloseGripper",
"ManualWorkpieceMotion",
"HideWorkpieces",
"ShowWorkpieces",
"SceneState",
"WorkpieceState",
"ToolState",
"RobotState",
]
Loading
Loading