This commit is contained in:
2929ss 2022-07-30 12:03:09 +08:00
parent d36a23ab9a
commit 8d254c271d
3 changed files with 12 additions and 10 deletions

View file

@ -49,15 +49,16 @@ def take_photo():
def cut_photo():
path1 = '/home/ubuntu/catkin_ws/src/mycobot_ros/mycobot_ai/ai_mecharm_270/'
path2 = '/home/h/catkin_ws/src/mycobot_ros/mycobot_ai/ai_mecharm_270/'
path1 = '/home/ubuntu/catkin_ws/src/mycobot_ros/mycobot_ai/ai_mecharm_270/' # pi
path2 = '/home/h/catkin_ws/src/mycobot_ros/mycobot_ai/ai_mecharm_270/' # m5
if os.path.exists(path1):
path = path1
elif os.path.exists(path2):
path = path2
else:
print("invalid path!")
print("invalid file path! Please check whether the file path exists or modify it!")
path_red = path+'/res/red'
for i, j, k in os.walk(path_red):

View file

@ -49,16 +49,16 @@ def take_photo():
def cut_photo():
path1 = '/home/ubuntu/catkin_ws/src/mycobot_ros/mycobot_ai/ai_mycobot_280/'
path2 = '/home/h/catkin_ws/src/mycobot_ros/mycobot_ai/ai_mycobot_280/'
path1 = '/home/ubuntu/catkin_ws/src/mycobot_ros/mycobot_ai/ai_mycobot_280/' # pi
path2 = '/home/h/catkin_ws/src/mycobot_ros/mycobot_ai/ai_mycobot_280/' # m5
if os.path.exists(path1):
path = path1
elif os.path.exists(path2):
path = path2
else:
print("invalid path!")
print("invalid file path! Please check whether the file path exists or modify it!")
path_red = path + '/res/red'
for i, j, k in os.walk(path_red):
file_len_red = len(k)

View file

@ -49,15 +49,16 @@ def take_photo():
def cut_photo():
path1 = '/home/ubuntu/catkin_ws/src/mycobot_ros/mycobot_ai/ai_mypalletizer_260/'
path2 = '/home/h/catkin_ws/src/mycobot_ros/mycobot_ai/ai_mypalletizer_260/'
path1 = '/home/ubuntu/catkin_ws/src/mycobot_ros/mycobot_ai/ai_mypalletizer_260/' # pi
path2 = '/home/h/catkin_ws/src/mycobot_ros/mycobot_ai/ai_mypalletizer_260/' # m5
if os.path.exists(path1):
path = path1
elif os.path.exists(path2):
path = path2
else:
print("invalid path!")
print("invalid file path! Please check whether the file path exists or modify it!")
path_red = path + '/res/red'
for i, j, k in os.walk(path_red):