robots.poses package¶
robots.poses.position module¶
-
class
robots.poses.position.
PoseManager
(robot)[source]¶ Bases:
object
A pose is for us a dict
{'x':x, 'y':y, 'z':z, 'qx':qx, 'qy':qy, 'qz':qz, 'qw':qw, 'frame':frame}
, ie a (x, y, z) cartesian pose in meter interpreted in a specific reference frame, and a quaternion describing the orientation of the object in radians.This class helps with:
- converting from other convention to our convention,
- converting back to other conventions.
-
angular_distance
(angle1, angle2)[source]¶ Returns the (minimal, oriented) angular distance between two angles after normalization on the unit circle.
Angles are assumed to be radians.
The result is oriented (from angle1 to angle2) and guaranteed to be in range ]-pi, pi].
-
distance
(pose1, pose2='base_link')[source]¶ Returns the euclidian distance between two pyRobots poses.
If the second pose is omitted, “base_link” is assumed (ie, distance between a pose and the robot itself).
-
get
(raw)[source]¶ takes a loosly defined ‘pose’ as input and returns a properly formatted and normalized pose.
- Input may be:
- a frame
- an incomplete pose dictionary
- a list or tuple (x,y,z), (x,y,z,frame) or (z,y,z,rx,ry,rz) or (x,y,z,qx,qy,qz,qw)
-
inframe
(pose, frame)[source]¶ Transform a pose from one frame to another one.
Uses transformation matrices. Could be refactored to use directly quaternions.
-
static
isin
(point, polygon)[source]¶ Determines if a 2D point is inside a given 2D polygon or not.
Parameters: - point – a (x,y) pair
- polygon – a list of (x,y) pairs.
Copied from: http://www.ariel.com.au/a/python-point-int-poly.html
robots.poses.ros_positions module¶
-
class
robots.poses.ros_positions.
ROSFrames
[source]¶