Creates a RigidTransform from a ROS pose msg. 
        
        Parameters
        ----------
        pose_msg : :obj:`geometry_msgs.msg.Pose`
            ROS pose message
767049
def from_ros_pose_msg(pose_msg,
                          from_frame='unassigned',
                          to_frame='world'):
        
        quaternion = np.array([pose_msg.orientation.w,
                               pose_msg.orientation.x,
                               pose_msg.orientation.y,
                               pose_msg.orientation.z])
        position = np.array([pose_msg.position.x,
                             pose_msg.position.y,
                             pose_msg.position.z])
        pose = RigidTransform(rotation=quaternion,
                              translation=position,
                              from_frame=from_frame,
                              to_frame=to_frame)
        return pose
355732
public static void reproject( CoordinateReferenceSystem from, CoordinateReferenceSystem to, Object[] geometries )
            throws Exception {
        MathTransform mathTransform = CRS.findMathTransform(from, to);

        for( int i = 0; i < geometries.length; i++ ) {
            geometries[i] = JTS.transform((Geometry) geometries[i], mathTransform);
        }
    }
62102
def from_dict(cls, message):
        """"""

        message_options = message.copy()

        # JSON don't like datetimes.
        eta = message_options.get('task_args', {}).get('eta')
        if eta:
            from datetime import datetime

            message_options['task_args']['eta'] = datetime.fromtimestamp(eta)

        return Message(**message_options)
382194
def inverse(self):
        
        inv_rotation = self.rotation.T
        inv_translation = np.dot(-self.rotation.T, self.translation)
        return RigidTransform(inv_rotation, inv_translation,
                              from_frame=self._to_frame,
                              to_frame=self._from_frame)
359056
def from_message(cls, message):
        
        type_ = message.get_text()
        return cls(type_=type_, blob=message.asbytes())
250546
def unpack_message(buffer):
    
    hdr_size = Header().get_size()
    hdr_buff, msg_buff = buffer[:hdr_size], buffer[hdr_size:]
    header = Header()
    header.unpack(hdr_buff)
    message = new_message_from_header(header)
    message.unpack(msg_buff)
    return message
793933
def translate(self, pos):
        
        self.matrix = np.dot(self.matrix, transforms.translate(pos[0, :3]))
376712
def _depth_im_from_pointcloud(self, msg):
        
        # set format
        if self._format is None:
            self._set_format(msg)

        # rescale camera intr in case binning is turned on
        if msg.height != self._camera_intr.height:
            rescale_factor = float(msg.height) / self._camera_intr.height
            self._camera_intr = self._camera_intr.resize(rescale_factor)
            
        # read num points
        num_points = msg.height * msg.width
            
        # read buffer
        raw_tup = struct.Struct(self._format).unpack_from(msg.data, 0)
        raw_arr = np.array(raw_tup)

        # subsample depth values and reshape
        depth_ind = 2 + 4 * np.arange(num_points)
        depth_buf = raw_arr[depth_ind]
        depth_arr = depth_buf.reshape(msg.height, msg.width)
        depth_im = DepthImage(depth_arr, frame=self._frame)

        return depth_im
505099
def message(self, message=None):
        
        if message is not None:
            self.response_model.message = message
        return self.response_model.message
794298
def copy(self):
        
        # use the geometries copy method to
        # allow them to handle references to unpickle-able objects
        geometry = {n: g.copy() for n, g in self.geometry.items()}
        # create a new scene with copied geometry and graph
        copied = Scene(geometry=geometry,
                       graph=self.graph.copy())
        return copied
725320
def _sendMessage(self, msg):
        
        if not msg:
            return
        msg = self._collapseMsg(msg)
        self.sendStatus(msg)
481304
def T_obj_camera(self):
        
        if self.stable_pose is None:
            T_obj_world = RigidTransform(from_frame='obj', to_frame='world')
        else:
            T_obj_world = self.stable_pose.T_obj_table.as_frames('obj', 'world')
        T_camera_obj = T_obj_world.inverse() * self.T_camera_world
        return T_camera_obj
889836
def rosmsg(self):
        
        from sensor_msgs.msg import CameraInfo, RegionOfInterest
        from std_msgs.msg import Header

        msg_header = Header()
        msg_header.frame_id = self._frame

        msg_roi = RegionOfInterest()
        msg_roi.x_offset = 0
        msg_roi.y_offset = 0
        msg_roi.height = 0
        msg_roi.width = 0
        msg_roi.do_rectify = 0

        msg = CameraInfo()
        msg.header = msg_header
        msg.height = self._height
        msg.width = self._width
        msg.distortion_model = 'plumb_bob'
        msg.D = [0.0, 0.0, 0.0, 0.0, 0.0]
        msg.K = [self._fx, 0.0, self._cx, 0.0, self._fy, self._cy, 0.0, 0.0, 1.0]
        msg.R = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
        msg.P = [self._fx, 0.0, self._cx, 0.0, 0.0, self._fx, self._cy, 0.0, 0.0, 0.0, 1.0, 0.0]
        msg.binning_x = 0
        msg.binning_y = 0
        msg.roi = msg_roi

        return msg
9452
def __make_innermsg(resource, rtype, ref, action=None, payload=None, limit=None):
        
        if action is not None and not isinstance(action, (tuple, list)):
            raise TypeError('action must be None/tuple/list')
        p = {M_RESOURCE: resource,
             M_TYPE: int(rtype),
             M_CLIENTREF: ref,
             # Ensure action path consists only of strings
             M_ACTION: tuple(u(element) for element in action) if action else None,
             M_PAYLOAD: payload}
        if limit is not None:  # Note: fmtted like "0/15" where 0 = offset, 15 = limit
            p[M_RANGE] = limit
        return p
773490
def create(self, msgtype, *args, **kwargs):
        ''' 

        '''
        if msgtype not in self._messages:
            raise ProtocolError("Unknown message type %r for protocol version %s" % (msgtype, self._version))
        return self._messages[msgtype].create(*args, **kwargs)
548702
function orthoProj_(pos, cam){
    var vec = V3.sub(pos, cam.pos);
    var camAxis = axis(cam);
    var normDist = V3.dot(vec, camAxis.y);
    var normProj = V3.scale(normDist, camAxis.y);
    var posOnPlane = V3.add(vec, V3_(-normProj.x, -normProj.y, -normProj.z));
    var x = V3.dot(posOnPlane, camAxis.x);
    var y = V3.dot(posOnPlane, camAxis.z);
    return V3_(x, y, normDist);
  }
279302
def _normal_map_callback(self, msg):
        
        try:
            self._cur_normal_map = self._bridge.imgmsg_to_cv2(msg)
        except:
            self._cur_normal_map = None