|
@@ -17,6 +17,8 @@ key1 = 'pjibot/'
|
|
sleep_time = 2 # 每多少秒扫描一次
|
|
sleep_time = 2 # 每多少秒扫描一次
|
|
|
|
|
|
error_bag_json = "/mnt/disk001/dcl_data_process/src/python2/pjibot/camera-errorBag.json"
|
|
error_bag_json = "/mnt/disk001/dcl_data_process/src/python2/pjibot/camera-errorBag.json"
|
|
|
|
+
|
|
|
|
+
|
|
def parse_json_to_string_array(file_path):
|
|
def parse_json_to_string_array(file_path):
|
|
try:
|
|
try:
|
|
# 打开并读取JSON文件(Python 2中不支持encoding参数,需要使用codecs模块或处理文件读取后的编码)
|
|
# 打开并读取JSON文件(Python 2中不支持encoding参数,需要使用codecs模块或处理文件读取后的编码)
|
|
@@ -56,6 +58,7 @@ def list_to_json_file(data, file_path):
|
|
# 将UTF-8编码的JSON字符串写入文件
|
|
# 将UTF-8编码的JSON字符串写入文件
|
|
file.write(json_data_utf8)
|
|
file.write(json_data_utf8)
|
|
|
|
|
|
|
|
+
|
|
def parse_to_mp4(merged_bag_file_path, parse_prefix, local_parse_dir, local_delete_list):
|
|
def parse_to_mp4(merged_bag_file_path, parse_prefix, local_parse_dir, local_delete_list):
|
|
try:
|
|
try:
|
|
local_mp4_dir1 = parse_pji_image.parse1('/ob_camera_01/color/image_raw', merged_bag_file_path,
|
|
local_mp4_dir1 = parse_pji_image.parse1('/ob_camera_01/color/image_raw', merged_bag_file_path,
|
|
@@ -124,7 +127,7 @@ if __name__ == '__main__':
|
|
error_bag_list = parse_json_to_string_array(error_bag_json)
|
|
error_bag_list = parse_json_to_string_array(error_bag_json)
|
|
if parse_prefix_full in error_bag_list:
|
|
if parse_prefix_full in error_bag_list:
|
|
continue
|
|
continue
|
|
- logging.info(merged_bag_object_key,"等待处理到:",parse_prefix_full)
|
|
|
|
|
|
+ logging.info(str(merged_bag_object_key), "等待处理到:", str(parse_prefix_full))
|
|
local_merged_bag_path = path1 + 'camera/' + merged_bag_object_key
|
|
local_merged_bag_path = path1 + 'camera/' + merged_bag_object_key
|
|
local_merged_dir = '/'.join(local_merged_bag_path.split('/')[:-1])
|
|
local_merged_dir = '/'.join(local_merged_bag_path.split('/')[:-1])
|
|
local_parse_dir = local_merged_dir.replace('data_merge', 'data_parse')
|
|
local_parse_dir = local_merged_dir.replace('data_merge', 'data_parse')
|