Skip to content

Commit bfc3002

Browse files
charlesworthCharlesworth
charlesworth
authored andcommitted
updated toolpath JSON in example code to current metadata format
1 parent 9b5e0d8 commit bfc3002

File tree

2 files changed

+57
-31
lines changed

2 files changed

+57
-31
lines changed

README.md

+30-16
Original file line numberDiff line numberDiff line change
@@ -82,23 +82,37 @@ with eva.lock():
8282

8383
```python
8484
toolpath = {
85-
"metadata":{
86-
"default_velocity":0.7,
87-
"next_label_id":5,
88-
"analog_modes":{ "i0":"voltage", "i1":"voltage", "o0":"voltage", "o1":"voltage" }
85+
"metadata": {
86+
"version": 2,
87+
"default_max_speed": 0.25,
88+
"payload": 0,
89+
"analog_modes": {
90+
"i0": "voltage",
91+
"i1": "voltage",
92+
"o0": "voltage",
93+
"o1": "voltage"
94+
},
95+
"next_label_id": 3
8996
},
90-
"waypoints":[
91-
{ "joints":[-0.68147224, 0.3648368, -1.0703622, 9.354615e-05, -2.4358354, -0.6813218], "label_id":3 },
92-
{ "joints":[-0.6350288, 0.25192022, -1.0664424, 0.030407501, -2.2955494, -0.615318], "label_id":2 },
93-
{ "joints":[-0.13414459, 0.5361486, -1.280493, -6.992453e-08, -2.3972468, -0.13414553], "label_id":1 },
94-
{ "joints":[-0.4103904, 0.33332264, -1.5417944, -5.380291e-06, -1.9328799, -0.41031334], "label_id":4 }
95-
],
96-
"timeline":[
97-
{ "type":"home", "waypoint_id":2 },
98-
{ "type":"trajectory", "trajectory":"joint_space", "waypoint_id":1 },
99-
{ "type":"trajectory", "trajectory":"joint_space", "waypoint_id":0 },
100-
{ "type":"trajectory", "trajectory":"joint_space", "waypoint_id":2 }
101-
]
97+
"waypoints": [{
98+
"label_id": 1,
99+
"joints": [0, 0.5235987755982988, -1.7453292519943295, 0, -1.9198621771937625, 0]
100+
}, {
101+
"label_id": 2,
102+
"joints": [0.18392622441053394, 0.8259819316864014, -2.050006151199341, 0.1785774528980255, -1.6037521743774412, -0.549331545829773]
103+
}],
104+
"timeline": [{
105+
"type": "home",
106+
"waypoint_id": 0
107+
}, {
108+
"type": "trajectory",
109+
"trajectory": "joint_space",
110+
"waypoint_id": 1
111+
}, {
112+
"type": "trajectory",
113+
"trajectory": "joint_space",
114+
"waypoint_id": 0
115+
}]
102116
}
103117

104118
eva = Eva(host, token)

examples/eva_example.py

+27-15
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,35 @@
2929
toolpath = {
3030
"metadata": {
3131
"version": 2,
32+
"default_max_speed": 0.25,
3233
"payload": 0,
33-
"default_max_speed": 1.05,
34-
"next_label_id": 5,
35-
"analog_modes": {"i0": "voltage", "i1": "voltage", "o0": "voltage", "o1": "voltage"},
34+
"analog_modes": {
35+
"i0": "voltage",
36+
"i1": "voltage",
37+
"o0": "voltage",
38+
"o1": "voltage"
39+
},
40+
"next_label_id": 3
3641
},
37-
"waypoints": [
38-
{"joints": [-0.68147224, 0.3648368, -1.0703622, 9.354615e-05, -2.4358354, -0.6813218], "label_id": 3},
39-
{"joints": [-0.6350288, 0.25192022, -1.0664424, 0.030407501, -2.2955494, -0.615318], "label_id": 2},
40-
{"joints": [-0.13414459, 0.5361486, -1.280493, -6.992453e-08, -2.3972468, -0.13414553], "label_id": 1},
41-
{"joints": [-0.4103904, 0.33332264, -1.5417944, -5.380291e-06, -1.9328799, -0.41031334], "label_id": 4},
42-
],
43-
"timeline": [
44-
{"type": "home", "waypoint_id": 2},
45-
{"type": "trajectory", "trajectory": "joint_space", "waypoint_id": 1},
46-
{"type": "trajectory", "trajectory": "joint_space", "waypoint_id": 0},
47-
{"type": "trajectory", "trajectory": "joint_space", "waypoint_id": 2},
48-
],
42+
"waypoints": [{
43+
"label_id": 1,
44+
"joints": [0, 0.5235987755982988, -1.7453292519943295, 0, -1.9198621771937625, 0]
45+
}, {
46+
"label_id": 2,
47+
"joints": [0.18392622441053394, 0.8259819316864014, -2.050006151199341, 0.1785774528980255, -1.6037521743774412, -0.549331545829773]
48+
}],
49+
"timeline": [{
50+
"type": "home",
51+
"waypoint_id": 0
52+
}, {
53+
"type": "trajectory",
54+
"trajectory": "joint_space",
55+
"waypoint_id": 1
56+
}, {
57+
"type": "trajectory",
58+
"trajectory": "joint_space",
59+
"waypoint_id": 0
60+
}]
4961
}
5062

5163
with eva.lock():

0 commit comments

Comments
 (0)