Example #1
0
    def __init__(self, flydra_calib, laser_pkl, undistort_flydra_points, visualize):

        self.flydra_calib = flydra_calib
        self.laser_pkl = laser_pkl
        self.undistort_flydra_points = undistort_flydra_points
        self.visualize = visualize

        # make sure the flydra cameras have associated calibration information. We might
        # not actually use the undistorted points (depends on the --undistort argument)
        name_map = MultiCalSelfCam.get_camera_names_map(self.flydra_calib)
        for c in MultiCalSelfCam.read_calibration_names(self.flydra_calib):
            camera_calibration_yaml_to_radfile(
                decode_url("package://flycave/calibration/cameras/%s.yaml" % c),
                os.path.join(self.flydra_calib, name_map[c]),
            )

        # publish the camera positions and the inlier set from the flydra calibraion
        MultiCalSelfCam.publish_calibration_points(self.flydra_calib, topic_base="/flydra")

        print "*" * 80
        print "loaded original calibration from", self.flydra_calib
        print "*" * 80

        self.fly = flydra.reconstruct.Reconstructor(cal_source=self.flydra_calib)

        self.laser = AllPointPickle()

        # load default laser points
        self.load_laser_points()
Example #2
0
    def __init__(self, flydra_calib, laser_pkl, undistort_flydra_points, visualize):

        self.flydra_calib = flydra_calib
        self.laser_pkl = laser_pkl
        self.undistort_flydra_points = undistort_flydra_points
        self.visualize = visualize

        #make sure the flydra cameras have associated calibration information. We might
        #not actually use the undistorted points (depends on the --undistort argument)
        name_map = MultiCalSelfCam.get_camera_names_map(self.flydra_calib)
        for c in MultiCalSelfCam.read_calibration_names(self.flydra_calib):
            camera_calibration_yaml_to_radfile(
                    decode_url('package://flycave/calibration/cameras/%s.yaml' % c),
                    os.path.join(self.flydra_calib,name_map[c]))

        #publish the camera positions and the inlier set from the flydra calibraion
        MultiCalSelfCam.publish_calibration_points(self.flydra_calib, topic_base='/flydra')

        print '*'*80
        print 'loaded original calibration from', self.flydra_calib
        print '*'*80

        self.fly = flydra.reconstruct.Reconstructor(cal_source=self.flydra_calib)

        self.laser = AllPointPickle()

        #load default laser points
        self.load_laser_points()
Example #3
0
def test_formats():
    
    urlyaml = io.decode_url('package://motmot_ros_utils/tests/Basler_21029383.yaml')
    urlrad = io.decode_url('package://motmot_ros_utils/tests/Basler_21029383.rad')

    rad = '/tmp/test.rad'
    formats.camera_calibration_yaml_to_radfile(urlyaml, rad)
    assert open(urlrad,'r').read() == open(rad,'r').read()