|
IVALab Python Libraries
Collection of code for computer vision and robotics with specific API.
|
Abstract base class for puzzle solver. More...


Public Member Functions | |
| def | __init__ (self, CfgSolver cfgSolver) |
| Constructor for the abstract base puzzle solver. More... | |
| def | checkIDplaceability (self, solID) |
| Checks if piece with solID can be placed must have an adjacent placed piece, or should be on an edge/corner. More... | |
| def | createMeasuredBoard (self, ImageRGBD rgbd, StatePuzzleScene scene, List[int] zones) |
| Take in raw inputs and create (generic) board measurement. More... | |
| def | createSolutionBoard (self, int zone_to_match) |
| Create a solution board based on the zone we want to match against. More... | |
| def | getNextAction (self) |
| Return the next action to execute from current solver state. More... | |
| def | getSequentialPlan (self, measured_board, solution_board, numPieces) |
| Generate a sequential placement plan by sorting matched pieces by solution ID. More... | |
| def | isBoardSolved (self) |
| Check if all puzzle pieces are in place. More... | |
| def | isPieceThere (self, meaPiece, StatePuzzleScene scene) |
| Check if the measured piece is actually present in the scene by analyzing the segmentation mask. More... | |
| def | performMatching (self, Arrangement measured_board, SolutionBoard solution_board) |
| Perform correspondence tracking to find a piece to direct place. More... | |
| def | reset_estimate_board (self) |
| Set the estimate board to all pieces unsolved, based on the solution board. More... | |
| def | reset_solver (self) |
| Reset the solver to begin with a new puzzle or start. More... | |
| def | updateSolutionRegEstimate (self, StatePuzzleScene scene) |
| Review pieces in solution region and update estimate. More... | |
Public Attributes | |
| board_estimate | |
| Board estimate from state history. More... | |
| cfgMatching | |
| Correspondences configs. More... | |
| correspondence_tracker | |
| Puzzle piece correspondence tracker. More... | |
| display | |
| Debug display. More... | |
| imRegions | |
| Region definitions for puzzle zones. More... | |
| mode | |
| Higher level mode regulating activities. More... | |
| puzzle_params | |
| Puzzle-specific parameters for arrangement building. More... | |
| reference_board | |
| Solution reference. More... | |
| state | |
| Internal activity state. More... | |
| verbose | |
| Verbosity level. More... | |
Static Public Attributes | |
| int | NUM_ZONES = 4 |
| int | SOL = 5 |
| int | UNORGANIZED = 6 |
Abstract base class for puzzle solver.
This class collects all of the functional parts needed to solve a puzzle. A reference (solution) board specification, a matching strategy, a description of the piece sort zones, an estimate of the current board, and other gluing elements. All together, these permit an agent to get a sense for the state of progress and plan out how to complete the puzzle.
Naturally, there can be mistaked in the automation.
| def __init__ | ( | self, | |
| CfgSolver | cfgSolver | ||
| ) |
Constructor for the abstract base puzzle solver.
| [in] | cfgSolver | Configuration for the solver, including reference board and parameters. |
Reimplemented in Tending_Solve, Priority_Tending_Solver, Priority_Solver, and Cycle_Place.
| def checkIDplaceability | ( | self, | |
| solID | |||
| ) |
Checks if piece with solID can be placed must have an adjacent placed piece, or should be on an edge/corner.
| [in] | solID | ID of piece to check for visibility / graspability. |
| def createMeasuredBoard | ( | self, | |
| ImageRGBD | rgbd, | ||
| StatePuzzleScene | scene, | ||
| List[int] | zones | ||
| ) |
Take in raw inputs and create (generic) board measurement.
| [in] | rgbd | RGBD image. |
| [in] | scene | Puzzle scene state. |
| [in] | zones | Zone listing for assignment during board measurement. |
| def createSolutionBoard | ( | self, | |
| int | zone_to_match | ||
| ) |
Create a solution board based on the zone we want to match against.
| def getNextAction | ( | self | ) |
Return the next action to execute from current solver state.
| [in] | thePlan | Optional desired action plan. |
| def getSequentialPlan | ( | self, | |
| measured_board, | |||
| solution_board, | |||
| numPieces | |||
| ) |
Generate a sequential placement plan by sorting matched pieces by solution ID.
| [in] | measured_board | The board with measured/detected pieces. |
| [in] | solution_board | The reference solution board to match against. |
| [in] | numPieces | Number of pieces to include in the plan. |
| def isBoardSolved | ( | self | ) |
Check if all puzzle pieces are in place.
This check may not be a hard-core matching based check.
| def isPieceThere | ( | self, | |
| meaPiece, | |||
| StatePuzzleScene | scene | ||
| ) |
Check if the measured piece is actually present in the scene by analyzing the segmentation mask.
| [in] | meaPiece | Measured piece whose presence we want to verify. |
| [in] | scene | Current puzzle scene containing the segmentation mask. |
| def performMatching | ( | self, | |
| Arrangement | measured_board, | ||
| SolutionBoard | solution_board | ||
| ) |
Perform correspondence tracking to find a piece to direct place.
@param[in] measured_board Latest measured board.
@param[in] solution_board Known solution board.
| def reset_estimate_board | ( | self | ) |
Set the estimate board to all pieces unsolved, based on the solution board.
| def reset_solver | ( | self | ) |
Reset the solver to begin with a new puzzle or start.
Resets the board estimate to all pieces unsolved, based on the solution board. Also resets the state.
Reimplemented in Tending_Solve, Sort_Mode, Priority_Tending_Solver, Priority_Solver, Permute_Solver, and Cycle_Place.
| def updateSolutionRegEstimate | ( | self, | |
| StatePuzzleScene | scene | ||
| ) |
Review pieces in solution region and update estimate.
| [in] | scene | Puzzle scene state. |
| board_estimate |
Board estimate from state history.
| cfgMatching |
Correspondences configs.
| correspondence_tracker |
Puzzle piece correspondence tracker.
| display |
Debug display.
| imRegions |
Region definitions for puzzle zones.
| mode |
Higher level mode regulating activities.
Perceive to start.
|
static |
| puzzle_params |
Puzzle-specific parameters for arrangement building.
| reference_board |
Solution reference.
|
static |
| state |
Internal activity state.
|
static |
| verbose |
Verbosity level.