-
Notifications
You must be signed in to change notification settings - Fork 34
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
base: main
Are you sure you want to change the base?
Conversation
RobotState classes
Link to compas-dev/compas#1209 for potential synergy. |
linear segments by specifying intermediate_targets.
@gonzalocasas @chenkasirer Will you have time to take a look at this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking good! I added a bunch of feedback, the only thing that really worries me is the lack of support for multiple robots, which I feel might be an impossible thing to add in the future, so, as mentioned, let's chat about it soon and see what are the options.
Test adding an example to WorkpieceState
Co-authored-by: Gonzalo Casas <[email protected]>
Moved intermediate_planning_waypoint to FreeMotion RobotAction.apply_effects does not take the robot config from ActionPlanResult yet, That will come in next PR
Lets hold on to resolve the Targets #409 before going back to this one. |
This pull request is to introduce the Action and State Classes for modeling a robotic fabrication process. The concept of Actions and States is based on this paper https://dl.acm.org/doi/abs/10.1145/3485114.3485122.
Actions
andSceneStates
are related tightly because an Action is conceptually the object that would change the current state to a new state.There is generally a distinction between robotic actions vs non-robotic actions. The difference is that the robotic ones require motion planning, which is fulfilled by the motion planning backend of compas_fab. The distinction is implemented by inheriting from the
RoboticAction
class. A number of common Actions are provided in the compas_fab library, but users are free to implement their own actions according to the needs of their process and the function of their tools.In any robotic process, the initial state is described with
SceneState
object. It contains the state of all the mutable properties of objects in the planning scene. The objects includeRobotState
,ToolState
(multiple), and WorkpieceState (multiple). The default implementation of these objects contains a minimal set of properties. For example, WorkpieceState contains the location (Frame
) of the workpiece. Users can inherit these as base classes and add more properties if needed. In addition, theSceneState
contains information describing tool attachment (to Robot) and workpiece attachment (to Tool). See API of SceneState for more details.As actions are performed (or applied in simulation), they influence the state of the scene, resulting in a new scene state. The new scene state can be used to describe the beginning of the next action and so on. This function to modify a starting state to create an ending state is encoded using the function
Action.apply_to(self, scene_state,)
. This function allows automatic parsing of all intermediate states once the (1) initial state and (2) action list are created. This allows the user to visualize the scene, where object locations and attachment relationships can be examined. This visualization can happen even before motion planning and can help identify incorrect modeling that may cause motion planning failure.During motion planning, the planner is preloaded with all the object models. The input to plan a single RoboticAction is the starting scene state and the RoboticAction object. In special cases where non-sequential planning is required, the SceneState at the beginning of any action can be computed automatically, allowing a single Action to be planned out of sequence. See Tutorial: Non-Sequential Planning (not yet written) for more details.
After motion planning, the planned trajectory will be stored in the same Action object. Which can be used for visualization and execution.
What type of change is this?
Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.CHANGELOG.md
file in theUnreleased
section under the most fitting heading (e.g.Added
,Changed
,Removed
).invoke test
).invoke lint
).compas_fab.robots.CollisionMesh
.