mirror of
https://github.com/elephantrobotics/mycobot_ros.git
synced 2026-07-05 19:47:04 +00:00
optimize
This commit is contained in:
parent
d36a23ab9a
commit
8d254c271d
3 changed files with 12 additions and 10 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue