Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
fetch_pbd_interaction.grasp.Grasp Class Reference
Inheritance diagram for fetch_pbd_interaction.grasp.Grasp:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def add_marker_callbacks
def build_from_json
def build_from_pose
def change_ref_frame
def check_post_condition
def check_pre_condition
def decrease_id
def execute
def get_absolute_marker_pose
def get_absolute_marker_position
def get_absolute_pose
def get_json
def get_name
def get_number
def get_primitive_number
def get_ref_frame_name
def get_ref_type
def get_relative_pose
def head_busy
def hide_marker
def is_control_visible
def is_object_required
def is_reachable
def is_selected
def marker_visible
def pose_editable
def select
def set_control_visible
def set_name
def set_pose
def set_primitive_number
def show_marker
def update_ref_frames
def update_viz

Private Member Functions

def _add_6dof_marker
def _change_grasp_frames
def _change_ref_cb
def _convert_ref_frame
def _delete_primitive_cb
def _generate_grasps_cb
def _get_marker_pose
def _get_menu_id
def _get_menu_name
def _get_menu_ref
def _make_6dof_control
def _make_gripper_markers
def _marker_feedback_cb
def _move_to_cb
def _regenerate_grasps_cb
def _set_new_pose
def _set_pre_grasp_state_from_pose
def _set_ref
def _suggest_grasps
def _switch_grasp_cb
def _update_menu
def _update_viz_core

Static Private Member Functions

def _get_json_from_arm_state
def _get_json_from_landmark
def _get_json_from_pose
def _get_json_from_pose_stamped
def _get_matrix_from_pose
def _get_pose_from_json
def _get_pose_from_transform
def _get_pose_stamped_from_json
def _make_mesh_marker
def _offset_pose

Private Attributes

 _action_change_cb
 _approach_dist
 _color_mesh_reachable
 _color_mesh_unreachable
 _current_grasp_list
 _current_grasp_num
 _external_ee_link
 _get_most_similar_obj_srv
 _get_object_from_name_srv
 _get_object_list_srv
 _grasp_feedback_publisher
 _grasp_menu_entries
 _grasp_reachable
 _grasp_state
 _grasp_suggestion_srv
 _head_busy
 _im_server
 _is_control_visible
 _landmark_found
 _marker_click_cb
 _marker_delete_cb
 _marker_visible
 _menu_handler
 _name
 _number
 _pose_change_cb
 _pre_grasp_reachable
 _pre_grasp_state
 _robot
 _selected
 _sub_entries
 _tf_listener
 _viewed_grasps

Static Private Attributes

 _offset = DEFAULT_OFFSET

Detailed Description

Defines behaviour for Grasp primitive. This is for primitives
where the arm moves to a single pose.

Definition at line 98 of file grasp.py.


Constructor & Destructor Documentation

def fetch_pbd_interaction.grasp.Grasp.__init__ (   self,
  robot,
  tf_listener,
  im_server,
  grasp_suggestion_service_name = None,
  grasp_feedback_topic = None,
  external_ee_link = None,
  landmark = None,
  number = None 
)
Args:
    robot (Robot) : interface to lower level robot functionality
    tf_listener (TransformListener)
    im_server (InteractiveMarkerSerever)
    arm_state (ArmState, optional)
    gripper_state (GripperState.OPEN|GripperState.CLOSED, optional)
    number (int, optional): The number of this primitive in the
    action sequence

Definition at line 105 of file grasp.py.


Member Function Documentation

def fetch_pbd_interaction.grasp.Grasp._add_6dof_marker (   self,
  int_marker,
  is_fixed 
) [private]
Adds a 6 DoF control marker to the interactive marker.

Args:
    int_marker (InteractiveMarker)
    is_fixed (bool): Looks like whether position is fixed (?).
Currently only passed as True.

Definition at line 1304 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._change_grasp_frames (   self,
  target_frame 
) [private]
Change frames of grasps in self._current_grasp_list

Definition at line 961 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._change_ref_cb (   self,
  feedback 
) [private]
Callback for when a reference frame change is requested.

Args:
    feedback (InteractiveMarkerFeedback (?))

Definition at line 1481 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._convert_ref_frame (   self,
  new_landmark 
) [private]
Convert grasp_state and pre_grasp_state to be in a different 
   reference frame

    Args:
new_landmark (Landmark)
    Returns:
ArmState

Definition at line 1124 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._delete_primitive_cb (   self,
  feedback 
) [private]
Callback for when delete is requested.

Args:
    feedback (InteractiveMarkerFeedback): Unused

Definition at line 1450 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._generate_grasps_cb (   self,
  feedback 
) [private]
Callback for when users want to generate grasps for an object

Definition at line 909 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._get_json_from_arm_state (   arm_state) [static, private]
Return json containing data of arm_state

Args:
    arm_state (ArmState)
Returns:
    json (dict)

Definition at line 719 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._get_json_from_landmark (   landmark) [static, private]
Return json containing data of landmark

Args:
    landmark (Landmark)
Returns:
    json (dict)

Definition at line 775 of file grasp.py.

Return json containing data of pose

Args:
    pose (Pose)
Returns:
    json (dict)

Definition at line 752 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._get_json_from_pose_stamped (   pose_stamped) [static, private]
Return json containing data of pose_stamped

Args:
    pose_stamped (PoseStamped)
Returns:
    json (dict)

Definition at line 737 of file grasp.py.

Returns the pose of the marker for the primitive.

Returns:
    Pose

Definition at line 1198 of file grasp.py.

Returns the transformation matrix for given pose.

Args:
    pose (PoseStamped)

Returns:
    Matrix3x3

Definition at line 856 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._get_menu_id (   self,
  ref_name 
) [private]
Returns the unique menu id from its name or None if the
object is not found.

Args:
    ref_name (str)
Returns:
    int (?)|None

Definition at line 1067 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._get_menu_name (   self,
  menu_id 
) [private]
Returns the menu name from its unique menu id.

Args:
    menu_id (int)
Returns:
    str

Definition at line 1090 of file grasp.py.

Returns the name string for the reference frame object of the
primitive. This is specifically for

Returns:
    str|None: Under all normal circumstances, returns the str
reference frame name. Returns None in error.

Definition at line 1522 of file grasp.py.

Return Pose msg from json

Args:
    json (dict)
Returns:
    Pose

Definition at line 811 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._get_pose_from_transform (   transform) [static, private]
Returns pose for transformation matrix.

Args:
    transform (Matrix3x3): (I think this is the correct type.
See Grasp as a reference for how to use.)

Returns:
    Pose

Definition at line 873 of file grasp.py.

Return PoseStamped msg from json

Args:
    json (dict)
Returns:
    PoseStamped

Definition at line 795 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._make_6dof_control (   self,
  name,
  orientation,
  is_move,
  is_fixed 
) [private]
Creates and returns one component of the 6dof controller.

Args:
    name (str): Name for hte control
    orientation (Quaternion): How the control should be
oriented.
    is_move (bool): Looks like whether the marker moves the
object (?). Currently passed as True for moving markers,
False for rotating ones.
    is_fixed (bool): Looks like whether position is fixed (?).
Currently always passed as True.

Returns:
    InteractiveMarkerControl

Definition at line 1326 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._make_gripper_markers (   self,
  control 
) [private]
Makes a gripper marker, adds it to control, returns control.

Args:
    control (InteractiveMarkerControl): IM Control we're using.
    is_hand_open (bool, optional): Whether the gripper is open.
Defaults to False (closed).

Returns:
    InteractiveMarkerControl: The passed control.

Definition at line 1376 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._make_mesh_marker (   color) [static, private]
Creates and returns a mesh marker.

Returns:
    Marker

Definition at line 891 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._marker_feedback_cb (   self,
  feedback 
) [private]
Callback for when an event occurs on the marker.

Args:
    feedback (InteractiveMarkerFeedback)

Definition at line 1501 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._move_to_cb (   self,
  feedback 
) [private]
Callback for when moving to a pose is requested.

Args:
    feedback (InteractiveMarkerFeedback): Unused

Definition at line 1472 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._offset_pose (   pose,
  constant = 1 
) [static, private]
Offsets the world pose for visualization.

Args:
    pose (PoseStamped): The pose to offset.
    constant (int, optional): How much to scale the set offset
by (scales Grasp._offset). Defaults to 1.

Returns:
    PoseStamped: The offset pose.

Definition at line 833 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._regenerate_grasps_cb (   self,
  feedback 
) [private]
Callback for regenerating grasps upon request

Args:
    feedback (InteractiveMarkerFeedback): Unused

Definition at line 1458 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._set_new_pose (   self,
  new_pose,
  frame_id 
) [private]
Changes the pose of the primitive to new_pose.

Args:
    new_pose (Pose)

Definition at line 1357 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._set_pre_grasp_state_from_pose (   self,
  pose_stamped 
) [private]
Sets pre_grasp_state based on a pose_stamped msg

Definition at line 1172 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._set_ref (   self,
  new_ref 
) [private]
Changes the reference frame of the primitive to
new_ref_name.

Args:
    new_ref_name

Definition at line 1106 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._suggest_grasps (   self,
  landmark 
) [private]
Call grasp suggestion service and process results

Definition at line 926 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._switch_grasp_cb (   self,
  feedback 
) [private]
Callback to switch between grasps indicated by menu entries

Definition at line 914 of file grasp.py.

