Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
fetch_pbd_interaction.action.Action Class Reference

List of all members.

Public Member Functions

def __init__
def add_primitive
def build_from_json
def clear
def decrease_id
def delete_last_primitive
def delete_primitive
def delete_primitive_marker
def end_execution
def execute_primitive
def get_action_id
def get_json
def get_marker_visibility
def get_name
def get_primitive
def get_primitive_names
def get_primitive_positions_orientations
def get_primitives
def get_primitives_editable
def get_ref_frame_names
def get_status
def head_busy
def initialize_viz
def is_object_required
def make_primitive_marker
def n_primitives
def reset_viz
def select_primitive
def set_action_id
def set_name
def set_status
def start_execution
def stop_execution
def switch_primitive_order
def update_objects
def update_primitive_pose
def update_viz

Private Member Functions

def _check_pre_conditions
def _execute_action
def _is_action_reachable
def _loop_through_primitives
def _primitive_pose_change
def _update_links
def _update_markers

Static Private Member Functions

def _get_link

Private Attributes

 _action_change_cb
 _action_id
 _external_ee_link
 _grasp_feedback_topic
 _grasp_suggestion_service
 _im_server
 _link_markers
 _lock
 _name
 _preempt
 _primitive_click_cb
 _primitive_counter
 _robot
 _seq
 _status
 _status_publisher
 _tf_listener

Static Private Attributes

 _marker_publisher = None

Detailed Description

Holds information for one action.

Definition at line 46 of file action.py.


Constructor & Destructor Documentation

def fetch_pbd_interaction.action.Action.__init__ (   self,
  robot,
  tf_listener,
  im_server,
  primitive_click_cb,
  action_change_cb,
  action_id = None,
  grasp_suggestion_service = None,
  grasp_feedback_topic = None,
  external_ee_link = None 
)
Args:
    robot (Robot) : interface to lower level robot functionality
    tf_listener (TransformListener)
    im_server (InteractiveMarkerSerever)
    primitive_click_cb (function(int)): The function to call when a
primitive is clicked on (normally in the GUI). The function
should take the number of the primitive
    action_id (int, optional): The index of this action.

Definition at line 54 of file action.py.


Member Function Documentation

Loop through primitives and make sure all of their 
preconditions are met

Returns:
    bool

Definition at line 765 of file action.py.

Function to replay the demonstrated action.

Definition at line 732 of file action.py.

def fetch_pbd_interaction.action.Action._get_link (   primitive0,
  primitive1,
  marker_id 
) [static, private]
Returns a marker representing a link b/w two consecutive
primitives (both must already exist).

Args:
    primitive0 (Primitive)
    primitive1 (Primitive)
    marker_id (int) : id for link marker between to primitives

Returns:
    Marker|None

Definition at line 694 of file action.py.

Make sure that action is possible to execute entire action

Definition at line 798 of file action.py.

Goes through the primitives of the current action and moves to
each.

Definition at line 810 of file action.py.

Update links when primitive pose changes

Definition at line 725 of file action.py.

Updates the visualized links b/w action primitives.

Definition at line 870 of file action.py.

Updates the markers after a change.

Definition at line 864 of file action.py.

def fetch_pbd_interaction.action.Action.add_primitive (   self,
  primitive,
  add_marker = True,
  add_name = True 
)
Add primitive to action.

Args:
    primitive (Primitive)
    add_marker (bool)
    add_name (bool)

Definition at line 264 of file action.py.

Fills out action using information using json from db

Args:
    dict : json/dict retrieved from couchdb

Definition at line 180 of file action.py.

Clears the action.

Definition at line 590 of file action.py.

Decrement the action's id by one

Definition at line 598 of file action.py.

Deletes the last primitive of the action.

Definition at line 436 of file action.py.

Deletes a primitive from the action.

NOTE(mbforbes): The lock should be acquired before calling this
method.

Args:
    to_delete (int): The index of the primitive to delete.

Definition at line 640 of file action.py.

def fetch_pbd_interaction.action.Action.delete_primitive_marker (   self,
  primitive_number 
)
Delete marker with certain index

Args:
    primitive_number (int)

Definition at line 345 of file action.py.

Indicate that execution status can reset to
    ExecutionStatus.NOT_EXECUTING

Definition at line 241 of file action.py.

Execute specified primitive

Args:
    to_execute (int)

Definition at line 680 of file action.py.

Returns action_id

Returns:
    int

Definition at line 132 of file action.py.

