ed.shape

Classes

Shape

Represents shape properties

RightPrism

Represents a right prism, i.e., a prism in which the joining edges and faces are perpendicular to the base

Functions

shape_from_entity_info(e)

Creates a shape from the convex_hull, z_min and z_max of the EntityInfo object. If no convex hull is present,

Module Contents

class ed.shape.Shape[source]

Bases: ed.util.equal_hash_mixin.EqualHashMixin

Represents shape properties

property convex_hull: List[PyKDL.Vector]
Return type:

List[PyKDL.Vector]

abstract _calc_convex_hull()[source]
property size: float
Return type:

float

abstract _calc_size()[source]
Return type:

float

property x_min: float
Return type:

float

abstract _calc_x_min()[source]
Return type:

float

property x_max: float
Return type:

float

abstract _calc_x_max()[source]
Return type:

float

property y_min: float
Return type:

float

abstract _calc_y_min()[source]
Return type:

float

property y_max: float
Return type:

float

abstract _calc_y_max()[source]
Return type:

float

property z_min: float
Return type:

float

abstract _calc_z_min()[source]
Return type:

float

property z_max: float
Return type:

float

abstract _calc_z_max()[source]
Return type:

float

class ed.shape.RightPrism(convex_hull, z_min, z_max)[source]

Bases: Shape

Represents a right prism, i.e., a prism in which the joining edges and faces are perpendicular to the base faces. This is typical for the shapes resulting from the convex hull, z min and z max of EntityInfo

Constructor

Parameters:
  • convex_hull (List[PyKDL.Vector]) – list with vectors representing the vertices of the convex hull. N.B.: these should only contain x and y values, the z-values are not relevant (the height information is contained in the z_min and z_max parameters).

  • z_min (float) – Minimum height [m] w.r.t. the center of the corresponding Entity

  • z_max (float) – Maximum height [m] w.r.t. the center of the corresponding Entity

_convex_hull
_z_min
_z_max
_calc_x_max()[source]
Return type:

float

_calc_x_min()[source]
Return type:

float

_calc_y_max()[source]
Return type:

float

_calc_y_min()[source]
Return type:

float

_calc_z_max()[source]
Return type:

float

_calc_z_min()[source]
Return type:

float

_calc_convex_hull()[source]
Return type:

List[PyKDL.Vector]

_calc_size()[source]

Calculate the rough size of a shape >>> RightPrism([kdl.Vector(0, 0, 0), kdl.Vector(0, 1, 0), kdl.Vector(1, 1, 0), kdl.Vector(1, 0, 0)], z_min=0, z_max=1).size 1.0 >>> RightPrism([kdl.Vector(0, 0, 0), kdl.Vector(0, 2, 0), kdl.Vector(2, 2, 0), kdl.Vector(2, 0, 0)], z_min=0, z_max=2).size 8.0

Return type:

float

ed.shape.shape_from_entity_info(e)[source]

Creates a shape from the convex_hull, z_min and z_max of the EntityInfo object. If no convex hull is present, an empty Shape object is returned

Parameters:

e (ed_msgs.msg.EntityInfo) – ed_msgs.msg.EntityInfo

Returns:

Shape

Return type:

Shape