IVALab Python Libraries
Collection of code for computer vision and robotics with specific API.
Public Member Functions | Public Attributes | List of all members
Priority_Tending_Solver Class Reference

Priority-driven solver with human tending action/mode added. More...

Inheritance diagram for Priority_Tending_Solver:
Inheritance graph
[legend]
Collaboration diagram for Priority_Tending_Solver:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, CfgSolver cfgSolver)
 Constructor for Priority Tending Solver instance. More...
 
def getNextAction (self, ImageRGBD rgbd=None, StatePuzzleScene scene=None)
 Return the next action to execute from current solver state. More...
 
def getNextOperation (self, StatePuzzleScene scene, ImageRGBD rgbd)
 Compute the composite priority of each operation and return the operation with highest composite priority. More...
 
def reset_solver (self)
 Reset the solver to begin with a new puzzle or start. More...
 
- Public Member Functions inherited from Priority_Solver
def computePlacePlan (self, StatePuzzleScene scene, ImageRGBD rgbd)
 Computes a custom place plan. More...
 
def updatePriorities (self)
 Update priorities by snagging from ROS1 dynamic parameter server. More...
 
- Public Member Functions inherited from Base
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 updateSolutionRegEstimate (self, StatePuzzleScene scene)
 Review pieces in solution region and update estimate. More...
 

Public Attributes

 mode
 
 PIECES_BEFORE_LOOK
 
 PIECES_BEFORE_TEND
 
 state
 
- Public Attributes inherited from Priority_Solver
 dir_place_pty
 
 mode
 
 PIECES_BEFORE_LOOK
 
 place_pty
 
 sort_pty
 
 state
 
 zones_to_estimate
 
- Public Attributes inherited from Base
 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...
 

Additional Inherited Members

- Static Public Attributes inherited from Base
int NUM_ZONES = 4
 
int SOL = 5
 
int UNORGANIZED = 6
 

Detailed Description

Priority-driven solver with human tending action/mode added.

Augment Priority_Solver with a worker tending mode. Not much changes except for the fact that the robot provides an opportunity for the human worker to fix the puzzle pieces to improve their arrangement (in the sort zones or in the solution proper) before proceeding.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
CfgSolver  cfgSolver 
)

Constructor for Priority Tending Solver instance.

Parameters
[in]cfgSolverConfiguration for the solver, including reference board and parameters.

Reimplemented from Priority_Solver.

Member Function Documentation

◆ getNextAction()

def getNextAction (   self,
ImageRGBD  rgbd = None,
StatePuzzleScene  scene = None 
)

Return the next action to execute from current solver state.

Parameters
[in]rgbdRGBD image for the current scene.
[in]sceneCurrent scene state.
Returns
Action to take.
Note
Uses a two-mode state machine: PERCEIVE - handles tending (human help) and looking (scene estimation). Tending is requested first so the human can fix pieces before the robot re-estimates the scene. ACT - executes sort / place / direct-place operations. The tend counter decrements only after an actual action. When it hits zero or the piece list is exhausted, mode switches back to PERCEIVE.

Reimplemented from Priority_Solver.

◆ getNextOperation()

def getNextOperation (   self,
StatePuzzleScene  scene,
ImageRGBD  rgbd 
)

Compute the composite priority of each operation and return the operation with highest composite priority.

Parameters
[in]rgbdRGBD image for the current scene.
[in]sceneCurrent scene state.
Returns
Tuple: List of pieces, Next operation state
Note
This code essentially duplicates the same code in priority solver which causes problems when there are mistakes. Common elements should go into a common member function. It complicates understanding but simplifies gross changes. That's more important when developing and iterating towards final implementation. 2026/08/02 - PAV.

Reimplemented from Priority_Solver.

◆ reset_solver()

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 and mode.

Reimplemented from Priority_Solver.

Member Data Documentation

◆ mode

mode

◆ PIECES_BEFORE_LOOK

PIECES_BEFORE_LOOK

◆ PIECES_BEFORE_TEND

PIECES_BEFORE_TEND

◆ state

state

The documentation for this class was generated from the following file: