-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkinova_create_protection_zone.py
More file actions
39 lines (34 loc) · 1.08 KB
/
Copy pathkinova_create_protection_zone.py
File metadata and controls
39 lines (34 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from utils.kinova_protection_zone import *
from utils.create_zone_shape import *
from utils.kinova_misc import *
def del_all_zones():
"""
Delete all protection zones apart from the base protection zone
"""
global zone_list
for zone in zone_list:
delete_protection_zone(zone.handle)
def create_new_zone():
"""
Create a new protection zone after creating a zone shape
:return:
"""
zsw = ZoneShapeWrapper()
zsw.create_from_scratch()
# Create the protection zone
create_protection_zone(name='human_zone', application_data="", shape=zsw.instance)
print "========== Creation complete =========="
zone_list = read_all_zones()
print zone_list
def update_zone(zone_name):
global zone_list
for zone in zone_list:
if zone.name == zone_name:
# Do your adjustments here
# For example, you can adjust the dimensions
zone.shape.dimensions = [0.2, 0.1]
update_protection_zone(zone)
launch_windows()
# Use any of the functions above
zone_list = read_all_zones()
print zone_list