diff --git a/builder/image-validate.sh b/builder/image-validate.sh index 2e372fc1..8d13f0f6 100755 --- a/builder/image-validate.sh +++ b/builder/image-validate.sh @@ -20,13 +20,16 @@ export ROS_DISTRO='noetic' export ROS_IP='127.0.0.1' source /opt/ros/${ROS_DISTRO}/setup.bash source /home/pi/catkin_ws/devel/setup.bash +systemctl start roscore cd /home/pi/catkin_ws/src/clover/builder/test/ ./tests.sh ./tests.py ./tests_py3.py -./test_qr.py +[[ $(./test_qr.py) == "Found QRCODE with data Проверка Unicode with center at x=66.0, y=66.0" ]] [[ $(./tests_clever.py) == "Warning: clever package is renamed to clover" ]] # test backwards compatibility +systemctl stop roscore + echo "Move /etc/ld.so.preload back to its original position" mv /etc/ld.so.preload.disabled-for-build /etc/ld.so.preload diff --git a/builder/test/qr.gif b/builder/test/qr.gif deleted file mode 100644 index 21abbb04..00000000 Binary files a/builder/test/qr.gif and /dev/null differ diff --git a/builder/test/qr.png b/builder/test/qr.png new file mode 100644 index 00000000..4044d85d Binary files /dev/null and b/builder/test/qr.png differ diff --git a/builder/test/test_qr.py b/builder/test/test_qr.py index 438e18ac..ca9fa7db 100755 --- a/builder/test/test_qr.py +++ b/builder/test/test_qr.py @@ -23,17 +23,17 @@ def image_callback(data): xc = x + w/2 yc = y + h/2 print("Found {} with data {} with center at x={}, y={}".format(b_type, b_data, xc, yc)) - rospy.signal_shutdown() + rospy.signal_shutdown('done') image_sub = rospy.Subscriber('main_camera/image_raw', Image, image_callback, queue_size=1) # ============================================================================== # Publish test image -print('Testing QR code recognition') +rospy.sleep(2) import cv2 -img = cv2.imread('qr.gif') -image_pub = rospy.Publisher('main_camera/image_raw', Image) -image_pub.publish(bridge.cv2_to_imgmsg(img)) +img = cv2.imread('qr.png') +image_pub = rospy.Publisher('/main_camera/image_raw', Image, queue_size=1, latch=True) +image_pub.publish(bridge.cv2_to_imgmsg(img, 'bgr8')) rospy.spin()