mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2026-02-05 22:15:04 +00:00
修改moveit_interface,并在mqtt上报时发送一个时间戳
This commit is contained in:
@@ -159,10 +159,10 @@ class MQTTClient:
|
|||||||
# status = device_status.get(device_id, {})
|
# status = device_status.get(device_id, {})
|
||||||
if self.mqtt_disable:
|
if self.mqtt_disable:
|
||||||
return
|
return
|
||||||
status = {"data": device_status.get(device_id, {}), "device_id": device_id}
|
status = {"data": device_status.get(device_id, {}), "device_id": device_id, "timestamp": time.time()}
|
||||||
address = f"labs/{MQConfig.lab_id}/devices/"
|
address = f"labs/{MQConfig.lab_id}/devices/"
|
||||||
self.client.publish(address, json.dumps(status), qos=2)
|
self.client.publish(address, json.dumps(status), qos=2)
|
||||||
logger.debug(f"Device status published: address: {address}, {status}")
|
logger.info(f"Device status published: address: {address}, {status}")
|
||||||
|
|
||||||
def publish_job_status(self, feedback_data: dict, job_id: str, status: str, return_info: Optional[str] = None):
|
def publish_job_status(self, feedback_data: dict, job_id: str, status: str, return_info: Optional[str] = None):
|
||||||
if self.mqtt_disable:
|
if self.mqtt_disable:
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class MoveitInterface:
|
|||||||
tf_buffer: Buffer
|
tf_buffer: Buffer
|
||||||
tf_listener: TransformListener
|
tf_listener: TransformListener
|
||||||
|
|
||||||
def __init__(self, moveit_type, joint_poses, rotation=None, device_config=None):
|
def __init__(self, moveit_type, joint_poses, rotation=None, device_config=None, **kwargs):
|
||||||
self.device_config = device_config
|
self.device_config = device_config
|
||||||
self.rotation = rotation
|
self.rotation = rotation
|
||||||
self.data_config = json.load(
|
self.data_config = json.load(
|
||||||
|
|||||||
Reference in New Issue
Block a user