Пример #1
0
    def __init__(self, channel='KINECT_FRAME', scale=1., 
                 extract_rgb=True, extract_depth=True, extract_X=True, bgr=True, every_k_frames=1):
        Decoder.__init__(self, channel=channel, every_k_frames=every_k_frames)
        self.skip = int(1.0 / scale);
        
        assert (self.skip >= 1)
        self.extract_rgb = extract_rgb
        self.extract_depth = extract_depth    
        self.extract_X = extract_X
        self.bgr = bgr

        from kinect.frame_msg_t import frame_msg_t 
        from kinect.image_msg_t import image_msg_t
        from kinect.depth_msg_t import depth_msg_t
        
        self.frame_msg_t_ = frame_msg_t
        self.image_msg_t_ = image_msg_t
        self.depth_msg_t_ = depth_msg_t
        
        # from openni.frame_msg_t import frame_msg_t as self.frame_msg_t_
        # from openni.image_msg_t import image_msg_t as self.image_msg_t_
        # from openni.depth_msg_t import depth_msg_t as self.depth_msg_t_
                
        if self.extract_X: 
            K = construct_K(**KinectDecoder.kinect_params)
            self.camera = DepthCamera(K=K, shape=(480,640), skip=self.skip)
Пример #2
0
 def __init__(self,
              channel='/camera/rgb/image_raw',
              every_k_frames=1,
              scale=1.,
              encoding='bgr8',
              compressed=False):
     Decoder.__init__(self, channel=channel, every_k_frames=every_k_frames)
     self.scale = scale
     self.encoding = encoding
     self.bridge = CvBridge()
     self.compressed = compressed
Пример #3
0
    def __init__(self,
                 channel='/scan',
                 every_k_frames=1,
                 range_min=0.0,
                 range_max=np.inf):
        Decoder.__init__(self, channel=channel, every_k_frames=every_k_frames)

        self.angle_min_ = 0.0
        self.angle_max_ = 0.0
        self.range_min_ = range_min
        self.range_max_ = range_max
        self.cos_sin_map_ = np.array([[]])
Пример #4
0
def PoseStampedMsgDecoder(channel, every_k_frames=1):
    def odom_decode(data):
        tvec, ori = data.pose.position, data.pose.orientation
        return RigidTransform(xyzw=[ori.x, ori.y, ori.z, ori.w],
                              tvec=[tvec.x, tvec.y, tvec.z])

    return Decoder(channel=channel,
                   every_k_frames=every_k_frames,
                   decode_cb=lambda data: odom_decode(data))
Пример #5
0
 def __init__(self, channel='CAMERA', scale=1., every_k_frames=1): 
     Decoder.__init__(self, channel=channel, every_k_frames=every_k_frames)
     self.scale = scale
Пример #6
0
 def __init__(self, channel='POSE', every_k_frames=1): 
     Decoder.__init__(self, channel=channel, every_k_frames=every_k_frames)
Пример #7
0
 def __init__(self, channel='MICROSTRAIN_INS'): 
     Decoder.__init__(self, channel=channel)
     from microstrain import ins_t 
     self.ins_t_decode_ = lambda data : ins_t.decode(data)
Пример #8
0
 def __init__(self, channel='PARAM_UPDATE', every_k_frames=1): 
     Decoder.__init__(self, channel=channel, every_k_frames=every_k_frames)
Пример #9
0
 def __init__(self, channel='/camera/rgb/camera_info'):
     Decoder.__init__(self, channel=channel)
Пример #10
0
 def __init__(self, every_k_frames=1):
     Decoder.__init__(self,
                      channel='/gazebo/model_states',
                      every_k_frames=every_k_frames)
     self.__gazebo_index = None
Пример #11
0
 def __init__(self, channel='/tf', every_k_frames=1):
     Decoder.__init__(self, channel=channel, every_k_frames=every_k_frames)
     self.pub_ = None
Пример #12
0
 def __init__(self,
              channel='/vehicle/sonar_cloud',
              every_k_frames=1,
              remove_nans=True):
     Decoder.__init__(self, channel=channel, every_k_frames=every_k_frames)
     self.remove_nans_ = remove_nans