Recreates the menu when something has changed.

Definition at line 1012 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp._update_viz_core (   self,
  check_reachable = True 
) [private]
Updates visualization after a change.

Args:
    check_reachable (bool) : Check reachability of 
    pose before drawing marker

Definition at line 1236 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp.add_marker_callbacks (   self,
  click_cb,
  delete_cb,
  pose_change_cb,
  action_change_cb 
)
Adds marker to world

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 296 of file grasp.py.

Fills out Grasp using json from db

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 216 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp.build_from_pose (   self,
  pose_stamped,
  landmark,
  approach_dist = 0.1,
  name = '' 
)
Fills out Grasp using information from David's grasp suggestion

Definition at line 192 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp.change_ref_frame (   self,
  ref_type,
  landmark 
)
Sets new reference frame for primitive

Args:

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 363 of file grasp.py.

Currently just a placeholder
    Meant to return conditions that need to be met after a
    primitive is executed in order for execution to be a success.
    This could be something like "object must be 0.1m above surface"

    Returns:
None

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 284 of file grasp.py.

Currently just a placeholder
    Meant to return conditions that need to be met before a
    primitive can be executed. This could be something like
    "There should only be one object" or something.

    Returns:
None

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 263 of file grasp.py.

Reduces the number of the primitive.

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 658 of file grasp.py.

Execute this primitive, assumes that gripper commands just work

Returns
    bool : Success of execution

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 496 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp.get_absolute_marker_pose (   self,
  use_final = True 
)
Returns the absolute pose of the primitive marker.

Args:
    use_final (bool, optional). Unused

Returns:
    PoseStamped

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 596 of file grasp.py.

Returns the absolute position of the primitive marker.

Args:
    use_final (bool, optional) : Unused
True.

Returns:
    Point

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 642 of file grasp.py.

Returns the absolute pose of the grasp part of the primitive
   (not the pre-grasp).

Args:
    None

Returns:
    PoseStamped

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 561 of file grasp.py.

Returns json representation of primitive

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 179 of file grasp.py.

Returns the display name for the primitive.

Returns:
    str: A human-readable unique name for the primitive.

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 670 of file grasp.py.

Returns number of primitive

Returns:
    int

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 678 of file grasp.py.

Returns what number this primitive is in the sequence

Returns:
    int

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 472 of file grasp.py.

Returns the name string for the reference frame object of the
primitive.

Returns:
    str|None: Under all normal circumstances, returns the str
reference frame name. Returns None in error.

Definition at line 381 of file grasp.py.

Return reference type of primitive

Returns:
    ArmState.ROBOT_BASE, etc

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 706 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp.get_relative_pose (   self,
  use_final = True 
)
Returns the absolute pose of the primitive.
Args:
    use_final (bool, optional). If true, uses pose of grasp_state
    rather than pre_grasp_state
Returns:
    PoseStamped

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 543 of file grasp.py.

Return true if head busy

Returns:
    bool

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 525 of file grasp.py.

Removes marker from the world.

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 323 of file grasp.py.

Check if the marker control is visible

Returns
    bool

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 431 of file grasp.py.

Check if this primitive requires an object to be present

Returns:
    bool

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 488 of file grasp.py.

Check if robot can physically reach target

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 533 of file grasp.py.

Return whether or not primitive is selected

Returns
    bool

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 423 of file grasp.py.

Return whether or not marker is visible

Returns:
    bool

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 331 of file grasp.py.

Return whether pose of primitive is editable

Returns:
    bool : True

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 698 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp.select (   self,
  is_selected 
)
Set whether primitive is selected or not

Args:
    is_selected (bool)

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 405 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp.set_control_visible (   self,
  visible = True 
)
Set visibility of marker controls

Args:
    visible (bool, optional)

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 439 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp.set_name (   self,
  name 
)
Sets the display name for the primitive.

Args:
    name (str) : A human-readable unique name for the primitive.

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 662 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp.set_pose (   self,
  new_pose 
)
Changes the pose of the primitive to new_pose.

Args:
    new_pose (PoseStamped)

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 686 of file grasp.py.

Sets what number this primitive is in the sequence

Args:
    num (int)

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 480 of file grasp.py.

Adds marker for primitive

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 307 of file grasp.py.

Updates and re-assigns coordinate frames when the world changes.

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 339 of file grasp.py.

def fetch_pbd_interaction.grasp.Grasp.update_viz (   self,
  check_reachable = True 
)
Updates visualization fully.
Args:
    check_reachable (bool) : whether to evaluate reachability
                    before drawing marker

Reimplemented from fetch_pbd_interaction.primitive.Primitive.

Definition at line 447 of file grasp.py.


Member Data Documentation

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 103 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.py.

Definition at line 114 of file grasp.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