コード例 #1
0
ファイル: vctFrameTest.py プロジェクト: Shuyoung/cisst
 def TestTranslationModification(self):
     """Test translation modification."""
     frame = vctFrm3()
     translation = frame.Translation()
     translation.fill(10.0)
     translationOtherRef = frame.Translation()
     translationsAreEqual = (translation == translationOtherRef).all()
     self.failUnless(translationsAreEqual)
コード例 #2
0
 def TestTranslationModification(self):
     """Test translation modification."""
     frame = vctFrm3()
     translation = frame.Translation()
     translation.fill(10.0)
     translationOtherRef = frame.Translation()
     translationsAreEqual = (translation == translationOtherRef).all()
     self.failUnless(translationsAreEqual)
コード例 #3
0
ファイル: vctFrameTest.py プロジェクト: Shuyoung/cisst
 def TestCreation(self):
     """Test default constructor."""
     frame = vctFrm3()
     translation = frame.Translation()
     translationIsZero = (self.ZeroTranslation == translation).all()
     self.failUnless(translationIsZero)
     rotation = frame.Rotation()
     rotationIsIdentity = (self.IdentityRotation == rotation).all()
     self.failUnless(rotationIsIdentity)
コード例 #4
0
 def TestCreation(self):
     """Test default constructor."""
     frame = vctFrm3()
     translation = frame.Translation()
     translationIsZero = (self.ZeroTranslation == translation).all()
     self.failUnless(translationIsZero)
     rotation = frame.Rotation()
     rotationIsIdentity = (self.IdentityRotation == rotation).all()
     self.failUnless(rotationIsIdentity)
コード例 #5
0
ファイル: vctFrameTest.py プロジェクト: Shuyoung/cisst
 def TestRotationModification(self):
     """Test translation modification."""
     frame = vctFrm3()
     rotation = frame.Rotation()
     rotation[0, 0] = 0.0
     rotation[0, 1] = -1.0
     rotation[1, 0] = 1.0
     rotation[1, 1] = 0.0
     rotationOtherRef = frame.Rotation()
     rotationsAreEqual = (rotation == rotationOtherRef).all()
     self.failUnless(rotationsAreEqual)
     self.failUnless(numpy.linalg.det(rotation) == 1.0)
コード例 #6
0
 def TestRotationModification(self):
     """Test translation modification."""
     frame = vctFrm3()
     rotation = frame.Rotation()
     rotation[0, 0] = 0.0
     rotation[0, 1] = -1.0
     rotation[1, 0] = 1.0
     rotation[1, 1] = 0.0
     rotationOtherRef = frame.Rotation()
     rotationsAreEqual = (rotation == rotationOtherRef).all()
     self.failUnless(rotationsAreEqual)
     self.failUnless(numpy.linalg.det(rotation) == 1.0)
コード例 #7
0
#from copy import *

""" get the path of the kinematics .rob file """
pathTest = os.path.abspath(os.path.dirname(__file__))
filePath = pathTest + '/dvpsm.rob'
print filePath

""" Generate an instance of the robManipulator class """
""" Load the robot kinematics file by passing the .rob path"""
psm_manip = robManipulator()
result = psm_manip.LoadRobot(filePath);
#print result

""" cisstVector test """
""" generate an empty transformation, initialize the rotation and translation """
frame = vctFrm3()
inverseFrame = vctFrm3()

rotation = frame.Rotation()
rotation[0, 0] = 1.0
rotation[1, 1] = 1.0
rotation[2, 2] = 1.0
translation =  frame.Translation()
translation[0] = 2.0
translation[1] = 1.0
translation[2] = 3.0

""" set the print options of np type matrices and arrays """
np.set_printoptions(precision=4,suppress=True)