cpp
This commit is contained in:
		
							parent
							
								
									22924f4583
								
							
						
					
					
						commit
						7cabbbd29a
					
				| @ -273,7 +273,7 @@ JUDGE_SDK_API int JUDGE_SDK_METHOD autoServiceSetBasePoint(const char* data, int | |||||||
|  * 参数: data: 场地模型信息, json字符串; length: 字符串长度 |  * 参数: data: 场地模型信息, json字符串; length: 字符串长度 | ||||||
|  * 返回值: 调用执行结果错误码, 0: 成功, 其他: 失败 |  * 返回值: 调用执行结果错误码, 0: 成功, 其他: 失败 | ||||||
|  */ |  */ | ||||||
| JUDGE_SDK_API int JUDGE_SDK_METHOD autoServiceSetFeildModel(const char* data, int length); | JUDGE_SDK_API int JUDGE_SDK_METHOD autoServiceSetFieldModel(const char* data, int length); | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  * 说明: 设置教学点信息 |  * 说明: 设置教学点信息 | ||||||
|  | |||||||
| @ -482,9 +482,9 @@ JS_JUDGE_FUN_IMPL(autoServiceSetBasePoint) | |||||||
|     return createErrorCode(env, code); |     return createErrorCode(env, code); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| JS_JUDGE_FUN_IMPL(autoServiceSetFeildModel) | JS_JUDGE_FUN_IMPL(autoServiceSetFieldModel) | ||||||
| { | { | ||||||
|     logdebug("call js_autoServiceSetFeildModel"); |     logdebug("call js_autoServiceSetFieldModel"); | ||||||
|     size_t argc = 2; |     size_t argc = 2; | ||||||
|     napi_value args[2] = {nullptr}; |     napi_value args[2] = {nullptr}; | ||||||
| 
 | 
 | ||||||
| @ -500,7 +500,7 @@ JS_JUDGE_FUN_IMPL(autoServiceSetFeildModel) | |||||||
|         return createErrorCode(env, errorNapiArgType); |         return createErrorCode(env, errorNapiArgType); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     int code = AutomaticService::autoServiceSetFeildModel(data.c_str(), data.length()); |     int code = AutomaticService::autoServiceSetFieldModel(data.c_str(), data.length()); | ||||||
|     return createErrorCode(env, code); |     return createErrorCode(env, code); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -42,7 +42,7 @@ public: | |||||||
| 
 | 
 | ||||||
|     JS_JUDGE_FUN_DECL(autoServiceInit); |     JS_JUDGE_FUN_DECL(autoServiceInit); | ||||||
|     JS_JUDGE_FUN_DECL(autoServiceSetBasePoint); |     JS_JUDGE_FUN_DECL(autoServiceSetBasePoint); | ||||||
|     JS_JUDGE_FUN_DECL(autoServiceSetFeildModel); |     JS_JUDGE_FUN_DECL(autoServiceSetFieldModel); | ||||||
|     JS_JUDGE_FUN_DECL(autoServiceSetTeachPointInfo); |     JS_JUDGE_FUN_DECL(autoServiceSetTeachPointInfo); | ||||||
|     JS_JUDGE_FUN_DECL(autoServiceSetTeachPointParam); |     JS_JUDGE_FUN_DECL(autoServiceSetTeachPointParam); | ||||||
|     JS_JUDGE_FUN_DECL(autoServiceSetCarModel); |     JS_JUDGE_FUN_DECL(autoServiceSetCarModel); | ||||||
|  | |||||||
| @ -29,7 +29,7 @@ JS_JUDGE_API_JOIN(examJudgeMapImage); | |||||||
| JS_JUDGE_API_JOIN(examJudgeMapImageSetCallback); | JS_JUDGE_API_JOIN(examJudgeMapImageSetCallback); | ||||||
| JS_JUDGE_API_JOIN(autoServiceInit); | JS_JUDGE_API_JOIN(autoServiceInit); | ||||||
| JS_JUDGE_API_JOIN(autoServiceSetBasePoint); | JS_JUDGE_API_JOIN(autoServiceSetBasePoint); | ||||||
| JS_JUDGE_API_JOIN(autoServiceSetFeildModel); | JS_JUDGE_API_JOIN(autoServiceSetFieldModel); | ||||||
| JS_JUDGE_API_JOIN(autoServiceSetTeachPointInfo); | JS_JUDGE_API_JOIN(autoServiceSetTeachPointInfo); | ||||||
| JS_JUDGE_API_JOIN(autoServiceSetTeachPointParam); | JS_JUDGE_API_JOIN(autoServiceSetTeachPointParam); | ||||||
| JS_JUDGE_API_JOIN(autoServiceSetCarModel); | JS_JUDGE_API_JOIN(autoServiceSetCarModel); | ||||||
| @ -72,7 +72,7 @@ static napi_value JS_JUDGE_MODULE_EXPORT(napi_env env, napi_value exports) | |||||||
|                                            JS_JUDGE_CAT_DESC(examJudgeMapImageSetCallback), |                                            JS_JUDGE_CAT_DESC(examJudgeMapImageSetCallback), | ||||||
|                                            JS_JUDGE_CAT_DESC(autoServiceInit), |                                            JS_JUDGE_CAT_DESC(autoServiceInit), | ||||||
|                                            JS_JUDGE_CAT_DESC(autoServiceSetBasePoint), |                                            JS_JUDGE_CAT_DESC(autoServiceSetBasePoint), | ||||||
|                                            JS_JUDGE_CAT_DESC(autoServiceSetFeildModel), |                                            JS_JUDGE_CAT_DESC(autoServiceSetFieldModel), | ||||||
|                                            JS_JUDGE_CAT_DESC(autoServiceSetTeachPointInfo), |                                            JS_JUDGE_CAT_DESC(autoServiceSetTeachPointInfo), | ||||||
|                                            JS_JUDGE_CAT_DESC(autoServiceSetTeachPointParam), |                                            JS_JUDGE_CAT_DESC(autoServiceSetTeachPointParam), | ||||||
|                                            JS_JUDGE_CAT_DESC(autoServiceSetCarModel), |                                            JS_JUDGE_CAT_DESC(autoServiceSetCarModel), | ||||||
| @ -378,9 +378,9 @@ JUDGE_SDK_API int autoServiceSetBasePoint(const char* data, int length) | |||||||
|     return FactoryAutomaticApi->autoServiceSetBasePoint(data, length); |     return FactoryAutomaticApi->autoServiceSetBasePoint(data, length); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| JUDGE_SDK_API int autoServiceSetFeildModel(const char* data, int length) | JUDGE_SDK_API int autoServiceSetFieldModel(const char* data, int length) | ||||||
| { | { | ||||||
|     return FactoryAutomaticApi->autoServiceSetFeildModel(data, length); |     return FactoryAutomaticApi->autoServiceSetFieldModel(data, length); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| JUDGE_SDK_API int autoServiceSetTeachPointInfo(const char* data, int length) | JUDGE_SDK_API int autoServiceSetTeachPointInfo(const char* data, int length) | ||||||
|  | |||||||
| @ -54,7 +54,7 @@ int AutomaticService::autoServiceSetBasePoint(const char *data, int length) | |||||||
|     return 0; |     return 0; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int AutomaticService::autoServiceSetFeildModel(const char *data, int length) | int AutomaticService::autoServiceSetFieldModel(const char *data, int length) | ||||||
| { | { | ||||||
|     try |     try | ||||||
|     { |     { | ||||||
|  | |||||||
| @ -29,7 +29,7 @@ public: | |||||||
| 
 | 
 | ||||||
|     virtual int autoServiceInit() override; |     virtual int autoServiceInit() override; | ||||||
|     virtual int autoServiceSetBasePoint(const char *data, int length) override; |     virtual int autoServiceSetBasePoint(const char *data, int length) override; | ||||||
|     virtual int autoServiceSetFeildModel(const char *data, int length) override; |     virtual int autoServiceSetFieldModel(const char *data, int length) override; | ||||||
|     virtual int autoServiceSetTeachPointInfo(const char *data, int length) override; |     virtual int autoServiceSetTeachPointInfo(const char *data, int length) override; | ||||||
|     virtual int autoServiceSetTeachPointParam(const char *data, int length) override; |     virtual int autoServiceSetTeachPointParam(const char *data, int length) override; | ||||||
|     virtual int autoServiceSetCarModel(const char *data, int length) override; |     virtual int autoServiceSetCarModel(const char *data, int length) override; | ||||||
|  | |||||||
| @ -11,7 +11,7 @@ public: | |||||||
| 
 | 
 | ||||||
|     virtual int autoServiceInit() = 0; |     virtual int autoServiceInit() = 0; | ||||||
|     virtual int autoServiceSetBasePoint(const char *data, int length) = 0; |     virtual int autoServiceSetBasePoint(const char *data, int length) = 0; | ||||||
|     virtual int autoServiceSetFeildModel(const char *data, int length) = 0; |     virtual int autoServiceSetFieldModel(const char *data, int length) = 0; | ||||||
|     virtual int autoServiceSetTeachPointInfo(const char *data, int length) = 0; |     virtual int autoServiceSetTeachPointInfo(const char *data, int length) = 0; | ||||||
|     virtual int autoServiceSetTeachPointParam(const char *data, int length) = 0; |     virtual int autoServiceSetTeachPointParam(const char *data, int length) = 0; | ||||||
|     virtual int autoServiceSetCarModel(const char *data, int length) = 0; |     virtual int autoServiceSetCarModel(const char *data, int length) = 0; | ||||||
|  | |||||||
| @ -11,7 +11,7 @@ public: | |||||||
| 
 | 
 | ||||||
|     virtual int autoServiceInit() = 0; |     virtual int autoServiceInit() = 0; | ||||||
|     virtual int autoServiceSetBasePoint(const char *data, int length) = 0; |     virtual int autoServiceSetBasePoint(const char *data, int length) = 0; | ||||||
|     virtual int autoServiceSetFeildModel(const char *data, int length) = 0; |     virtual int autoServiceSetFieldModel(const char *data, int length) = 0; | ||||||
|     virtual int autoServiceSetTeachPointInfo(const char *data, int length) = 0; |     virtual int autoServiceSetTeachPointInfo(const char *data, int length) = 0; | ||||||
|     virtual int autoServiceSetTeachPointParam(const char *data, int length) = 0; |     virtual int autoServiceSetTeachPointParam(const char *data, int length) = 0; | ||||||
|     virtual int autoServiceSetCarModel(const char *data, int length) = 0; |     virtual int autoServiceSetCarModel(const char *data, int length) = 0; | ||||||
|  | |||||||
| @ -2,12 +2,15 @@ import common from '@ohos.app.ability.common'; | |||||||
| import RealTime from '../components/RealTime'; | import RealTime from '../components/RealTime'; | ||||||
| import { MediaPlayer } from '../utils/MediaPlayer'; | import { MediaPlayer } from '../utils/MediaPlayer'; | ||||||
| import { CommandType, MessageCallBackParams, SimulatorUdpClient } from '../utils/simulator/UdpClient'; | import { CommandType, MessageCallBackParams, SimulatorUdpClient } from '../utils/simulator/UdpClient'; | ||||||
| import { UdpClient } from '../utils/udp/UdpClient'; | import { BackMachineUdpClient } from '../utils/udp/UdpClient'; | ||||||
| import { ConfigItemProps, Status } from '../model/index'; | import { ConfigItemProps, ConfigProps, Status } from '../model/index'; | ||||||
| import { getConfigFile } from '../utils/native/NativeUtils'; | import { getConfigFile } from '../utils/native/NativeUtils'; | ||||||
| import promptAction from '@ohos.promptAction'; | import promptAction from '@ohos.promptAction'; | ||||||
| 
 | 
 | ||||||
| import { OutWireControl } from '../utils/wireControl/OutWireControl'; | import { OutWireControl } from '../utils/wireControl/OutWireControl'; | ||||||
|  | import { nativeLogCallback, nativeSDKInit, setBasePoint, setConfigFile, setImageSize } from '../utils/native/NativeSDK'; | ||||||
|  | import { LogHelper } from '../utils/LogHelper'; | ||||||
|  | import util from '@ohos.util'; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| // 直角转弯 (0, 0) (0, 1)   ... | // 直角转弯 (0, 0) (0, 1)   ... | ||||||
| @ -23,10 +26,6 @@ const audios = new Array(33).map((_, i) => { | |||||||
|   return "audio/output_" + i + ".mp3" |   return "audio/output_" + i + ".mp3" | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
| function TestLog(...message: string[]) { |  | ||||||
|   console.log("Assisted Driving: ", ...message) |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| const projectAudio = [ | const projectAudio = [ | ||||||
|   [4, 5], |   [4, 5], | ||||||
|   [0, 1, 2, 3], |   [0, 1, 2, 3], | ||||||
| @ -64,30 +63,47 @@ struct Index { | |||||||
|   @State currentPath: number = 0 |   @State currentPath: number = 0 | ||||||
|   @State currentLibrary: number = 0 |   @State currentLibrary: number = 0 | ||||||
|   @State process: number = 1 |   @State process: number = 1 | ||||||
|  |   private line: string | ||||||
|  |   private lib: string | ||||||
|   private carModel: string |   private carModel: string | ||||||
|   private fieldModel: string |   private fieldModel: string | ||||||
|   private teachPoint: string |   private teachPoint: string | ||||||
|  |   private teachPointParams: string | ||||||
|   private basePoint: string |   private basePoint: string | ||||||
|   private player: MediaPlayer = new MediaPlayer(getContext(this) as common.UIAbilityContext) |   private player: MediaPlayer = new MediaPlayer(getContext(this) as common.UIAbilityContext) | ||||||
|   private simulatorUdpClient: SimulatorUdpClient |   private simulatorUdpClient?: SimulatorUdpClient | ||||||
|   private backupUdpClient: UdpClient |   private backupUdpClient?: BackMachineUdpClient | ||||||
|   private outWireControl: OutWireControl |   private outWireControl?: OutWireControl | ||||||
| 
 | 
 | ||||||
|   async aboutToAppear() { |   async aboutToAppear() { | ||||||
|     getConfigFile().then(([fieldModel, carModel, lib, path, teachPoint, basePoint]) => { |     try { | ||||||
|       this.fieldModel = fieldModel |       await getConfigFile().then(([fieldModel, carModel, line, lib, teachPoint, teachPointParams, basePoint]) => { | ||||||
|       this.carModel = carModel |         this.fieldModel = fieldModel | ||||||
|       this.libraries = lib |         this.carModel = carModel | ||||||
|       this.paths = path |         this.teachPoint = teachPoint | ||||||
|       this.teachPoint = teachPoint |         this.basePoint = basePoint | ||||||
|       this.basePoint = basePoint |         this.teachPointParams = teachPointParams | ||||||
|     }).catch(err => { |         this.line = line | ||||||
|       TestLog(err) |         this.lib = lib | ||||||
|     }) |         this.libraries = (JSON.parse(lib) as ConfigProps<Array<number>>).features | ||||||
|     this.outWireControl = new OutWireControl() |         this.paths = (JSON.parse(line) as ConfigProps<Array<Array<number>>>).features | ||||||
|     await this.outWireControl.init("192.168.7.181", 30021) |       }) | ||||||
|     await this.initPlatformUDP() |       await nativeSDKInit() | ||||||
|     await this.initAudioPlayer() |       // await nativeLogCallback((message: string, len: number) => { | ||||||
|  |       //   LogHelper.I("NativeSDK", message) | ||||||
|  |       // }) | ||||||
|  |       await setConfigFile(this.basePoint, this.fieldModel, this.teachPoint, this.teachPointParams, this.carModel, this.line, this.lib) | ||||||
|  |       this.outWireControl = new OutWireControl() | ||||||
|  |       await this.outWireControl.init("192.168.7.181", 30021) | ||||||
|  |       await this.initPlatformUDP() | ||||||
|  |       await this.initAudioPlayer() | ||||||
|  |     } catch (err) { | ||||||
|  |       promptAction.showToast({ | ||||||
|  |         message: JSON.stringify(err), | ||||||
|  |         duration: 3000 | ||||||
|  |       }) | ||||||
|  |       LogHelper.E("View ", JSON.stringify(err)) | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   async playAudio(project: number, point: number) { |   async playAudio(project: number, point: number) { | ||||||
| @ -108,56 +124,63 @@ struct Index { | |||||||
|   // 初始化终端UDP |   // 初始化终端UDP | ||||||
|   async initPlatformUDP() { |   async initPlatformUDP() { | ||||||
|     this.simulatorUdpClient = new SimulatorUdpClient("0.0.0.0", 8990, "88.22.10.118", 9001) |     this.simulatorUdpClient = new SimulatorUdpClient("0.0.0.0", 8990, "88.22.10.118", 9001) | ||||||
|     await this.simulatorUdpClient.bindUdp() |     try { | ||||||
|     // this.simulatorUdpClient.heart() |       await this.simulatorUdpClient.bindUdp() | ||||||
|     setInterval(() => { |       this.simulatorUdpClient.heart() | ||||||
|       this.simulatorUdpClient.uploadPosition() |       setInterval(() => { | ||||||
|     }, 1000) |         this.simulatorUdpClient.uploadPosition() | ||||||
|     this.simulatorUdpClient.onMessage(({type, data = [] }: MessageCallBackParams) => { |       }, 1000) | ||||||
|       if (type === CommandType.Start) { |       this.simulatorUdpClient.onMessage(({type, data = [] }: MessageCallBackParams) => { | ||||||
|         let path = this.paths.findIndex(item => { |         if (type === CommandType.Start) { | ||||||
|           return item.properties.id === data[0] |           let path = this.paths.findIndex(item => { | ||||||
|         }) |             return item.properties.id === data[0] | ||||||
|         let lib = this.libraries.findIndex(item => { |  | ||||||
|           return item.properties.id === data[1] |  | ||||||
|         }) |  | ||||||
|         if (path === -1 || lib === -1) { |  | ||||||
|           promptAction.showToast({ |  | ||||||
|             message: "错误的路线或库位" |  | ||||||
|           }) |           }) | ||||||
|           this.simulatorUdpClient.sendPID26(CommandType.Failed) |           let lib = this.libraries.findIndex(item => { | ||||||
|           return |             return item.properties.id === data[1] | ||||||
|  |           }) | ||||||
|  |           if (path === -1 || lib === -1) { | ||||||
|  |             promptAction.showToast({ | ||||||
|  |               message: "错误的路线或库位" | ||||||
|  |             }) | ||||||
|  |             this.simulatorUdpClient.sendPID26(CommandType.Failed) | ||||||
|  |             return | ||||||
|  |           } | ||||||
|  |           this.currentPath = path | ||||||
|  |           this.currentLibrary = lib | ||||||
|  |           this.status = Status.Running | ||||||
|  |           this.simulatorUdpClient.sendPID26(CommandType.Success) | ||||||
|         } |         } | ||||||
|         this.currentPath = path |         else if (type === CommandType.Stop) { | ||||||
|         this.currentLibrary = lib |           this.status = Status.Idle | ||||||
|         this.status = Status.Running |           this.simulatorUdpClient.sendPID26(CommandType.Success) | ||||||
|         this.simulatorUdpClient.sendPID26(CommandType.Success) |         } | ||||||
|       } |       }) | ||||||
|       else if (type === CommandType.Stop) { |     } catch (err) { | ||||||
|         this.status = Status.Idle |       throw new Error(JSON.stringify(err)) | ||||||
|         this.simulatorUdpClient.sendPID26(CommandType.Success) |     } | ||||||
|       } |  | ||||||
|     }) |  | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   // 初始化后置机UDP |   // 初始化后置机UDP | ||||||
|   async initBackMachineUDP() { |   async initBackMachineUDP() { | ||||||
|     this.backupUdpClient = new UdpClient("", 0, "", 0) |     this.backupUdpClient = new BackMachineUdpClient("", 0, "", 0) | ||||||
|     await this.backupUdpClient.bindUdp() |     try { | ||||||
|     this.backupUdpClient.onMessage(() => { |       await this.backupUdpClient.bindUdp() | ||||||
| 
 |       this.backupUdpClient.onMessage(() => { | ||||||
|     }) |       }) | ||||||
|  |     } catch (err) { | ||||||
|  |       throw new Error(JSON.stringify(err)) | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   // 上方按钮点击 |   // 上方按钮点击 | ||||||
|   onConfirm() { |   onConfirm() { | ||||||
|     if (this.status === Status.Idle) { |     if (this.status === Status.Idle) { | ||||||
|       this.simulatorUdpClient.setPathId(this.paths[this.currentPath].properties.id) |       this.simulatorUdpClient?.setPathId(this.paths[this.currentPath].properties.id) | ||||||
|       this.simulatorUdpClient.setLibId(this.libraries[this.currentLibrary].properties.id) |       this.simulatorUdpClient?.setLibId(this.libraries[this.currentLibrary].properties.id) | ||||||
|       this.simulatorUdpClient.sendPID26(CommandType.Start) |       this.simulatorUdpClient?.sendPID26(CommandType.Start) | ||||||
|       this.status = Status.Running |       this.status = Status.Running | ||||||
|     } else { |     } else { | ||||||
|       this.simulatorUdpClient.sendPID26(CommandType.Stop) |       this.simulatorUdpClient?.sendPID26(CommandType.Stop) | ||||||
|       this.status = Status.Idle |       this.status = Status.Idle | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  | |||||||
| @ -18,7 +18,11 @@ export class LogHelper { | |||||||
|   public static DOOR_SWITCH = "door_switch"; |   public static DOOR_SWITCH = "door_switch"; | ||||||
| 
 | 
 | ||||||
|   public static I(tag: string, ...msg: any[]) { |   public static I(tag: string, ...msg: any[]) { | ||||||
|     console.log(tag + "__", ...msg); |     console.log(`[Assisted Drive Module ${tag} Message]: `, ...msg); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   public static E(tag: string, ...msg: any[]) { | ||||||
|  |     console.error(`[Assisted Drive Module ${tag} Message]: `, ...msg); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   public static getDetailLog(tag: string, value: number) { |   public static getDetailLog(tag: string, value: number) { | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| import common from '@ohos.app.ability.common' | import common from '@ohos.app.ability.common' | ||||||
| import { SimulatorUdpClient } from './simulator/UdpClient' | import { SimulatorUdpClient } from './simulator/UdpClient' | ||||||
| import { UdpClient } from './udp/UdpClient' | import { BackMachineUdpClient } from './udp/UdpClient' | ||||||
| 
 | 
 | ||||||
| class Store { | class Store { | ||||||
|   private static instance: Store |   private static instance: Store | ||||||
| @ -8,7 +8,7 @@ class Store { | |||||||
|   public closeUDPSocket: boolean |   public closeUDPSocket: boolean | ||||||
|   public plcUdpError: boolean |   public plcUdpError: boolean | ||||||
|   public serialPortMsg: string |   public serialPortMsg: string | ||||||
|   public backMachineUDPClient: UdpClient |   public backMachineUDPClient: BackMachineUdpClient | ||||||
|   public simulatorUdpClient: SimulatorUdpClient |   public simulatorUdpClient: SimulatorUdpClient | ||||||
|   public isJudge: boolean |   public isJudge: boolean | ||||||
|   public messageTimer: number |   public messageTimer: number | ||||||
|  | |||||||
| @ -1,18 +1,212 @@ | |||||||
| // import libJudgeSdk from 'libJudgeSdk.so' | import libJudgeSdk from 'libJudgeSdk.so' | ||||||
| // | import { LogHelper } from '../LogHelper' | ||||||
| // function useNativeAPI(cb: Function, ...args: Object[]) { | 
 | ||||||
| //   return new Promise<void>((resolve, reject) => { | const Tag = "NativeSDK" | ||||||
| //     let params = args.map(item => JSON.stringify(item)) | 
 | ||||||
| //     let result = cb(...params) | function useNativeAPI(cb: Function, ...args: Object[]) { | ||||||
| //     if (result === 0) { |   return new Promise<void>((resolve, reject) => { | ||||||
| //       resolve() |     let params = args.map(item => JSON.stringify(item)) | ||||||
| //     } else { |     let result = cb(...params) | ||||||
| //       reject() |     LogHelper.I(Tag, cb.name, "receive sdk result ", result) | ||||||
| //     } |     if (result === 0) { | ||||||
| //   }) |       LogHelper.I(Tag, "use native function ", cb.name, " success") | ||||||
| // } |       resolve() | ||||||
| // |     } else { | ||||||
| // export function init(data: Object) { |       reject("use native function " + cb.name + " failed") | ||||||
| //   return useNativeAPI(libJudgeSdk.examJudgeInit, data) |     } | ||||||
| // } |   }) | ||||||
| // | } | ||||||
|  | 
 | ||||||
|  | // sdk初始化 | ||||||
|  | export function nativeSDKInit(data?: Object) { | ||||||
|  |   return useNativeAPI(libJudgeSdk.autoServiceInit, data) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 日志回调 | ||||||
|  | export async function nativeLogCallback(callback: Function) { | ||||||
|  |   return new Promise<void>((resolve, reject) => { | ||||||
|  |     const result = libJudgeSdk.registerAutoServiceLogCallback(callback) | ||||||
|  |     if (result === 0) { | ||||||
|  |       LogHelper.I(Tag, "use native function ", "registerAutoServiceLogCallback", " success") | ||||||
|  |       resolve() | ||||||
|  |     } else { | ||||||
|  |       reject("use native function " + "registerAutoServiceLogCallback" + " failed, error code " + result) | ||||||
|  |     } | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 设置基准点 | ||||||
|  | export function setBasePoint(basePoint: string) { | ||||||
|  |   return new Promise<void>((resolve, reject) => { | ||||||
|  |     const result = libJudgeSdk.autoServiceSetBasePoint(basePoint, basePoint.length) | ||||||
|  |     if (result === 0) { | ||||||
|  |       LogHelper.I(Tag, "use native function ", "autoServiceSetBasePoint", " success") | ||||||
|  |       resolve() | ||||||
|  |     } else { | ||||||
|  |       reject("use native function " + "autoServiceSetBasePoint" + " failed, error code " + result) | ||||||
|  |     } | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 设置场地模型 | ||||||
|  | export function setFieldModel(fieldModel: string) { | ||||||
|  |   return new Promise<void>((resolve, reject) => { | ||||||
|  |     const result = libJudgeSdk.autoServiceSetFieldModel(fieldModel, fieldModel.length) | ||||||
|  |     if (result === 0) { | ||||||
|  |       LogHelper.I(Tag, "use native function ", "autoServiceSetFieldModel", " success") | ||||||
|  |       resolve() | ||||||
|  |     } else { | ||||||
|  |       reject("use native function " + "autoServiceSetFieldModel" + " failed, error code " + result) | ||||||
|  |     } | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 设置教学点 | ||||||
|  | export function setTeachPoint(teachPoint: string) { | ||||||
|  |   return new Promise<void>((resolve, reject) => { | ||||||
|  |     const result = libJudgeSdk.autoServiceSetTeachPointInfo(teachPoint, teachPoint.length) | ||||||
|  |     if (result === 0) { | ||||||
|  |       LogHelper.I(Tag, "use native function ", "autoServiceSetTeachPointInfo", " success") | ||||||
|  |       resolve() | ||||||
|  |     } else { | ||||||
|  |       reject("use native function " + "autoServiceSetTeachPointInfo" + " failed, error code " + result) | ||||||
|  |     } | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 设置教学点参数 | ||||||
|  | export function setTeachPointParam(teachPointParam: string) { | ||||||
|  |   return new Promise<void>((resolve, reject) => { | ||||||
|  |     const result = libJudgeSdk.autoServiceSetTeachPointParam(teachPointParam, teachPointParam.length) | ||||||
|  |     if (result === 0) { | ||||||
|  |       LogHelper.I(Tag, "use native function ", "autoServiceSetTeachPointParam", " success") | ||||||
|  |       resolve() | ||||||
|  |     } else { | ||||||
|  |       reject("use native function " + "autoServiceSetTeachPointParam" + " failed, error code " + result) | ||||||
|  |     } | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 设置车模 | ||||||
|  | export function setCarModel(carModel: string) { | ||||||
|  |   return new Promise<void>((resolve, reject) => { | ||||||
|  |     const result = libJudgeSdk.autoServiceSetCarModel(carModel, carModel.length) | ||||||
|  |     if (result === 0) { | ||||||
|  |       LogHelper.I(Tag, "use native function ", "autoServiceSetCarModel", " success") | ||||||
|  |       resolve() | ||||||
|  |     } else { | ||||||
|  |       reject("use native function " + "autoServiceSetCarModel" + " failed, error code " + result) | ||||||
|  |     } | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 设置路径信息 | ||||||
|  | export function setLineInfo(line: string) { | ||||||
|  |   return new Promise<void>((resolve, reject) => { | ||||||
|  |     const result = libJudgeSdk.autoServiceSetLineInfo(line, line.length) | ||||||
|  |     if (result === 0) { | ||||||
|  |       LogHelper.I(Tag, "use native function ", "autoServiceSetLineInfo", " success") | ||||||
|  |       resolve() | ||||||
|  |     } else { | ||||||
|  |       reject("use native function " + "autoServiceSetLineInfo" + " failed, error code " + result) | ||||||
|  |     } | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 设置库位信息 | ||||||
|  | export function setLibInfo(lib: string) { | ||||||
|  |   return new Promise<void>((resolve, reject) => { | ||||||
|  |     const result = libJudgeSdk.autoServiceSetLibInfo(lib, lib.length) | ||||||
|  |     if (result === 0) { | ||||||
|  |       LogHelper.I(Tag, "use native function ", "autoServiceSetLibInfo", " success") | ||||||
|  |       resolve() | ||||||
|  |     } else { | ||||||
|  |       reject("use native function " + "autoServiceSetLibInfo" + " failed, error code " + result) | ||||||
|  |     } | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 选择路径和库位 | ||||||
|  | export function selectLineAndLib(line: number, lib: number) { | ||||||
|  |   return new Promise<void>((resolve, reject) => { | ||||||
|  |     const result = libJudgeSdk.autoServiceSelectLineAndLib(line, lib) | ||||||
|  |     if (result === 0) { | ||||||
|  |       LogHelper.I(Tag, "use native function ", "autoServiceSelectLineAndLib", " success") | ||||||
|  |       resolve() | ||||||
|  |     } else { | ||||||
|  |       reject("use native function " + "autoServiceSelectLineAndLib" + " failed, error code " + result) | ||||||
|  |     } | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 轨迹跟踪 | ||||||
|  | export function onTrack(lng: number, lat: number, yaw: number, v: number) { | ||||||
|  |   return new Promise<void>((resolve, reject) => { | ||||||
|  |     const result = libJudgeSdk.autoServiceTrack(lng, lat, yaw, v) | ||||||
|  |     if (result === 0) { | ||||||
|  |       LogHelper.I(Tag, "use native function ", "autoServiceTrack", " success") | ||||||
|  |       resolve() | ||||||
|  |     } else { | ||||||
|  |       reject("use native function " + "autoServiceTrack" + " failed, error code " + result) | ||||||
|  |     } | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 设置线画图大小 | ||||||
|  | export function setImageSize(width: number, height: number) { | ||||||
|  |   return new Promise<void>((resolve, reject) => { | ||||||
|  |     const result = libJudgeSdk.autoServiceSetImageSize(width, height) | ||||||
|  |     if (result === 0) { | ||||||
|  |       LogHelper.I(Tag, "use native function ", "autoServiceSetImageSize", " success") | ||||||
|  |       resolve() | ||||||
|  |     } else { | ||||||
|  |       reject("use native function " + "autoServiceSetImageSize" + " failed, error code " + result) | ||||||
|  |     } | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 注册车辆控制回调 | ||||||
|  | export function registerControlCallback(callback: Function) { | ||||||
|  |   return new Promise<void>((resolve, reject) => { | ||||||
|  |     const result = libJudgeSdk.registerAutoServiceCallback(callback) | ||||||
|  |     if (result === 0) { | ||||||
|  |       LogHelper.I(Tag, "use native function ", "registerAutoServiceCallback", " success") | ||||||
|  |       resolve() | ||||||
|  |     } else { | ||||||
|  |       reject("use native function " + "registerAutoServiceCallback" + " failed, error code " + result) | ||||||
|  |     } | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 注册教学语音回调 | ||||||
|  | export function registerSoundCallback(callback: Function) { | ||||||
|  |   return new Promise<void>((resolve, reject) => { | ||||||
|  |     const result = libJudgeSdk.registerAutoServiceSoundCallback(callback) | ||||||
|  |     if (result === 0) { | ||||||
|  |       LogHelper.I(Tag, "use native function ", "registerAutoServiceSoundCallback", " success") | ||||||
|  |       resolve() | ||||||
|  |     } else { | ||||||
|  |       reject("use native function " + "registerAutoServiceSoundCallback" + " failed, error code " + result) | ||||||
|  |     } | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 设置配置文件 | ||||||
|  | export function setConfigFile( | ||||||
|  |   basePoint: string, | ||||||
|  |   fieldModel: string, | ||||||
|  |   teachPoint: string, | ||||||
|  |   teachPointParams: string, | ||||||
|  |   carModel: string, | ||||||
|  |   line: string, | ||||||
|  |   lib: string) { | ||||||
|  |   return Promise.all([ | ||||||
|  |     setBasePoint(basePoint), | ||||||
|  |     setFieldModel(fieldModel), | ||||||
|  |     setTeachPoint(teachPoint), | ||||||
|  |     setTeachPointParam(teachPointParams), | ||||||
|  |     setCarModel(carModel), | ||||||
|  |     setLineInfo(line), | ||||||
|  |     setLibInfo(lib)]) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | |||||||
| @ -26,20 +26,21 @@ function getCarModel() { | |||||||
| 
 | 
 | ||||||
| // 获取库位 | // 获取库位 | ||||||
| function getLibrary() { | function getLibrary() { | ||||||
|   return getRawFile(`config/${dir}/destLib.json`).then(res => { |   return getRawFile(`config/${dir}/destLib.json`) | ||||||
|     return (JSON.parse(res) as ConfigProps<Array<number>>).features |  | ||||||
|   }) |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // 获取路线 | // 获取路线 | ||||||
| function getTrack() { | function getTrack() { | ||||||
|   return getRawFile(`config/${dir}/naviPath.json`).then(res => { |   return getRawFile(`config/${dir}/naviPath.json`) | ||||||
|     return (JSON.parse(res) as ConfigProps<Array<Array<number>>>).features |  | ||||||
|   }) |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // 获取教学点位 | // 获取教学点位 | ||||||
| function getTeachPoint() { | function getTeachPoint() { | ||||||
|  |   return getRawFile(`config/${dir}/aiconfig.json`) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 获取教学点位参数 | ||||||
|  | function getTeachPointParams() { | ||||||
|   return getRawFile(`config/${dir}/collectParams.json`).then(res => { |   return getRawFile(`config/${dir}/collectParams.json`).then(res => { | ||||||
|     const origin = (JSON.parse(res) as Array<TeachPoint>) |     const origin = (JSON.parse(res) as Array<TeachPoint>) | ||||||
|     const native: NativeTeachPoint = { item: [] } |     const native: NativeTeachPoint = { item: [] } | ||||||
| @ -77,6 +78,6 @@ function translateTeachPoint() { | |||||||
| 
 | 
 | ||||||
| // 获取SDK所需的配置文件 | // 获取SDK所需的配置文件 | ||||||
| export function getConfigFile() { | export function getConfigFile() { | ||||||
|   return Promise.all([getFieldModel(), getCarModel(), getLibrary(), getTrack(), getTeachPoint(), getBasePoint()]) |   return Promise.all([getFieldModel(), getCarModel(), getTrack(), getLibrary(), getTeachPoint(), getTeachPointParams(), getBasePoint()]) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,7 +1,8 @@ | |||||||
| import socket from '@ohos.net.socket'; | import socket from '@ohos.net.socket'; | ||||||
|  | import { LogHelper } from '../LogHelper'; | ||||||
| import { byte2string, DataToByte } from '../Utils'; | import { byte2string, DataToByte } from '../Utils'; | ||||||
| 
 | 
 | ||||||
| const TAG = 'socketTag[Simulator.UdpClient] ' | const TAG = 'SimulatorUDP' | ||||||
| 
 | 
 | ||||||
| function generateCheckCode(arr: Uint8Array | Uint16Array | Uint32Array) { | function generateCheckCode(arr: Uint8Array | Uint16Array | Uint32Array) { | ||||||
|   let end: number |   let end: number | ||||||
| @ -55,6 +56,7 @@ export class SimulatorUdpClient { | |||||||
|   private pathId: number |   private pathId: number | ||||||
|   private lidId: number |   private lidId: number | ||||||
|   private callback?: MessageCallBack |   private callback?: MessageCallBack | ||||||
|  |   public static Tag = "SimulatorUDP" | ||||||
| 
 | 
 | ||||||
|   constructor(localIp: string, localIpPort: number, oppositeIp: string, oppositeIpPort: number) { |   constructor(localIp: string, localIpPort: number, oppositeIp: string, oppositeIpPort: number) { | ||||||
|     this.localIp = localIp |     this.localIp = localIp | ||||||
| @ -119,12 +121,12 @@ export class SimulatorUdpClient { | |||||||
|         type: CommandType.Start, |         type: CommandType.Start, | ||||||
|         data: [path, lib] |         data: [path, lib] | ||||||
|       }) |       }) | ||||||
|       console.log(TAG, `receive pid18: command start, path: ${path}, lib: ${lib}`) |       LogHelper.I(TAG, `receive pid18: command start, path: ${path}, lib: ${lib}`) | ||||||
|     } else if (type === 16) { |     } else if (type === 16) { | ||||||
|       this.callback?.({ |       this.callback?.({ | ||||||
|         type: CommandType.Stop |         type: CommandType.Stop | ||||||
|       }) |       }) | ||||||
|       console.log(TAG, `receive pid18: command stop`) |       LogHelper.I(TAG, `receive pid18: command stop`) | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @ -184,16 +186,16 @@ export class SimulatorUdpClient { | |||||||
|       } |       } | ||||||
|     }) |     }) | ||||||
|       .then(() => { |       .then(() => { | ||||||
|         console.log(TAG, `[${this.oppositeIp}:${this.oppositeIpPort}]: send success`) |         LogHelper.I(TAG, `[${this.oppositeIp}:${this.oppositeIpPort}]: send success`) | ||||||
|       }) |       }) | ||||||
|       .catch(err => { |       .catch(err => { | ||||||
|         console.error(JSON.stringify(err)) |         LogHelper.E(TAG, JSON.stringify(err)) | ||||||
|       }) |       }) | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   onError(callback?) { |   onError(callback?) { | ||||||
|     this.udp.on('error', async err => { |     this.udp.on('error', async err => { | ||||||
|       console.log(TAG, 'udpError', JSON.stringify(err)) |       LogHelper.E(TAG, JSON.stringify(err)) | ||||||
|       this.bindUdp() |       this.bindUdp() | ||||||
|       this.sendMsg('111') |       this.sendMsg('111') | ||||||
|       this.onMessage(callback) |       this.onMessage(callback) | ||||||
|  | |||||||
| @ -1,12 +1,13 @@ | |||||||
| import socket from '@ohos.net.socket'; | import socket from '@ohos.net.socket'; | ||||||
| import promptAction from '@ohos.promptAction'; | import promptAction from '@ohos.promptAction'; | ||||||
|  | import { LogHelper } from '../LogHelper'; | ||||||
| import { getSerialPort } from '../native/HiserialUtils'; | import { getSerialPort } from '../native/HiserialUtils'; | ||||||
| 
 | 
 | ||||||
| import Store from '../Store'; | import Store from '../Store'; | ||||||
| 
 | 
 | ||||||
| const TAG = 'socketTag[PLC.UdpClient] ' | const TAG = 'BackMachineUDP' | ||||||
| 
 | 
 | ||||||
| export class UdpClient { | export class BackMachineUdpClient { | ||||||
|   private localIp: string = '' |   private localIp: string = '' | ||||||
|   private localIpPort: number = 0 |   private localIpPort: number = 0 | ||||||
|   private oppositeIp: string = '' |   private oppositeIp: string = '' | ||||||
| @ -14,6 +15,7 @@ export class UdpClient { | |||||||
|   private udp: socket.UDPSocket = null |   private udp: socket.UDPSocket = null | ||||||
|   private num: number = 0 |   private num: number = 0 | ||||||
|   private plcUdpError: boolean = false |   private plcUdpError: boolean = false | ||||||
|  |   public static TAG: string = 'BackMachineUDP' | ||||||
| 
 | 
 | ||||||
|   constructor(localIp: string, localIpPort: number, oppositeIp: string, oppositeIpPort: number) { |   constructor(localIp: string, localIpPort: number, oppositeIp: string, oppositeIpPort: number) { | ||||||
|     this.localIp = localIp |     this.localIp = localIp | ||||||
| @ -41,7 +43,6 @@ export class UdpClient { | |||||||
|   sendMsg(msg) { |   sendMsg(msg) { | ||||||
|     return this.udp.getState() |     return this.udp.getState() | ||||||
|       .then(data => { |       .then(data => { | ||||||
|         console.log('getState success:' + JSON.stringify(data)); |  | ||||||
|         return this.udp.send({ |         return this.udp.send({ | ||||||
|           data: msg, |           data: msg, | ||||||
|           address: { |           address: { | ||||||
| @ -52,11 +53,10 @@ export class UdpClient { | |||||||
|         }) |         }) | ||||||
|       }) |       }) | ||||||
|       .then(() => { |       .then(() => { | ||||||
|         console.log(`${TAG}udpCLient udp send success:oppositeIp${this.oppositeIp},oppositeIpPort:${this.oppositeIpPort},localIp:${this.localIp},localIpPort,${this.localIpPort}`); |         LogHelper.I(TAG, `[${this.oppositeIp}:${this.oppositeIpPort}]: send success`) | ||||||
|       }) |       }) | ||||||
|       .catch(err => { |       .catch(err => { | ||||||
|         console.log(`${TAG}udpCLient udp send fail:oppositeIp${this.oppositeIp},oppositeIpPort:${this.oppositeIpPort},localIp:${this.localIp},localIpPort,${this.localIpPort}`); |         LogHelper.E(TAG, JSON.stringify(err)) | ||||||
|         console.log(`${TAG}udpCLient udp send fail error: ${JSON.stringify(err)}`); |  | ||||||
|       }) |       }) | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -147,8 +147,6 @@ export class WireControl { | |||||||
|     this.socket.setExtraOptions({ reuseAddress: true }); |     this.socket.setExtraOptions({ reuseAddress: true }); | ||||||
|     return this.socket.bind({ address: "192.168.7.170", port: 31021 }).then(() => { |     return this.socket.bind({ address: "192.168.7.170", port: 31021 }).then(() => { | ||||||
|       this.isInit = true; |       this.isInit = true; | ||||||
|     }).catch((err) => { |  | ||||||
|       LogHelper.I(LogHelper.TAG, "init failed: ", JSON.stringify(err)) |  | ||||||
|     }) |     }) | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										277
									
								
								entry/src/main/resources/rawfile/config/duolun/aiconfig.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										277
									
								
								entry/src/main/resources/rawfile/config/duolun/aiconfig.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,277 @@ | |||||||
|  | { | ||||||
|  |     "item":[ | ||||||
|  |         { | ||||||
|  |             "item_code":"20100", | ||||||
|  |             "teach_point":[ | ||||||
|  |                 { | ||||||
|  |                     "point_index":1, | ||||||
|  |                     "teachName":"进项目-江西蓝天", | ||||||
|  |                     "velocity_max": 5.7, | ||||||
|  |                     "velocity_std": 3, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":2, | ||||||
|  |                     "teachName":"停车-江西蓝天", | ||||||
|  |                     "velocity_max": 7.4, | ||||||
|  |                     "velocity_std": 0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":3, | ||||||
|  |                     "teachName":"右入库第一把右打满-江西蓝天", | ||||||
|  |                     "velocity_max": 4.1, | ||||||
|  |                     "velocity_std": 0.8, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":4, | ||||||
|  |                     "teachName":"右入库第二把回正-江西蓝天", | ||||||
|  |                     "velocity_max": 3.1, | ||||||
|  |                     "velocity_std": 0.8, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":5, | ||||||
|  |                     "teachName":"右入库第三把右打满-江西蓝天", | ||||||
|  |                     "velocity_max": 2.3, | ||||||
|  |                     "velocity_std": 0.8, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":6, | ||||||
|  |                     "teachName":"右入库调整库边距-江西蓝天", | ||||||
|  |                     "velocity_max": 2.6, | ||||||
|  |                     "velocity_std": 0.8, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":7, | ||||||
|  |                     "teachName":"右入库停车-江西蓝天", | ||||||
|  |                     "velocity_max": 3.8, | ||||||
|  |                     "velocity_std": 0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":8, | ||||||
|  |                     "teachName":"左出库-江西蓝天", | ||||||
|  |                     "velocity_max": 4.5, | ||||||
|  |                     "velocity_std": 0.7, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":9, | ||||||
|  |                     "teachName":"回正方向-江西蓝天", | ||||||
|  |                     "velocity_max": 4.3, | ||||||
|  |                     "velocity_std": 1.5, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":10, | ||||||
|  |                     "teachName":"左出库停车-江西蓝天", | ||||||
|  |                     "velocity_max": 4.9, | ||||||
|  |                     "velocity_std": 0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":11, | ||||||
|  |                     "teachName":"左入库第一把左打满-江西蓝天", | ||||||
|  |                     "velocity_max": 3.5, | ||||||
|  |                     "velocity_std": 0.8, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":12, | ||||||
|  |                     "teachName":"左入库第二把回正-江西蓝天", | ||||||
|  |                     "velocity_max": 3.1, | ||||||
|  |                     "velocity_std": 0.8, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":13, | ||||||
|  |                     "teachName":"左入库第三把左打满-江西蓝天", | ||||||
|  |                     "velocity_max": 4.1, | ||||||
|  |                     "velocity_std": 0.8, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":14, | ||||||
|  |                     "teachName":"左入库调整库边距-江西蓝天", | ||||||
|  |                     "velocity_max": 3.3, | ||||||
|  |                     "velocity_std": 0.9, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":15, | ||||||
|  |                     "teachName":"左入库停车-江西蓝天", | ||||||
|  |                     "velocity_max": 3.5, | ||||||
|  |                     "velocity_std": 0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":16, | ||||||
|  |                     "teachName":"右出库-江西蓝天", | ||||||
|  |                     "velocity_max": 4, | ||||||
|  |                     "velocity_std": 1.3, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 } | ||||||
|  |             ] | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |             "item_code":"20700", | ||||||
|  |             "teach_point":[ | ||||||
|  |                 { | ||||||
|  |                     "point_index":1, | ||||||
|  |                     "teachName":"进项目-江西蓝天-新", | ||||||
|  |                     "velocity_max": 7.9, | ||||||
|  |                     "velocity_std": 2.2, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 1 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":2, | ||||||
|  |                     "teachName":"左转-江西蓝天", | ||||||
|  |                     "velocity_max": 7.1, | ||||||
|  |                     "velocity_std": 1.7, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": 1 | ||||||
|  |                 } | ||||||
|  |             ] | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |             "item_code":"20400", | ||||||
|  |             "teach_point":[ | ||||||
|  |                 { | ||||||
|  |                     "point_index":1, | ||||||
|  |                     "teachName":"进项目-江西蓝天", | ||||||
|  |                     "velocity_max": 8.2, | ||||||
|  |                     "velocity_std": 3.3, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":2, | ||||||
|  |                     "teachName":"停车-江西蓝天", | ||||||
|  |                     "velocity_max": 7.6, | ||||||
|  |                     "velocity_std": 0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":3, | ||||||
|  |                     "teachName":"入库第一把右打一圈-江西蓝天", | ||||||
|  |                     "velocity_max": 5.3, | ||||||
|  |                     "velocity_std": 1.2, | ||||||
|  |                     "steering_std": 360, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":4, | ||||||
|  |                     "teachName":"入库第二把回正方向-江西蓝天", | ||||||
|  |                     "velocity_max": 3.4, | ||||||
|  |                     "velocity_std": 1.1, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":5, | ||||||
|  |                     "teachName":"入库第三把左打满-江西蓝天", | ||||||
|  |                     "velocity_max": 4.8, | ||||||
|  |                     "velocity_std": 1.2, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":6, | ||||||
|  |                     "teachName":"入库停车-江西蓝天", | ||||||
|  |                     "velocity_max": 3.7, | ||||||
|  |                     "velocity_std": 0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":8, | ||||||
|  |                     "teachName":"出库第二把右打满-江西蓝天", | ||||||
|  |                     "velocity_max": 5.7, | ||||||
|  |                     "velocity_std": 1.6, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": -1 | ||||||
|  |                 } | ||||||
|  |             ] | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |             "item_code":"20300", | ||||||
|  |             "teach_point":[ | ||||||
|  |                 { | ||||||
|  |                     "point_index":1, | ||||||
|  |                     "teachName":"进项目-江西蓝天", | ||||||
|  |                     "velocity_max": 8.0, | ||||||
|  |                     "velocity_std": 4.0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":2, | ||||||
|  |                     "teachName":"定点停车-江西蓝天", | ||||||
|  |                     "velocity_max": 6, | ||||||
|  |                     "velocity_std": 0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 } | ||||||
|  |             ] | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |             "item_code":"20600", | ||||||
|  |             "teach_point":[ | ||||||
|  |                 { | ||||||
|  |                     "point_index":1, | ||||||
|  |                     "teachName":"进项目-蓝天", | ||||||
|  |                     "velocity_max": 3.8, | ||||||
|  |                     "velocity_std": 1.8, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":2, | ||||||
|  |                     "teachName":"左打一圈-江西蓝天", | ||||||
|  |                     "velocity_max": 7.1, | ||||||
|  |                     "velocity_std": 2.5, | ||||||
|  |                     "steering_std": 360, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":3, | ||||||
|  |                     "teachName":"回正方向-江西蓝天", | ||||||
|  |                     "velocity_max": 6.3, | ||||||
|  |                     "velocity_std": 2.0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":4, | ||||||
|  |                     "teachName":"右打一圈-江西蓝天", | ||||||
|  |                     "velocity_max": 7.4, | ||||||
|  |                     "velocity_std": 2.4, | ||||||
|  |                     "steering_std": 360, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 } | ||||||
|  |             ] | ||||||
|  |         } | ||||||
|  |     ] | ||||||
|  | } | ||||||
							
								
								
									
										277
									
								
								entry/src/main/resources/rawfile/config/simulator/aiconfig.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										277
									
								
								entry/src/main/resources/rawfile/config/simulator/aiconfig.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,277 @@ | |||||||
|  | { | ||||||
|  |     "item":[ | ||||||
|  |         { | ||||||
|  |             "item_code":"20100", | ||||||
|  |             "teach_point":[ | ||||||
|  |                 { | ||||||
|  |                     "point_index":1, | ||||||
|  |                     "teachName":"进项目-江西蓝天", | ||||||
|  |                     "velocity_max": 5.7, | ||||||
|  |                     "velocity_std": 3, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":2, | ||||||
|  |                     "teachName":"停车-江西蓝天", | ||||||
|  |                     "velocity_max": 7.4, | ||||||
|  |                     "velocity_std": 0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":3, | ||||||
|  |                     "teachName":"右入库第一把右打满-江西蓝天", | ||||||
|  |                     "velocity_max": 4.1, | ||||||
|  |                     "velocity_std": 0.8, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":4, | ||||||
|  |                     "teachName":"右入库第二把回正-江西蓝天", | ||||||
|  |                     "velocity_max": 3.1, | ||||||
|  |                     "velocity_std": 0.8, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":5, | ||||||
|  |                     "teachName":"右入库第三把右打满-江西蓝天", | ||||||
|  |                     "velocity_max": 2.3, | ||||||
|  |                     "velocity_std": 0.8, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":6, | ||||||
|  |                     "teachName":"右入库调整库边距-江西蓝天", | ||||||
|  |                     "velocity_max": 2.6, | ||||||
|  |                     "velocity_std": 0.8, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":7, | ||||||
|  |                     "teachName":"右入库停车-江西蓝天", | ||||||
|  |                     "velocity_max": 3.8, | ||||||
|  |                     "velocity_std": 0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":8, | ||||||
|  |                     "teachName":"左出库-江西蓝天", | ||||||
|  |                     "velocity_max": 4.5, | ||||||
|  |                     "velocity_std": 0.7, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":9, | ||||||
|  |                     "teachName":"回正方向-江西蓝天", | ||||||
|  |                     "velocity_max": 4.3, | ||||||
|  |                     "velocity_std": 1.5, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":10, | ||||||
|  |                     "teachName":"左出库停车-江西蓝天", | ||||||
|  |                     "velocity_max": 4.9, | ||||||
|  |                     "velocity_std": 0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":11, | ||||||
|  |                     "teachName":"左入库第一把左打满-江西蓝天", | ||||||
|  |                     "velocity_max": 3.5, | ||||||
|  |                     "velocity_std": 0.8, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":12, | ||||||
|  |                     "teachName":"左入库第二把回正-江西蓝天", | ||||||
|  |                     "velocity_max": 3.1, | ||||||
|  |                     "velocity_std": 0.8, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":13, | ||||||
|  |                     "teachName":"左入库第三把左打满-江西蓝天", | ||||||
|  |                     "velocity_max": 4.1, | ||||||
|  |                     "velocity_std": 0.8, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":14, | ||||||
|  |                     "teachName":"左入库调整库边距-江西蓝天", | ||||||
|  |                     "velocity_max": 3.3, | ||||||
|  |                     "velocity_std": 0.9, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":15, | ||||||
|  |                     "teachName":"左入库停车-江西蓝天", | ||||||
|  |                     "velocity_max": 3.5, | ||||||
|  |                     "velocity_std": 0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":16, | ||||||
|  |                     "teachName":"右出库-江西蓝天", | ||||||
|  |                     "velocity_max": 4, | ||||||
|  |                     "velocity_std": 1.3, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 } | ||||||
|  |             ] | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |             "item_code":"20700", | ||||||
|  |             "teach_point":[ | ||||||
|  |                 { | ||||||
|  |                     "point_index":1, | ||||||
|  |                     "teachName":"进项目-江西蓝天-新", | ||||||
|  |                     "velocity_max": 7.9, | ||||||
|  |                     "velocity_std": 2.2, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 1 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":2, | ||||||
|  |                     "teachName":"左转-江西蓝天", | ||||||
|  |                     "velocity_max": 7.1, | ||||||
|  |                     "velocity_std": 1.7, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": 1 | ||||||
|  |                 } | ||||||
|  |             ] | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |             "item_code":"20400", | ||||||
|  |             "teach_point":[ | ||||||
|  |                 { | ||||||
|  |                     "point_index":1, | ||||||
|  |                     "teachName":"进项目-江西蓝天", | ||||||
|  |                     "velocity_max": 8.2, | ||||||
|  |                     "velocity_std": 3.3, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":2, | ||||||
|  |                     "teachName":"停车-江西蓝天", | ||||||
|  |                     "velocity_max": 7.6, | ||||||
|  |                     "velocity_std": 0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":3, | ||||||
|  |                     "teachName":"入库第一把右打一圈-江西蓝天", | ||||||
|  |                     "velocity_max": 5.3, | ||||||
|  |                     "velocity_std": 1.2, | ||||||
|  |                     "steering_std": 360, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":4, | ||||||
|  |                     "teachName":"入库第二把回正方向-江西蓝天", | ||||||
|  |                     "velocity_max": 3.4, | ||||||
|  |                     "velocity_std": 1.1, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":5, | ||||||
|  |                     "teachName":"入库第三把左打满-江西蓝天", | ||||||
|  |                     "velocity_max": 4.8, | ||||||
|  |                     "velocity_std": 1.2, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":6, | ||||||
|  |                     "teachName":"入库停车-江西蓝天", | ||||||
|  |                     "velocity_max": 3.7, | ||||||
|  |                     "velocity_std": 0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":8, | ||||||
|  |                     "teachName":"出库第二把右打满-江西蓝天", | ||||||
|  |                     "velocity_max": 5.7, | ||||||
|  |                     "velocity_std": 1.6, | ||||||
|  |                     "steering_std": 540, | ||||||
|  |                     "lamp_std": -1 | ||||||
|  |                 } | ||||||
|  |             ] | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |             "item_code":"20300", | ||||||
|  |             "teach_point":[ | ||||||
|  |                 { | ||||||
|  |                     "point_index":1, | ||||||
|  |                     "teachName":"进项目-江西蓝天", | ||||||
|  |                     "velocity_max": 8.0, | ||||||
|  |                     "velocity_std": 4.0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":2, | ||||||
|  |                     "teachName":"定点停车-江西蓝天", | ||||||
|  |                     "velocity_max": 6, | ||||||
|  |                     "velocity_std": 0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 } | ||||||
|  |             ] | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |             "item_code":"20600", | ||||||
|  |             "teach_point":[ | ||||||
|  |                 { | ||||||
|  |                     "point_index":1, | ||||||
|  |                     "teachName":"进项目-蓝天", | ||||||
|  |                     "velocity_max": 3.8, | ||||||
|  |                     "velocity_std": 1.8, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":2, | ||||||
|  |                     "teachName":"左打一圈-江西蓝天", | ||||||
|  |                     "velocity_max": 7.1, | ||||||
|  |                     "velocity_std": 2.5, | ||||||
|  |                     "steering_std": 360, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":3, | ||||||
|  |                     "teachName":"回正方向-江西蓝天", | ||||||
|  |                     "velocity_max": 6.3, | ||||||
|  |                     "velocity_std": 2.0, | ||||||
|  |                     "steering_std": 0, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     "point_index":4, | ||||||
|  |                     "teachName":"右打一圈-江西蓝天", | ||||||
|  |                     "velocity_max": 7.4, | ||||||
|  |                     "velocity_std": 2.4, | ||||||
|  |                     "steering_std": 360, | ||||||
|  |                     "lamp_std": 0 | ||||||
|  |                 } | ||||||
|  |             ] | ||||||
|  |         } | ||||||
|  |     ] | ||||||
|  | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user