コード例 #1
0
ファイル: camera.py プロジェクト: RGrant92/Klampt
 def matrix(self):
     o = orientation_matrix(*self.ori)
     Ry = so3.rotation([0.,1.,0.],self.rot[0])
     Rx = so3.rotation([1.,0.,0.],self.rot[1])
     Rz = so3.rotation([0.,0.,1.],self.rot[2])
     R = so3.mul(Ry,so3.mul(Rx,Rz))
     R = so3.mul(o,R);
     raise (R,so3.apply(o,self.pos))
コード例 #2
0
 def matrix(self):
     """Returns the camera transform."""
     o = orientation_matrix(*self.ori)
     Ry = so3.rotation([0.,1.,0.],self.rot[0])
     Rx = so3.rotation([1.,0.,0.],self.rot[1])
     Rz = so3.rotation([0.,0.,1.],self.rot[2])
     R = so3.mul(Ry,so3.mul(Rx,Rz))
     R = so3.mul(o,R);
     raise (R,so3.apply(o,self.pos))
コード例 #3
0
 def matrix(self):
     """Returns the camera transform."""
     o = orientation_matrix(*self.ori)
     Ry = so3.rotation([0., 1., 0.], self.rot[0])
     Rx = so3.rotation([1., 0., 0.], self.rot[1])
     Rz = so3.rotation([0., 0., 1.], self.rot[2])
     R = so3.mul(Ry, so3.mul(Rx, Rz))
     R = so3.mul(o, R)
     raise (R, so3.apply(o, self.pos))
コード例 #4
0
ファイル: camera.py プロジェクト: RGrant92/Klampt
    def matrix(self):
        o = orientation_matrix(*self.ori)
        Ry = so3.rotation([0.,1.,0.],self.rot[0])
        Rx = so3.rotation([1.,0.,0.],self.rot[1])
        Rz = so3.rotation([0.,0.,1.],self.rot[2])
        R = so3.mul(Ry,so3.mul(Rx,Rz))
        R = so3.mul(o,R);

        t = so3.apply(R,self.tgt)
        return (R,vectorops.madd(t,[0.,0.,1.],-self.dist))
コード例 #5
0
    def matrix(self):
        """Returns the camera transform."""
        o = orientation_matrix(*self.ori)
        Ry = so3.rotation([0., 1., 0.], self.rot[0])
        Rx = so3.rotation([1., 0., 0.], self.rot[1])
        Rz = so3.rotation([0., 0., 1.], self.rot[2])
        R = so3.mul(Ry, so3.mul(Rx, Rz))
        R = so3.mul(o, R)

        t = so3.apply(R, self.tgt)
        return (R, vectorops.madd(t, [0., 0., 1.], -self.dist))
コード例 #6
0
 def rotationCoordinates(self):
     """Returns the SO(3) coordinates that rotate elements from the source
     to the destination Frame"""
     if self._destination == None:
         return self._source.worldRotation()
     return so3.mul(so3.inv(self._destination.worldRotation()),
                    self._source.worldRotation())
コード例 #7
0
ファイル: trajectory.py プロジェクト: paperstiger/Klampt
	def preTransform(self,R):
		"""Premultiplies every rotation in here by the so3 element
		R. In other words, if R rotates a local frame F to frame F',
		this method converts this SO3Trajectory from coordinates in F
		to coordinates in F'"""
		for i,m in enumerate(self.milestones):
			self.milestones[i] = so3.mul(R,m)
コード例 #8
0
ファイル: se3.py プロジェクト: pradeepr-roboticist/Klampt
def mul(T1, T2):
    """Composes two transformations."""
    (R1, t1) = T1
    (R2, t2) = T2
    R = so3.mul(R1, R2)
    t = apply(T1, t2)
    return (R, t)
コード例 #9
0
ファイル: se3.py プロジェクト: victor8733/Klampt
def mul(T1,T2):
    """Composes two transformations."""
    (R1,t1) = T1
    (R2,t2) = T2
    R = so3.mul(R1,R2)
    t = vectorops.add(so3.apply(R1,t2),t1)
    return (R,t)
コード例 #10
0
ファイル: se3.py プロジェクト: krishauser/Klampt
def mul(T1,T2):
    """Composes two transformations."""
    (R1,t1) = T1
    (R2,t2) = T2
    R = so3.mul(R1,R2)
    t = vectorops.add(so3.apply(R1,t2),t1)
    return (R,t)
コード例 #11
0
ファイル: se3.py プロジェクト: Aand1/pyOptimalMotionPlanning
def mul(T1,T2):
    """Composes two transformations."""
    (R1,t1) = T1
    (R2,t2) = T2
    R = so3.mul(R1,R2)
    t = apply(T1,t2)
    return (R,t)
コード例 #12
0
ファイル: geodesic.py プロジェクト: arocchi/Klampt
 def integrate(self,x,d):
     w = [d[0],d[4],d[8]]
     return so3.mul(x,so3.from_moment(w))
コード例 #13
0
ファイル: coordinates.py プロジェクト: arocchi/Klampt
 def rotationCoordinates(self):
     """Returns the SO(3) coordinates that rotate elements from the source
     to the destination Frame"""
     if self._destination==None:
         return self._source.worldRotation()
     return so3.mul(so3.inv(self._destination.worldRotation()),self._source.worldRotation())
コード例 #14
0
 def integrate(self, x, d):
     w = [d[0], d[4], d[8]]
     return so3.mul(x, so3.from_moment(w))