WUT Velma robot API
reset_shm_comm.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 
6 
7 import os
8 
9 if __name__ == "__main__":
10 
11  shm_channels = [
12  'EC_Command',
13  'EC_Status',
14  'lLwr_cmd',
15  'lLwr_st',
16  'rLwr_cmd',
17  'rLwr_st',
18  'velma_core_cmd',
19  'velma_core_st',
20  'velma_core_cs_ve_body_cmd',
21  'velma_core_cs_ve_body_st',
22  'velma_core_cmd2',
23  'velma_core_st2',
24  ]
25 
26  shm_files = []
27  for channel_name in shm_channels:
28  shm_files.append( '{}_data'.format(channel_name) )
29  shm_files.append( '{}_hdr'.format(channel_name) )
30 
31  for file_name in shm_files:
32  full_path = '/dev/shm/{}'.format(file_name)
33  if os.path.exists(full_path):
34  os.remove(full_path)
35  print('Removed file "{}"'.format(full_path))
36  else:
37  print('The file "{}" does not exist'.format(full_path))
38 
39  print("Cleanup done.")
40  print("You can now run the control system of Velma.")