|
|
|
@ -377,6 +377,10 @@ export default class PtrObject extends THREE.Object3D { |
|
|
|
} |
|
|
|
|
|
|
|
subscribeMessage(topic: string) { |
|
|
|
if (!worldModel.envManager.client) { |
|
|
|
console.warn('worldModel.envManager.client is null!') |
|
|
|
return |
|
|
|
} |
|
|
|
worldModel.envManager.client.subscribe(topic, { qos: 0 }) |
|
|
|
} |
|
|
|
|
|
|
|
@ -391,6 +395,11 @@ export default class PtrObject extends THREE.Object3D { |
|
|
|
if (this.sendMessageQueue.length <= 0) { |
|
|
|
this.mqRetryTimeCount = 0 |
|
|
|
} |
|
|
|
if (!worldModel.envManager.client) { |
|
|
|
console.warn('worldModel.envManager.client is null!') |
|
|
|
this.heartBeatTimeCount = 0 |
|
|
|
return |
|
|
|
} |
|
|
|
worldModel.envManager.client.publish('/agv_robot/status', JSON.stringify(msg)) |
|
|
|
this.heartBeatTimeCount = 0 |
|
|
|
} |
|
|
|
@ -402,6 +411,10 @@ export default class PtrObject extends THREE.Object3D { |
|
|
|
const content = new AmrMsg20100(this.vehicleId) |
|
|
|
content.Temperature = { Battery: this.Battery } |
|
|
|
const m20100 = new AmrMsg<AmrMsg20100>(content) |
|
|
|
if (!worldModel.envManager.client) { |
|
|
|
console.warn('worldModel.envManager.client is null!') |
|
|
|
return |
|
|
|
} |
|
|
|
worldModel.envManager.client.publish('/agv_robot/status', JSON.stringify(m20100)) |
|
|
|
} |
|
|
|
|
|
|
|
@ -412,6 +425,10 @@ export default class PtrObject extends THREE.Object3D { |
|
|
|
const msg20050 = new AmrMsg20050(seqNo, vehicleId) |
|
|
|
const ack = new AmrMsg<AmrMsg20050>(msg20050) |
|
|
|
this.heartBeatTimeCount = 0 |
|
|
|
if (!worldModel.envManager.client) { |
|
|
|
console.warn('worldModel.envManager.client is null!') |
|
|
|
return |
|
|
|
} |
|
|
|
worldModel.envManager.client.publish('/agv_robot/status', JSON.stringify(ack)) |
|
|
|
} |
|
|
|
|
|
|
|
|