German Larrain avatar German Larrain committed cda1224

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

Comments (0)

Files changed (1)

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)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.