LingxinMeng hace 7 meses
padre
commit
288cd039c1

+ 7 - 5
src/python2/pjibot_delivery/simulation-pjibot_delivery.py

@@ -8,11 +8,11 @@ import docker
 import logging
 
 key1 = 'pjibot_delivery/'
-path1 = '/scenarios3/'
+path1 = '/scenarios1/'
 path2 = '/mnt/disk001/dcl_data_process/src/python2/pjibot_delivery/'
 path3 = '/mnt/disk001/dcl_data_process/src/python2/pjibot_delivery/resource/'
 vehicle_name = 'PuJin_distribution'  # 配送 PuJin_distribution 巡检 PuJin_patrol_robot
-
+xoscName = 'scenario.xosc'
 logging.basicConfig(filename=path2 + 'log/simulation.log', level=logging.INFO,
                     format='%(asctime)s - %(levelname)s - %(message)s')
 
@@ -72,7 +72,9 @@ def move_xosc_before_simulation(root_path):
 
 def upload_simulation(parse_prefix, mp41):
     try:
+        # 上传两次吧,对应上
         bucket.put_object_from_file(parse_prefix + 'scenario_orig.mp4', mp41)
+        bucket.put_object_from_file(parse_prefix + 'scenario_hmi.mp4', mp41)
         logging.info('上传仿真视频到 %s' % parse_prefix + 'scenario_orig.mp4')
         shutil.rmtree(path1)  # 仿真完就删除
     except Exception as e:
@@ -91,7 +93,7 @@ def simulation(parse_prefix, mp41):
             run = False
             # 打印容器列表
             for container in containers:
-                if 'vtd3' == container.name:
+                if 'vtd1' == container.name:
                     run = True
                     break
             if not run:
@@ -145,7 +147,7 @@ if __name__ == '__main__':
                         xosc_done = False
                         mp4_done = False
                         for obj3 in oss2.ObjectIterator(bucket, prefix=str(parse_prefix_full)):
-                            if '/simulation.xosc' in str(obj3.key):
+                            if xoscName in str(obj3.key):
                                 xosc_done = True
                             if '/scenario_orig.mp4' in str(obj3.key):
                                 mp4_done = True
@@ -162,7 +164,7 @@ if __name__ == '__main__':
                         root_path1 = local_dir_full + 'orig/'
                         if not os.path.exists(root_path1):
                             os.makedirs(root_path1)
-                        bucket.get_object_to_file(parse_prefix_full + 'simulation.xosc', root_path1 + 'scenario_orig.xosc')
+                        bucket.get_object_to_file(parse_prefix_full + xoscName, root_path1 + 'scenario_orig.xosc')
                         local_delete_list.append(root_path1 + 'scenario_orig.xosc')
                         move_xosc_before_simulation(root_path1)
                         simulation(parse_prefix_full, root_path1 + 'simulation.mp4')

+ 8 - 5
src/python2/pjibot_patrol/simulation-pjibot_partol.py

@@ -8,10 +8,11 @@ import docker
 import logging
 
 key1 = 'pjibot_patrol/'
-path1 = '/scenarios4/'
+path1 = '/scenarios2/'
 path2 = '/mnt/disk001/dcl_data_process/src/python2/pjibot_patrol/'
 path3 = '/mnt/disk001/dcl_data_process/src/python2/pjibot_patroly/resource/'
-vehicle_name = 'PuJin_distribution'  # 配送 PuJin_distribution 巡检 PuJin_patrol_robot
+vehicle_name = 'PuJin_patrol_robot'  # 配送 PuJin_distribution 巡检 PuJin_patrol_robot
+xoscName = 'scenario.xosc'
 
 logging.basicConfig(filename=path2 + 'log/simulation.log', level=logging.INFO,
                     format='%(asctime)s - %(levelname)s - %(message)s')
@@ -72,7 +73,9 @@ def move_xosc_before_simulation(root_path):
 
 def upload_simulation(parse_prefix, mp41):
     try:
+        # 上传两次吧,对应上
         bucket.put_object_from_file(parse_prefix + 'scenario_orig.mp4', mp41)
+        bucket.put_object_from_file(parse_prefix + 'scenario_hmi.mp4', mp41)
         logging.info('上传仿真视频到 %s' % parse_prefix + 'scenario_orig.mp4')
         shutil.rmtree(path1)  # 仿真完就删除
     except Exception as e:
@@ -91,7 +94,7 @@ def simulation(parse_prefix, mp41):
             run = False
             # 打印容器列表
             for container in containers:
-                if 'vtd4' == container.name:
+                if 'vtd2' == container.name:
                     run = True
                     break
             if not run:
@@ -145,7 +148,7 @@ if __name__ == '__main__':
                         xosc_done = False
                         mp4_done = False
                         for obj3 in oss2.ObjectIterator(bucket, prefix=str(parse_prefix_full)):
-                            if '/simulation.xosc' in str(obj3.key):
+                            if xoscName in str(obj3.key):
                                 xosc_done = True
                             if '/scenario_orig.mp4' in str(obj3.key):
                                 mp4_done = True
@@ -162,7 +165,7 @@ if __name__ == '__main__':
                         root_path1 = local_dir_full + 'orig/'
                         if not os.path.exists(root_path1):
                             os.makedirs(root_path1)
-                        bucket.get_object_to_file(parse_prefix_full + 'simulation.xosc', root_path1 + 'scenario_orig.xosc')
+                        bucket.get_object_to_file(parse_prefix_full + xoscName, root_path1 + 'scenario_orig.xosc')
                         local_delete_list.append(root_path1 + 'scenario_orig.xosc')
                         move_xosc_before_simulation(root_path1)
                         simulation(parse_prefix_full, root_path1 + 'simulation.mp4')