LingxinMeng 9 tháng trước cách đây
mục cha
commit
f5976b126e

+ 6 - 0
src/python2/pjibot_delivery/simulation-nohup.sh

@@ -1,2 +1,8 @@
 #!/bin/bash
+if [ ! -d "./log" ]; then
+    mkdir "./log"
+    echo "Directory './log' created."
+else
+    echo "Directory './log' already exists."
+fi
 nohup python2 simulation.py > log/simulation.out 2>&1 &

+ 3 - 2
src/python2/pjibot_delivery/simulation.py

@@ -11,6 +11,7 @@ key1 = 'pjibot_delivery/'
 path1 = '/scenarios3/'
 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
 
 logging.basicConfig(filename=path2 + 'log/simulation.log', level=logging.INFO,
                     format='%(asctime)s - %(levelname)s - %(message)s')
@@ -62,7 +63,7 @@ def move_xosc_before_simulation(root_path):
                     if node1.get("name") == 'Ego':
                         for node2 in node1:
                             if node2.tag == 'Vehicle':
-                                node2.set('name', 'Pji_Utility_Vehicle')
+                                node2.set('name', vehicle_name)
         tree1.write(root_path + 'openx0.xosc')
 
     except Exception as e:
@@ -73,7 +74,7 @@ def upload_simulation(parse_prefix, mp41):
     try:
         bucket.put_object_from_file(parse_prefix + 'scenario_orig.mp4', mp41)
         logging.info('上传仿真视频到 %s' % parse_prefix + 'scenario_orig.mp4')
-        shutil.rmtree(path1) # 仿真完就删除
+        shutil.rmtree(path1)  # 仿真完就删除
     except Exception as e:
         logging.exception("上传视频报错 %s" % str(e))