Commits

German Larrain  committed cda1224

utils.geometry.Transform: set 'object' as its parent class; changed constructor.

  • Participants
  • Parent commits 885951b
  • Branches dev-utils

Comments (0)

Files changed (1)

File ars/utils/geometry.py

 	return rpy_1, rpy_2, rpy_3
 
 
-class Transform:
+class Transform(object):
 	"""Represents a homogeneus transform, i.e. a size-4 square matrix which
 	eases the transformation of a vector from one frame of reference into
 	another by being linear in the R^4 space. Thus 'new_vec = T * vec', where
 
 	"""
 
-	def __init__(self, position, rot_matrix):
+	def __init__(self, position=None, rot_matrix=None):
 		"""
-		position: a 3-tuple
-		rot_matrix: a 9-tuple
+		position: a 3-tuple (optional)
+		rot_matrix: a 9-tuple (optional)
+
 		"""
-		if not rot_matrix:
+		#TODO: position as vector
+		#TODO: rot_matrix as Matrix, Matrix3, RotationMatrix
+		if not position:  # empty or None
+			position = (0,0,0)
+
+		if not rot_matrix:  # empty or None
 			rot_matrix = []
 			rot_matrix[0:3] = (1,0,0)
 			rot_matrix[3:6] = (0,1,0)