Skip to content

Commit ad3268d

Browse files
committed
append photos
1 parent ae2b3ae commit ad3268d

File tree

7 files changed

+28
-4
lines changed

7 files changed

+28
-4
lines changed

core

37.9 MB
Binary file not shown.

photos/6.jpg

72.6 KB
Loading

photos/7.jpg

74.7 KB
Loading

photos/8.jpg

71.4 KB
Loading

smile_test.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import rospy
2+
from sensor_msgs.msg import Image
3+
import sys
4+
sys.path.insert(1, '/usr/local/lib/python3.5/dist-packages')
5+
6+
import cv2
7+
import ros_numpy
8+
9+
if __name__ == '__main__':
10+
rospy.init_node('smile_test')
11+
12+
photo_folder = 'photos'
13+
14+
pub = rospy.Publisher('/vision_camera_capture/image', Image, queue_size=1)
15+
16+
while True:
17+
ans = input('image name: ')
18+
try:
19+
frame = cv2.imread(photo_folder + '/' + ans)
20+
img = ros_numpy.msgify(Image, frame, encoding='rgb8')
21+
pub.publish(img)
22+
except Exception as e:
23+
print('photo not found or ', str(e))

test_servos2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def callback_photo(data: Image):
5656
print('image saving error: ', str(e))
5757

5858

59-
get_im_sub = rospy.Subscriber('/vision_face_tracking/face_image', Image, lock_recognize.callback)
59+
get_im_sub = rospy.Subscriber('/vision_face_tracking/face_image', Image, callback_photo)
6060
time.sleep(1)
6161
get_im_sub.unregister()
6262

@@ -85,9 +85,9 @@ def control_head():
8585
hp.move_v_angle(-step)
8686
elif ans == 's':
8787
hp.move_v_angle(step)
88-
elif ans == 'l':
88+
elif ans == 'a':
8989
hp.move_h_angle(step)
90-
elif ans == 'r':
90+
elif ans == 'd':
9191
hp.move_h_angle(-step)
9292
else:
9393
pass

try_cam.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
2-
2+
import sys
3+
sys.path.insert(1, '/usr/local/lib/python3.5/dist-packages')
34
import cv2
45

56
if __name__ == '__main__':

0 commit comments

Comments
 (0)