Return json for this action for saving to db

Returns:
    dict

Definition at line 164 of file action.py.

Returns visibility status of primitive markers

Returns:
    [bool]

Definition at line 370 of file action.py.

Returns human-readable name for action

Returns
    (string)

Definition at line 156 of file action.py.

Returns primitive of the action based on index.

Args:
    index (int): Index (0-based) of primitive to return.

Returns:
    Primitive|None: Returns None if no such primitive exists.

Definition at line 557 of file action.py.

Returns the names of primitives.

Returns:
    [str]

Definition at line 472 of file action.py.

Returns the positions and orientations of primitives
Returns:
    Point[], OrientationRPY[]

Definition at line 485 of file action.py.

Return list of primitives

Returns:
    [Primitive]

Definition at line 546 of file action.py.

Returns list of whether primitive poses are editable

Returns:
    [bool]

Definition at line 507 of file action.py.

Returns the names of the reference frame objects for all
action primitives.

Returns:
    [str]

Definition at line 458 of file action.py.

Return execution status of action

Returns:
    ExecutionStatus.EXECUTING|NOT_EXECUTING|...etc

Definition at line 247 of file action.py.

Returns true if head is busy

Returns:
    bool

Definition at line 121 of file action.py.

Initialize visualization.

Definition at line 411 of file action.py.

Returns whether this action has any primitives that are relative
to objects in the world (instead of absolute).

Returns:
    bool

Definition at line 441 of file action.py.

def fetch_pbd_interaction.action.Action.make_primitive_marker (   self,
  primitive_number 
)
Show marker with certain index

Args:
    primitive_number (int)

Definition at line 356 of file action.py.

Returns the number of primitives in this action.

Returns:
    int

Definition at line 316 of file action.py.

Removes all visualization relating to this action.

Definition at line 324 of file action.py.

def fetch_pbd_interaction.action.Action.select_primitive (   self,
  primitive_number,
  is_selected 
)
Callback for when one of the markers is clicked.
Selects clicked marker and unselects others.

Args:
    primitive_number (int)
    is_selected(bool): Whether the marker was
selected (True) or de-selected (False).

Definition at line 381 of file action.py.

def fetch_pbd_interaction.action.Action.set_action_id (   self,
  action_id 
)
Returns action_id

Args:
    action_id (int)

Definition at line 140 of file action.py.

Sets human-readable name for action

Args:
    name (string)

Definition at line 148 of file action.py.

def fetch_pbd_interaction.action.Action.set_status (   self,
  status 
)
Set execution status of action

Args:
    status (ExecutionStatus.EXECUTING|NOT_EXECUTING|...etc)

Definition at line 255 of file action.py.

Starts execution of action.

This method spawns a new thread.

Args:
    z_offset (float): Amount to add to z-values of pose
positions.

Definition at line 218 of file action.py.

Indicate that user wants to preempt action execution 

Definition at line 237 of file action.py.

def fetch_pbd_interaction.action.Action.switch_primitive_order (   self,
  old_index,
  new_index 
)
Change the order of primitives in action

Args:
    old_index (int)
    new_index (int)

Definition at line 602 of file action.py.

For each primitive, updates the reference frames based on
the locations of objects in the world

Definition at line 301 of file action.py.

def fetch_pbd_interaction.action.Action.update_primitive_pose (   self,
  primitive_number,
  position,
  orientation 
)
Update pose of primitive given by primitive_number

Args:
    primitive_number (int)
    position (Point)
    orientation (OrientationRPY)

Definition at line 520 of file action.py.

Updates the visualization of the action.

Definition at line 580 of file action.py.


Member Data Documentation

Definition at line 64 of file action.py.

Definition at line 64 of file action.py.

Definition at line 64 of file action.py.

Definition at line 64 of file action.py.

Definition at line 64 of file action.py.

Definition at line 64 of file action.py.

Definition at line 64 of file action.py.

Definition at line 64 of file action.py.

Definition at line 52 of file action.py.

Definition at line 64 of file action.py.

Definition at line 64 of file action.py.

Definition at line 64 of file action.py.

Definition at line 64 of file action.py.

Definition at line 64 of file action.py.

Definition at line 64 of file action.py.

Definition at line 64 of file action.py.

Definition at line 64 of file action.py.

Definition at line 64 of file action.py.


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


fetch_pbd_interaction
Author(s): Sarah Elliott
autogenerated on Thu Jun 6 2019 18:27:21