完成了安全区参数修改的功能

This commit is contained in:
gitea 2024-09-25 09:28:04 +08:00
parent 5a52f6262d
commit f0c038f744
3 changed files with 6 additions and 97 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ code/__pycache__
code/testbench.py code/testbench.py
assets/logs/ assets/logs/
assets/configs/io_device_XBC_* assets/configs/io_device_XBC_*
assets/json/safety.safety_area.set_param.json

View File

@ -1,93 +0,0 @@
{
"s": {
"box": {
"Lx": 0.0,
"Ly": 0.0,
"Lz": 0.0,
"direction": true,
"ori": {
"euler": {
"a": 0.0,
"b": 0.0,
"c": 0.0
},
"quaternion": {
"q1": 0.0,
"q2": 0.0,
"q3": 0.0,
"q4": 0.0
}
},
"pos": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
},
"enable": false,
"id": 0,
"name": "region1",
"plane": {
"direction": true,
"point": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"vector": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
},
"shape": 0,
"shared_bind_di": "",
"shared_bind_do": "",
"sphere": {
"ori": {
"euler": {
"a": 0.0,
"b": 0.0,
"c": 0.0
},
"quaternion": {
"q1": 0.0,
"q2": 0.0,
"q3": 0.0,
"q4": 0.0
}
},
"pos": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"radius": 0.0
},
"state": true,
"trigger": 0,
"type": 0,
"vertebral": {
"high": 0.0,
"ori": {
"euler": {
"a": 0.0,
"b": 0.0,
"c": 0.0
},
"quaternion": {
"q1": 0.0,
"q2": 0.0,
"q3": 0.0,
"q4": 0.0
}
},
"pos": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"radius": 0.0
}
}
}

View File

@ -1765,9 +1765,10 @@ class HmiRequest(object):
for _ in keys: for _ in keys:
if _ in kwargs.keys(): if _ in kwargs.keys():
res[_] = kwargs[_] res[_] = kwargs[_]
with open(f"{clibs.PREFIX}/json/safety_area.set_param.json", mode="w", encoding="utf-8") as f: with open(f"{clibs.PREFIX}/json/safety.safety_area.set_param.json", mode="w", encoding="utf-8") as f:
dump({"s": res}, f, indent=4) dump({"c": {"safety.safety_area.set_param": res}}, f, indent=4)
self.execution("safety_area.set_param", protocol_flag=1) self.execution("safety.safety_area.set_param", protocol_flag=1)
self.execution("safety.safety_area.safety_area_enable", protocol_flag=1, id=id, enable=enable)
@property @property
def get_filtered_error_code(self): def get_filtered_error_code(self):