Example #1
0
    def define_jobs_context(self, context):
        rm = context.get_report_manager()
        rm.set_html_resources_prefix('jbds-nav')

        logs = set(self.get_explogs_by_tag('navigation'))
        logs = list(logs)
        assert len(logs) >= 4

        data_central = self.get_data_central()
        recipe_episodeready_by_convert2(context, data_central.get_boot_root())
        recipe_navigation_map1(context, data_central)
        
        for c, id_explog in iterate_context_explogs(context, logs):
            explog = get_conftools_explogs().instance(id_explog)
            # Get the map that we need
            annotation_navigation = explog.get_annotations()['navigation'] 
            id_explog_map = annotation_navigation['map']
            id_robot = annotation_navigation['robot']
#             if not 'params' in annotation_navigation:
#                 self.error('incomplete %r' % id_explog)
#                 continue
            navigation_params = annotation_navigation['params']
                    
            nmap = c.get_resource(RP_NAVIGATION_MAP,
                                  id_episode=id_explog_map,
                                  id_robot=id_robot)
            
            out_base = os.path.join(c.get_output_dir(), '%s' % id_explog)
            c.comp_config(reconstruct_servo_state, id_explog, id_robot, nmap,
                          out_base=out_base,
                          navigation_params=navigation_params,
                          job_id='reconstruct')        
            
            extra_dep = [c.get_resource(RM_EPISODE_READY, id_robot=id_robot,
                                        id_episode=id_explog)]
            nmap_dist = c.comp_config(nmap_distances, data_central,
                                                id_episode=id_explog,
                                                id_robot=id_robot, nmap=nmap,
                                                extra_dep=extra_dep)
            
            report_keys = dict(id_robot=id_robot, id_episode=id_explog,
                               id_episode_map=id_explog_map)
            r = c.comp(report_nmap_distances, nmap, nmap_dist)
            c.add_report(r, 'nmap_distances', **report_keys)
            
            ep = c.get_resource(RM_EPISODE_READY,
                                id_episode=id_explog, id_robot=id_robot)
            poses = c.comp_config(poses_from_episode, data_central=data_central,
                                  id_robot=id_robot, id_episode=id_explog,
                                  extra_dep=[ep])
            
            ep0 = c.get_resource(RM_EPISODE_READY,
                                 id_episode=id_explog_map, id_robot=id_robot)
            poses0 = c.comp_config(poses_from_episode, data_central=data_central,
                                  id_robot=id_robot, id_episode=id_explog_map,
                                  extra_dep=[ep0])
             
            r = c.comp(report_trajectory, poses, poses0)
            c.add_report(r, 'trajectory', **report_keys)
Example #2
0
 def go(self):
     files = self.options.get_extra()
     
     from collections import defaultdict
     seen = defaultdict(list)
     for f in files:
         seen[os.path.basename(f)].append(f)
         
     for _, names in seen.items():
         if len(names) > 1:
             self.error('Same file in multiple places:\n' + 
                        '\n'.join('- %s' % f for f in names))
     
     def consider(f):
         for ext in ['.mp4.timestamps', '.orig.bag', '.yaml',
                     '.index_cache']:
             if ext in f:
                 return False
         return True
     files = filter(consider, files)
     known_files = {}
     
     # for all explogs that we know
     explogs_library = get_conftools_explogs()
     explogs_library.make_sure_everything_read()
     
     explogs_library.print_summary(sys.stdout)
     for id_explog in explogs_library:
         explog = explogs_library.instance(id_explog)
         for what, filename in explog.get_files().items():  # @UnusedVariable
             known_files[filename] = id_explog
             if not os.path.exists(filename):
                 self.error('%s: File not found  %s: %s' % 
                            (id_explog, what, filename))
             if not id_explog in filename:
                 self.error('%s: strange filename %s' % 
                            (id_explog, filename))
     for f in sorted(files):
         if not f in known_files:
             self.error('Unclaimed file: %s' % f)
         else:
             # self.info('%s has %s' % (known_files[f], f))
             pass
Example #3
0
    def define_jobs_context(self, context):
        logs = (set(self.get_explogs_by_tag('servo')) & 
                set(self.get_explogs_by_tag('fieldsampler')))
        
        assert len(logs) >= 4
        
        for c, id_explog in iterate_context_explogs(context, logs):
            explog = get_conftools_explogs().instance(id_explog)

            # jobs_video_servo_multi(c, id_explog)

            annotation_servo = explog.get_annotations()['servo'] 
            id_robot = annotation_servo['robot']
            goal_at = annotation_servo['goal']
                    
            out_base = os.path.join(c.get_output_dir(), '%s' % id_explog)
            
            c.comp_config(reconstruct_servo_state_nomap,
                          id_explog, id_robot, out_base, goal_at=goal_at)
Example #4
0
from comptests.registrar import comptests_for_all
from rosstream2boot import (get_conftools_robot_adapters, get_conftools_explogs,
    get_conftools_cmd_adapters, get_conftools_obs_adapters)



for_all_robot_adapters = comptests_for_all(get_conftools_robot_adapters())
for_all_obs_adapters = comptests_for_all(get_conftools_obs_adapters())
for_all_cmd_adapters = comptests_for_all(get_conftools_cmd_adapters())
for_all_explogs = comptests_for_all(get_conftools_explogs())

print('loaded tests')


@for_all_robot_adapters
def check_robot_adapter(id_ob, ob):
    pass

@for_all_obs_adapters
def check_obs_adapter(id_ob, ob):
    pass

@for_all_cmd_adapters
def check_cmd_adapter(id_ob, ob):
    pass

@for_all_explogs
def check_explog(id_ob, ob):
    pass