IVALab Python Libraries
Collection of code for computer vision and robotics with specific API.
Public Member Functions | Public Attributes | List of all members
StateEstimator Class Reference
Inheritance diagram for StateEstimator:
Inheritance graph
[legend]
Collaboration diagram for StateEstimator:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, signal_number, signal_cache_limit=1000, state_cache_limit=1000, signal_names=[], state_number=3, state_names=["Move", "Progress_Made", "Puzzle_in_Hand"], move_th=2, hand_track_color=[255, 0, 0], state_text_color=[255, 0, 0])
 
def parse (self, List cur_signals)
 
def parse_move (self, cur_signals)
 
def parse_PinH (self, cur_signals)
 
def parse_progress (self, cur_signals)
 
def plot_states (self, rgb)
 
def visualize (self, rgb, ratio=0.5, window_name="States")
 
- Public Member Functions inherited from Base_state
def __init__ (self, signal_number, state_number, signal_cache_limit=1000, state_cache_limit=1000, signal_names=[], state_names=[])
 
def get_states (self)
 
def measure (self, List cur_signals)
 
def parse (self, cur_signals)
 
def update (self, cur_signals, cur_states)
 
def visualize_state_evolving (self, fh=None)
 
- Public Member Functions inherited from Base
def __init__ (self)
 
def adapt (self)
 
def correct (self)
 
def measure (self, signal)
 
def predict (self)
 
def process (self, signal)
 

Public Attributes

 hand_track_color
 
 move_th
 
 signal_cache_count
 
 state_text_color
 
- Public Attributes inherited from Base_state
 f_idx
 
 signal_cache_count
 
 signal_cache_limit
 
 signal_names
 
 signal_number
 
 signals_cache
 
 state_cache_count
 
 state_cache_limit
 
 state_names
 
 state_number
 
 states_cache
 
- Public Attributes inherited from Base
 x
 

Detailed Description

The State Estimator v1.0

Fix to estimate three binary states: Move, Make_Puzzle_Progress, Puzzle_in_hand.
The signal used for the state estimation is:
    1. The hand location,
    2. The puzzle solving progress (percentage)
    3. Piece in hand 
For now allow customization for the signals and the states used for the development purpose

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  signal_number,
  signal_cache_limit = 1000,
  state_cache_limit = 1000,
  signal_names = [],
  state_number = 3,
  state_names = ["Move", "Progress_Made", "Puzzle_in_Hand"],
  move_th = 2,
  hand_track_color = [255, 0, 0],
  state_text_color = [255, 0, 0] 
)

Member Function Documentation

◆ parse()

def parse (   self,
List  cur_signals 
)
Parse the states out of the signals

Args:
    cur_signals (np.ndarray, (signal_number, )):    The signals of the current timestamp. \
According to the current design, the signals should be a list who stores: \
    1. hand location (np.ndarray, (2, ))
    2. Puzzle solving progress (percentage number)
    3. puzzle piece in hand (binary)
Return:
    cur_states (np.ndarray, (state_num, )):         The states parsed of the current timestamp

◆ parse_move()

def parse_move (   self,
  cur_signals 
)
Parse the moving state

◆ parse_PinH()

def parse_PinH (   self,
  cur_signals 
)
Parse whether the puzzle-in-hand state, which is a binary indicator whether the hand is holding a puzzle piece or not

◆ parse_progress()

def parse_progress (   self,
  cur_signals 
)
Parse the progress state, which is a binary indicator of whether the puzzle solving is making progress or not

◆ plot_states()

def plot_states (   self,
  rgb 
)

◆ visualize()

def visualize (   self,
  rgb,
  ratio = 0.5,
  window_name = "States" 
)
Visualize the state process on the image data with the necessary facilitative plots

The state will be displayed on the top left corner of the frame.
For the facilitative plots,
    (1) the hand tracker and the recent trajectory will be plotted

Args:
    rgb (array, (H, W, 3)):         The RGB image on which to display the states and drawing
    ratio (float, ):                The scaling ratio for the display
    window_name (str):              The window name for the display

Member Data Documentation

◆ hand_track_color

hand_track_color

◆ move_th

move_th

◆ signal_cache_count

signal_cache_count

◆ state_text_color

state_text_color

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