本文涉及到的產(chǎn)品
1 mechArm 270
2 mycobot 280
3 mypalletizer 260
4 AI kit
主題內(nèi)容
今天的文章的主題主要介紹一下跟aikit 套件搭配的三款機(jī)械臂,它們之間分別有什么不一樣的地方。
前言
假如說你有一臺機(jī)械臂的話,你會用它來干什么呢?簡單的控制機(jī)械臂動一動;讓它重復(fù)執(zhí)行某個軌跡;還是讓它能夠在工業(yè)上代替人類去工作。在隨著時代的進(jìn)步,機(jī)器人頻繁的出現(xiàn)在我們的周圍,它們代替我們從事危險的工作,服務(wù)人類等。今天我們一起來看一下,機(jī)械臂是如何在一個放工業(yè)場景中進(jìn)行工作的。
介紹
what is AI kit?
人工智能套裝是集視覺、定位抓取、自動分揀模塊為一體的入門級人工智能套裝。
基于Linux系統(tǒng),在ROS搭建1:1仿真模型,可通過開發(fā)軟件實(shí)現(xiàn)機(jī)械臂的控制,能夠快速入門學(xué)習(xí)人工智能基礎(chǔ)知識。
目前我們的人工智能套裝可以實(shí)現(xiàn)對顏色識別和抓取,對圖像識別和抓取。
該套件對于剛?cè)腴T機(jī)械臂,機(jī)器視覺的用戶來說是非常有幫助的,能夠帶你快速的了解人工智能項目是如何搭建起來的,進(jìn)一步的了解機(jī)器視覺是如何跟機(jī)械臂進(jìn)行聯(lián)動的。
接下來我們簡單了解一下,能夠與aikit套裝適配的三款機(jī)械臂
機(jī)械臂
myPalletizer 260
myPalletizer260是一款四軸的碼垛機(jī)械臂,全包裹輕量級四軸碼垛機(jī)械臂,整體去鰭設(shè)計,小巧緊湊,便于攜帶。myPalletizer本體重量960g,負(fù)載250g,工作半徑260mm,專為創(chuàng)客,教育設(shè)計,有豐富的擴(kuò)展接口,ai套件模擬工業(yè)場景,可以進(jìn)行機(jī)器視覺的學(xué)習(xí)。t 套裝適配的三款機(jī)械臂
mechArm 270
mechArm 270 是一款小六軸機(jī)械臂,結(jié)構(gòu)是中心對稱結(jié)構(gòu)(仿工業(yè)結(jié)構(gòu))。mechArm 270本體重量1kg, 負(fù)載250g,工作半徑270mm,設(shè)計緊湊便攜,小巧但功能強(qiáng)大,操作簡單,能與人協(xié)同、安全工作。
myCobot 280
myCobot 280 是世界上最小最輕的六軸協(xié)作機(jī)械臂(UR結(jié)構(gòu)),可以根據(jù)用戶需求進(jìn)行二次開發(fā),實(shí)現(xiàn)用戶個性化定制。myCobot 本體自重850g,有效負(fù)載250g,有效工作半徑280mm,體積小巧但功能強(qiáng)大,既可搭配多種末端執(zhí)行器適配多種應(yīng)用場景,也可支持多平臺軟件的二次開發(fā),滿足科研教育、智能家居,商業(yè)探索等各種場景需求。
我們先來看個視頻aikit 是如何跟這三款機(jī)械臂運(yùn)行的。
內(nèi)容
視頻地址:https://youtu.be/9J2reiPYNxg
視頻內(nèi)容展現(xiàn)了,顏色識別和智能分揀功能,還有圖像識別和智能分揀功能。
我們簡單介紹一下 aikit 是如何實(shí)現(xiàn)的。(以顏色識別和智能分揀功能為例)
該人工智能項目主要運(yùn)用到了兩個模塊
●視覺處理模塊
●計算模塊(處理eye to hand的之間的換算)
視覺處理模塊:
OpenCV (Open Source Computer Vision) 是一個開源的計算機(jī)視覺庫,用于開發(fā)計算機(jī)視覺應(yīng)用程序。OpenCV 包含了大量用于圖像處理、視頻分析、基于深度學(xué)習(xí)的目標(biāo)檢測和識別等功能的函數(shù)和算法。
我們使用了OpenCV來對圖像進(jìn)行處理。從攝像頭得到的視頻進(jìn)行處理,從而獲取視頻中的信息例如顏色,圖像,視頻中的平面坐標(biāo)(x,y)等。將獲取到的信息傳遞給處理器進(jìn)行下一步的處理。
下面是處理圖像的部分代碼(顏色識別)
# detect cube color def color_detect(self, img): # set the arrangement of color'HSV x = y = 0 gs_img = cv2.GaussianBlur(img, (3, 3), 0) # Gaussian blur # transfrom the img to model of gray hsv = cv2.cvtColor(gs_img, cv2.COLOR_BGR2HSV) for mycolor, item in self.HSV.items(): redLower = np.array(item[0]) redUpper = np.array(item[1]) # wipe off all color expect color in range mask = cv2.inRange(hsv, item[0], item[1]) # a etching operation on a picture to remove edge roughness erosion = cv2.erode(mask, np.ones((1, 1), np.uint8), iterations=2) # the image for expansion operation, its role is to deepen the color depth in the picture dilation = cv2.dilate(erosion, np.ones( (1, 1), np.uint8), iterations=2) # adds pixels to the image target = cv2.bitwise_and(img, img, mask=dilation) # the filtered image is transformed into a binary image and placed in binary ret, binary = cv2.threshold(dilation, 127, 255, cv2.THRESH_BINARY) # get the contour coordinates of the image, where contours is the coordinate value, here only the contour is detected contours, hierarchy = cv2.findContours( dilation, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) if len(contours) > 0: # do something about misidentification boxes = [ box for box in [cv2.boundingRect(c) for c in contours] if min(img.shape[0], img.shape[1]) / 10 < min(box[2], box[3]) < min(img.shape[0], img.shape[1]) / 1 ] if boxes: for box in boxes: x, y, w, h = box # find the largest object that fits the requirements c = max(contours, key=cv2.contourArea) # get the lower left and upper right points of the positioning object x, y, w, h = cv2.boundingRect(c) # locate the target by drawing rectangle cv2.rectangle(img, (x, y), (x+w, y+h), (153, 153, 0), 2) # calculate the rectangle center x, y = (x*2+w)/2, (y*2+h)/2 # calculate the real coordinates of mycobot relative to the target if mycolor == "red": self.color = 0 elif mycolor == "green": self.color = 1 elif mycolor == "cyan" or mycolor == "blue": self.color = 2 else: self.color = 3 if abs(x) + abs(y) > 0: return x, y else: return None
只是獲取我們的圖像信息還不夠,得處理得到的信息,傳遞給機(jī)械臂去執(zhí)行命令。這里就運(yùn)用到了計算模塊。
計算模塊
NumPy (Numerical Python) 是一個開源的 Python 庫,主要用于數(shù)學(xué)計算。NumPy 提供了大量用于科學(xué)計算的函數(shù)和算法,包括矩陣運(yùn)算、線性代數(shù)、隨機(jī)數(shù)生成、傅里葉變換等。
我們要處理圖像上的坐標(biāo),換算成真實(shí)的坐標(biāo),這有一個專業(yè)名詞就是eye to hand。我們用python通過numpy計算庫來計算我們的坐標(biāo),最后發(fā)送給機(jī)械臂去執(zhí)行分揀。
下面是計算的部分代碼
while cv2.waitKey(1) < 0: # read camera _, frame = cap.read() # deal img frame = detect.transform_frame(frame) if _init_ > 0: _init_ -= 1 continue # calculate the parameters of camera clipping if init_num < 20: if detect.get_calculate_params(frame) is None: cv2.imshow("figure", frame) continue else: x1, x2, y1, y2 = detect.get_calculate_params(frame) detect.draw_marker(frame, x1, y1) detect.draw_marker(frame, x2, y2) detect.sum_x1 += x1 detect.sum_x2 += x2 detect.sum_y1 += y1 detect.sum_y2 += y2 init_num += 1 continue elif init_num == 20: detect.set_cut_params( (detect.sum_x1)/20.0, (detect.sum_y1)/20.0, (detect.sum_x2)/20.0, (detect.sum_y2)/20.0, ) detect.sum_x1 = detect.sum_x2 = detect.sum_y1 = detect.sum_y2 = 0 init_num += 1 continue # calculate params of the coords between cube and mycobot if nparams < 10: if detect.get_calculate_params(frame) is None: cv2.imshow("figure", frame) continue else: x1, x2, y1, y2 = detect.get_calculate_params(frame) detect.draw_marker(frame, x1, y1) detect.draw_marker(frame, x2, y2) detect.sum_x1 += x1 detect.sum_x2 += x2 detect.sum_y1 += y1 detect.sum_y2 += y2 nparams += 1 continue elif nparams == 10: nparams += 1 # calculate and set params of calculating real coord between cube and mycobot detect.set_params( (detect.sum_x1+detect.sum_x2)/20.0, (detect.sum_y1+detect.sum_y2)/20.0, abs(detect.sum_x1-detect.sum_x2)/10.0 + abs(detect.sum_y1-detect.sum_y2)/10.0 ) print ("ok") continue # get detect result detect_result = detect.color_detect(frame) if detect_result is None: cv2.imshow("figure", frame) continue else: x, y = detect_result # calculate real coord between cube and mycobot real_x, real_y = detect.get_position(x, y) if num == 20: detect.pub_marker(real_sx/20.0/1000.0, real_sy/20.0/1000.0) detect.decide_move(real_sx/20.0, real_sy/20.0, detect.color) num = real_sx = real_sy = 0 else: num += 1 real_sy += real_y real_sx += real_x
我們的項目是開源的可以在GitHub上找到
https://github.com/elephantrobotics/mycobot_ros/blob/noetic/mycobot_ai/ai_mycobot_280/scripts/advance_detect_obj_color.py
區(qū)別
在比較了視頻和內(nèi)容還有程序的代碼,這三款機(jī)械臂的框架是一樣的,只需要在數(shù)據(jù)上稍微作以修改就能夠運(yùn)行成功。
比較這三款機(jī)械臂有什么不同,大致有兩點(diǎn)。
其一本質(zhì)上就是來比較四軸和六軸的機(jī)械臂在實(shí)際的運(yùn)用中有什么不同點(diǎn)。(myPalletizer 和mechArm/myCobot之間的對比)
我們來看一下四軸機(jī)械臂和六軸機(jī)械臂之間粗略的對比
從視頻中可以看出,不論是四軸機(jī)械臂還是六軸機(jī)械臂在AI Kit 所工作的范圍都是足夠的,它們兩者最大的區(qū)別就是在程序啟動的過程中,myPalletizer的動作簡單快捷,只有四個關(guān)節(jié)在運(yùn)動,能夠高效且穩(wěn)定的執(zhí)行任務(wù);myCobot需要調(diào)動六個關(guān)節(jié),比myPalletizer多兩個關(guān)節(jié),在程序中的計算量是比myPalletizer的計算量要大,所花費(fèi)的時間要長一些(小型場景)。
我們簡單總結(jié)一下,在場景固定的情況下,我們在考慮如何選擇機(jī)械臂的時候可以優(yōu)先考慮機(jī)械臂的工作范圍。在符合工作范圍的機(jī)械臂的情況下,高效和穩(wěn)定將是必要的條件。假如說現(xiàn)在有一個工業(yè)場景類似于我們的AI kit的話,四軸機(jī)械臂將會是優(yōu)先選擇。當(dāng)然六軸機(jī)械臂可以在更大的空間范圍內(nèi)操作,并且可以實(shí)現(xiàn)更復(fù)雜的運(yùn)動。它們可以在空間內(nèi)進(jìn)行回轉(zhuǎn)運(yùn)動,而四軸機(jī)械臂則無法做到這一點(diǎn)。因此,六軸機(jī)械臂通常更適合用于需要精確操作、復(fù)雜運(yùn)動的工業(yè)應(yīng)用。
其二兩款都是六軸機(jī)械臂,他們最主要的不同是結(jié)構(gòu)的不同。mechArm是中心對稱結(jié)構(gòu)的機(jī)械臂,myCobot是UR結(jié)構(gòu)的協(xié)作型機(jī)械臂。我們可以比較這兩種結(jié)構(gòu)在實(shí)際運(yùn)用場景中有何不同。
這里是這兩款機(jī)械臂的參數(shù)規(guī)格
這兩者的結(jié)構(gòu)不同導(dǎo)致了它們運(yùn)動的范圍不一樣。以mechArm為例,中心對稱結(jié)構(gòu)的機(jī)械臂是由三對相對的關(guān)節(jié)組成的,每對關(guān)節(jié)的運(yùn)動方向相反。這種結(jié)構(gòu)的機(jī)械臂具有較好的平衡性,能夠抵消關(guān)節(jié)間的力矩,使機(jī)械臂保持穩(wěn)定。
在視頻中展示,mechArm在運(yùn)行中也是比較穩(wěn)定的。
看到這你可能就會產(chǎn)生疑問,那myCobot不就一無是處了嘛?當(dāng)然不是,UR結(jié)構(gòu)的機(jī)械臂更加靈活,能夠?qū)崿F(xiàn)更大范圍的運(yùn)動,適用于較大的應(yīng)用場合。myCobot更重要的一點(diǎn)它是協(xié)作型機(jī)械臂,它具有較好的人機(jī)交互能力,能夠與人類協(xié)作進(jìn)行工作。六軸協(xié)作型機(jī)械臂通常用于生產(chǎn)線上的物流和裝配工作,以及醫(yī)療、研究和教育等領(lǐng)域。
總結(jié)
就如開頭所說,AI kit套裝搭載三款機(jī)械臂的不同本質(zhì)上是如何選擇一款合適的機(jī)械臂來使用。如果你是出于某個特定的場景去選擇機(jī)械臂的話,就需要根據(jù)場景的需求,例如確定機(jī)械臂的工作半徑,使用的環(huán)境,機(jī)械臂的負(fù)載等方面。
如果你是想要學(xué)習(xí)機(jī)械臂相關(guān)知識的話,就可以選擇一款目前市面上主流的機(jī)械臂從而開展學(xué)習(xí)。myPalletizer是以碼垛機(jī)械臂為原型設(shè)計的,主要用于實(shí)現(xiàn)貨物的碼垛和托盤裝卸工作;mechArm 是以主流的工業(yè)型機(jī)械臂為原型設(shè)計的,因為它的結(jié)構(gòu)特殊在運(yùn)行的時候可以保持機(jī)械臂的穩(wěn)定;myCobot是以協(xié)作型機(jī)械臂為原型設(shè)計的,該結(jié)構(gòu)是近年來熱門的機(jī)械臂,能夠與人類協(xié)同工作,可以提供人類的力量和精度。
以上就是本篇文章的全部內(nèi)容了,未來,機(jī)械臂技術(shù)將繼續(xù)發(fā)展,為人類生產(chǎn)、工作、生活帶來更多的便利。如果你喜歡這篇文章請給我們留言點(diǎn)贊!
審核編輯黃宇
-
機(jī)器人
+關(guān)注
關(guān)注
213文章
29707瀏覽量
212696 -
人工智能
+關(guān)注
關(guān)注
1806文章
48987瀏覽量
249083 -
機(jī)械臂
+關(guān)注
關(guān)注
13文章
553瀏覽量
25360
發(fā)布評論請先 登錄
最新人工智能硬件培訓(xùn)AI 基礎(chǔ)入門學(xué)習(xí)課程參考2025版(大模型篇)
開售RK3576 高性能人工智能主板
AI人工智能隱私保護(hù)怎么樣

人工智能和機(jī)器學(xué)習(xí)以及Edge AI的概念與應(yīng)用

評論