0
  • 聊天消息
  • 系統(tǒng)消息
  • 評(píng)論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會(huì)員中心
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識(shí)你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

使用ChatGPT學(xué)習(xí)大象機(jī)器人六軸協(xié)作機(jī)械臂mechArm!

大象機(jī)器人科技 ? 來源:大象機(jī)器人科技 ? 作者:大象機(jī)器人科技 ? 2024-01-31 14:39 ? 次閱讀

引言
我是一名機(jī)器人方向的大學(xué)生,近期學(xué)校安排自主做一個(gè)機(jī)器人方面相關(guān)的項(xiàng)目。學(xué)校給我們提供了一個(gè)小型的六軸機(jī)械臂,mechArm 270M5Stack,我打算使用ChatGPT讓它來輔助我學(xué)習(xí)如何使用這個(gè)機(jī)械臂并且做一個(gè)demo。

本篇文章將記錄我是如何使用ChatGPT來學(xué)習(xí)機(jī)械臂的使用。

ChatGPT
ChatGPT 是由 OpenAI 開發(fā)的一個(gè)先進(jìn)的人工智能對(duì)話系統(tǒng)。它基于大規(guī)模語言模型 GPT(Generative Pretrained Transformer)技術(shù),能夠理解和生成自然語言文本。ChatGPT 能夠進(jìn)行多種交互,包括回答問題、提供解釋、撰寫文本、編程協(xié)助等。它的設(shè)計(jì)目的是為了模擬人類在特定領(lǐng)域或?qū)υ捴械谋憩F(xiàn),從而提供高質(zhì)量的、類人的交流體驗(yàn)。

ChatGPT 如何幫助學(xué)習(xí)新知識(shí):

個(gè)性化教學(xué):根據(jù)用戶的問題和回答,ChatGPT 能夠個(gè)性化地提供信息,使學(xué)習(xí)過程更加符合用戶的需求和水平。
理論與實(shí)例結(jié)合:ChatGPT 不僅能提供理論知識(shí),還能結(jié)合實(shí)際案例來解釋復(fù)雜概念,幫助用戶更好地理解和記憶。
步驟指導(dǎo):對(duì)于復(fù)雜任務(wù)或問題,ChatGPT 可以提供分步驟的指導(dǎo)和建議,幫助用戶逐漸掌握技能。
資源推薦:ChatGPT 還能推薦書籍、在線課程、文章等資源,幫助用戶深入學(xué)習(xí)。
學(xué)習(xí)的過程Process
首先我得賦予他一個(gè)身份,一個(gè)角色,這樣的話它的回答才能不會(huì)特別的偏離我們的主題。

me: You are now a senior teacher in robotics. I will ask you some questions to help me learn a robotic arm. ChatGPT: That sounds great! I'm here to help with your questions about robotic arms. Whether it's about their design, operation, programming, or applications, feel free to ask. Let's get started!

在此之間我已經(jīng)對(duì)機(jī)器人相關(guān)的知識(shí)有所了解了,直接讓它給我調(diào)查我現(xiàn)在這款機(jī)械臂是什么該如何使用。然后它就提供了一些機(jī)械臂的參數(shù),以及編程環(huán)境等等

me: Do you know the mechArm 270 MechArm, a product of Elephant Robotics? My instructor gave us one to use for a case study. I wanted to know the basic information about this robotic arm first. ChatGPT: ... Specifications: Payload Capacity: Up to 250 grams. Reach: 270mm. Degrees of Freedom (DoF): 6, via 6 magnetic encoder motors. Movement Speed: Up to 120°/s. Positioning Accuracy: ±1 mm. Controller: Raspberry Pi 4 Model B, featuring quad-core Cortex-A72 processor, dual-band WiFi 5, and Bluetooth 5.0 connectivity. Supported Cameras: Official Raspberry Pi cameras or third-party USB cameras. USB Ports: 2 USB 3.0 ports, 2 USB 2.0 ports. Power Input: 8-12V/5A DC jack. Weight: Approximately 1 kilogram. Expansion Options: 40-pin GPIO header ...

mechArm 270
經(jīng)過較詳細(xì)的匯總,我就得知這是一款桌面型的機(jī)械臂,工作半徑270mm,能夠支持多平臺(tái)的編譯,比較全面的是python編程語言,還附帶一個(gè)豐富的API控制庫方便用戶們的使用。

有40個(gè)GPIO接口,比較適合做一一些非常小型的自動(dòng)化任務(wù),也可以做教育環(huán)境和研究等應(yīng)用。

wKgaomW55ziABcGVAAKtvbJgV1Q703.png

環(huán)境安裝
基于他對(duì)于Python支持的比較多,所以我決定用python來進(jìn)行這個(gè)機(jī)械臂的學(xué)習(xí)。

操作系統(tǒng):window11 編程語言: python3.9+ 主要使用的功能庫:pymycobot


pymycobot的使用
ChatGPT介紹了一個(gè)基本的使用,從安裝到使用都有。

安裝庫

pip install pymycobot

基礎(chǔ)使用

導(dǎo)入使用的庫

#import library

from pymycobot.mycobot import MyCobot

初始化機(jī)械臂,建立連接

#Initialize the Robot Arm

```

Connect the mechArm to your computer.

Initialize the robotic arm by specifying the port it's connected to and the baud rate

```

mc = MyCobot('com3',115200)

基礎(chǔ)命令

Move the Arm: Use methods like send_angles to control the arm's position. For example, to move the arm to a specific angle:

mc.send_angles([0, 0, 0, 0, 0, 0], 100) # Angles for each joint, Speed

Get Current Position: To read the current position of the arm:

angles = mc.get_angles()

print(angles)

Control the Gripper: To open or close the gripper:

mc.set_gripper_state(1, 50) # 1 for open, 0 for close, Speed

以上是ChatGPT給我提供的一些使用的基礎(chǔ)方法,我來嘗試一下按照他的步驟來進(jìn)行控制機(jī)械臂。

wKgaomW56EqAdmjXAADTAzGgNgU081.png

wKgaomW56ECALPkWABotXluqtEE982.png

然后我自己嘗試了使用代碼控制機(jī)械臂做一個(gè)循環(huán)動(dòng)作。

import time from pymycobot.mycobot import MyCobot #Initialize the Robot Arm mc = MyCobot('com13',115200) time.sleep(3) for count in range(3): mc.send_angles([57.21,(-2.1),19.33,(-81.29),(-73.65),(-1.14)],80) time.sleep(1) mc.send_angles([(-9.05),(-1.93),9.05,2.63,(-2.28),(-0.26)],80) time.sleep(1) mc.send_angles([5.36,(-41.57),(-17.31),11.07,(-55.54),(-1.49)],80) time.sleep(1)

wKgZomW56NCAX62yAFfNPIPoiIs541.png

這是一些角度控制機(jī)械臂運(yùn)動(dòng),單獨(dú)控制角度的話我覺得只能做一些固定的動(dòng)作,對(duì)于一些應(yīng)用場(chǎng)景應(yīng)該不是特別的實(shí)用。于是我問,還有什么其他的控制方法能夠適用于物體抓圖的運(yùn)動(dòng)。

chat

me: Controlling the movement of the angle is only applicable to some special points and postures. For some object grabbing scenes, these unfixed points should not be used. Is there any other method of control? Chatgpt: Absolutely, for scenarios where controlling the robotic arm based on specific angles isn't practical, especially in object grabbing and manipulation tasks, there are alternative control methods that can be more effective: 1. Cartesian (Coordinate) Control: Description: This method involves controlling the robotic arm by specifying the position of the end effector in Cartesian coordinates (X, Y, Z), along with orientation (roll, pitch, yaw). Usage: In Python, using the pymycobot library, you can command the robotic arm to move to a specific Cartesian coordinate. The command might look like:

讓我來嘗試send_coords()這個(gè)方法是怎么運(yùn)轉(zhuǎn)的,下面是我寫的代碼在機(jī)械臂的末端位置上作出運(yùn)動(dòng)。

class MechArm: def __init__(self,port): #初始化鏈接 self.mc = MyCobot(port, 115200) self.coords = [116.4, -0.1, 178.4, -179.68, 6.5, -179.43] self.speed = 40 self.mode = 0 def increment_x_and_send(self, increment=20): # 增加x值并發(fā)送新坐標(biāo) self.coords[0] += increment self.mc.send_coords(self.coords, self.speed, self.mode) def increment_y_send(self,increment=20): self.coords[1] += increment self.mc.send_coords(self.coords,self.speed, self.mode)

wKgZomW56aCALtq6ABLJn6MQDyk311.png

我發(fā)現(xiàn)在控制機(jī)械臂的時(shí)候,有些指令會(huì)被吞掉,導(dǎo)致機(jī)械臂沒有辦法運(yùn)動(dòng)。解決的辦法就是需要添加一個(gè)等待時(shí)間,等待的時(shí)間需要大于機(jī)械臂運(yùn)動(dòng)的時(shí)間才能夠保證運(yùn)動(dòng)完全執(zhí)行完。

time.sleep(s) # run code mc = RobotArmController('com13') mc.init_p() time.sleep(3) mc.increment_x_and_send() time.sleep(1) mc.increment_y_send() time.sleep(1) mc.increment_x_and_send() time.sleep(1) mc.increment_y_send()

進(jìn)階使用
我打算用吸泵來抓取一些東西,之后想做一個(gè)視覺的場(chǎng)景結(jié)合起來。mechArm有40個(gè)IO接口可以外接一些設(shè)備使用,比如說吸泵,夾爪等等工具。

wKgaomW56cOAY-tYAALQPy4lg9Y506.png

給末端裝上吸泵然后就可以開始實(shí)踐了。我得找到調(diào)用吸泵的方法,pymycobot里面的API太多了,我直接讓ChatGPT來幫助我知道吸泵。

me: How to call the suction pump? ChatGPT: Control Commands: Activate the Suction Pump: To turn on the suction pump, you might send a command to set a specific IO port to HIGH. The exact command will depend on how the suction pump is connected to the controller. python mc.set_basic_output(1,0) # Example: Setting pin 1 to HIGH (0) Deactivate the Suction Pump: To turn off the suction pump, you would send a command to set the IO port to LOW. python Copy code mc.set_basic_output(1, 1) # Example: Setting pin 1 to LOW (1) Integrate with Movement Commands: You would typically integrate these commands into a sequence where the robotic arm moves to a target location, activates the suction pump to pick up an object, moves to a new location, and then deactivates the pump to release the object.

wKgZomW56gaAKVXmAAMPBy177k0112.png

現(xiàn)在我們來創(chuàng)建函數(shù)來控制吸泵的開關(guān)。

def pump_on(self): self.mc.set_basic_output(5,0) def pump_off(self): self.mc.set_basic_output(5,1) mc.initial_position() time.sleep(2) mc.pick_up_postion() time.sleep(2) mc.pump_on() time.sleep(1) mc.increment_z_send() time.sleep(3) mc.pump_off()

wKgaomW56iOAeCTWABP46DB-9c0679.png

本次先記錄到這里,之后我打算結(jié)合攝像頭做一些定位抓取的功能。

總結(jié)
隨著人工智能的不斷發(fā)展,它影響的不單單是科技方面,還影響著我們生活中的點(diǎn)點(diǎn)滴滴。它很大程度上提升了我們的學(xué)習(xí)效率,就拿我來說,如果我要了解一個(gè)新事物肯定得把相關(guān)文檔全部通讀一遍,甚至也不一定能理解到位,有了ChatGPT等許多人工智能的工具,學(xué)習(xí)的方式再也不像之前那樣了,是全新的一種風(fēng)格。及時(shí)是一無所知的機(jī)械臂,也能再很快的上手使用。

審核編輯 黃宇

聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點(diǎn)僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場(chǎng)。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問題,請(qǐng)聯(lián)系本站處理。 舉報(bào)投訴
  • 機(jī)器人
    +關(guān)注

    關(guān)注

    210

    文章

    27838

    瀏覽量

    204577
  • 人工智能
    +關(guān)注

    關(guān)注

    1787

    文章

    46060

    瀏覽量

    234961
  • python
    +關(guān)注

    關(guān)注

    53

    文章

    4753

    瀏覽量

    84071
  • 機(jī)械臂
    +關(guān)注

    關(guān)注

    12

    文章

    502

    瀏覽量

    24292
收藏 人收藏

    評(píng)論

    相關(guān)推薦

    大象機(jī)器人開源協(xié)作機(jī)械機(jī)械接入GPT4o大模型!

    和智能化的任務(wù),提升了人機(jī)協(xié)作的效率和效果。我們個(gè)人平時(shí)接觸不太到機(jī)械這類的機(jī)器人產(chǎn)品,但是有一種小型的機(jī)械
    的頭像 發(fā)表于 07-03 14:09 ?541次閱讀
    <b class='flag-5'>大象</b><b class='flag-5'>機(jī)器人</b>開源<b class='flag-5'>協(xié)作</b><b class='flag-5'>機(jī)械</b><b class='flag-5'>臂</b><b class='flag-5'>機(jī)械</b><b class='flag-5'>臂</b>接入GPT4o大模型!

    基于維力傳感器的機(jī)械自動(dòng)裝配應(yīng)用

    外部環(huán)境的關(guān)鍵裝置,維力傳感器通常安裝于機(jī)器末端執(zhí)行器與機(jī)械之間,用于檢測(cè)作業(yè)中的機(jī)器人
    的頭像 發(fā)表于 06-06 13:49 ?426次閱讀
    基于<b class='flag-5'>六</b>維力傳感器的<b class='flag-5'>機(jī)械</b><b class='flag-5'>臂</b>自動(dòng)裝配應(yīng)用

    焊接機(jī)器人的操作流程

    隨著工業(yè)自動(dòng)化的不斷發(fā)展,焊接技術(shù)也迎來了革命性的變革。焊接機(jī)器人憑借其高精度、高效率和高穩(wěn)定性的特點(diǎn),在眾多行業(yè)中得到了廣泛應(yīng)用。
    的頭像 發(fā)表于 04-29 09:56 ?543次閱讀
    <b class='flag-5'>六</b><b class='flag-5'>軸</b>焊接<b class='flag-5'>機(jī)器人</b>的操作流程

    大象機(jī)器人開源協(xié)作機(jī)械myCobot 630 全面升級(jí)!

    1. 開篇概述 在快速發(fā)展的機(jī)器人技術(shù)領(lǐng)域中,Elephant Robotics的myCobot 600已經(jīng)證明了其在教育、科研和輕工業(yè)領(lǐng)域的顯著適用性。作為一款具備自由度的機(jī)械,
    的頭像 發(fā)表于 04-28 15:19 ?793次閱讀
    <b class='flag-5'>大象</b><b class='flag-5'>機(jī)器人</b>開源<b class='flag-5'>協(xié)作</b><b class='flag-5'>機(jī)械</b><b class='flag-5'>臂</b>myCobot 630 全面升級(jí)!

    自然語言控制機(jī)械ChatGPT機(jī)器人技術(shù)的融合創(chuàng)新(下)

    和Google的Speech-to-text服務(wù),以及我們是如何通過pymycobot模塊來控制機(jī)械的。通過將自然語言處理和機(jī)械控制相結(jié)合,我們的項(xiàng)目旨在降低
    的頭像 發(fā)表于 04-11 15:54 ?613次閱讀
    自然語言控制<b class='flag-5'>機(jī)械</b><b class='flag-5'>臂</b>:<b class='flag-5'>ChatGPT</b>與<b class='flag-5'>機(jī)器人</b>技術(shù)的融合創(chuàng)新(下)

    大象機(jī)器人協(xié)作機(jī)械myCobot 320 進(jìn)行手勢(shì)識(shí)別!

    引言 我是一名專注于機(jī)器學(xué)習(xí)機(jī)器人技術(shù)自由者。我的熱情始于大學(xué)期間的人工智能課程,這促使我探索人機(jī)交互的新方法。尤其對(duì)于機(jī)械的操作,我一
    的頭像 發(fā)表于 01-31 16:17 ?560次閱讀
    <b class='flag-5'>大象</b><b class='flag-5'>機(jī)器人</b><b class='flag-5'>六</b><b class='flag-5'>軸</b><b class='flag-5'>協(xié)作</b><b class='flag-5'>機(jī)械</b><b class='flag-5'>臂</b>myCobot 320 進(jìn)行手勢(shì)識(shí)別!

    自動(dòng)化革命:大象機(jī)器人的Mercury A1機(jī)械

    引言 大象機(jī)器人的Mercury系列,是面向工業(yè)自動(dòng)化和智能制造的新型機(jī)械產(chǎn)品線。這些機(jī)械
    的頭像 發(fā)表于 01-15 14:41 ?554次閱讀
    自動(dòng)化革命:<b class='flag-5'>大象</b><b class='flag-5'>機(jī)器人</b>的Mercury A1<b class='flag-5'>機(jī)械</b><b class='flag-5'>臂</b>

    ?大象機(jī)器人首發(fā)萬元級(jí)水星Mercury人形機(jī)器人系列

    水星Mercury機(jī)器人系列共有三款產(chǎn)品:水星Mercury A1 七協(xié)作機(jī)械和水星Mercury B1半人形雙臂
    發(fā)表于 01-03 09:59 ?207次閱讀
    ?<b class='flag-5'>大象</b><b class='flag-5'>機(jī)器人</b>首發(fā)萬元級(jí)水星Mercury人形<b class='flag-5'>機(jī)器人</b>系列

    LabVIEW的工業(yè)機(jī)器人運(yùn)動(dòng)控制系統(tǒng)

    LabVIEW開發(fā)工業(yè)機(jī)器人運(yùn)動(dòng)控制系統(tǒng) 本項(xiàng)目開發(fā)了一個(gè)高效的工業(yè)機(jī)器人控制系統(tǒng),重點(diǎn)關(guān)注于運(yùn)動(dòng)學(xué)算法和軌跡規(guī)劃算法的實(shí)現(xiàn)和測(cè)試。LabVIEW作為一個(gè)關(guān)鍵技術(shù),在項(xiàng)目中扮演了核
    發(fā)表于 12-21 20:03

    開源協(xié)作機(jī)械MechArm案例演示!

    介紹 今天,我將向大家展示一個(gè)我獨(dú)立設(shè)計(jì)并實(shí)現(xiàn)的機(jī)械模型。這個(gè)模型的核心功能是實(shí)現(xiàn)實(shí)時(shí)的手勢(shì)追蹤——只需用手輕輕拖拽,機(jī)械就能立即跟隨你的動(dòng)作進(jìn)行移動(dòng)。 我之所以想要?jiǎng)?chuàng)造這樣一個(gè)模
    的頭像 發(fā)表于 11-28 15:58 ?742次閱讀
    開源<b class='flag-5'>六</b><b class='flag-5'>軸</b><b class='flag-5'>協(xié)作</b><b class='flag-5'>機(jī)械</b><b class='flag-5'>臂</b><b class='flag-5'>MechArm</b>案例演示!

    智慧醫(yī)療的新翼-雙臂14協(xié)作機(jī)器人的崛起與應(yīng)用

    雙臂14協(xié)作機(jī)器人是指擁有兩個(gè)獨(dú)立操作,每個(gè)含有7個(gè)自由度,總共14個(gè)運(yùn)動(dòng)
    的頭像 發(fā)表于 11-22 10:11 ?423次閱讀
    智慧醫(yī)療的新翼-雙臂14<b class='flag-5'>軸</b><b class='flag-5'>協(xié)作</b><b class='flag-5'>機(jī)器人</b>的崛起與應(yīng)用

    機(jī)械焊接機(jī)器人軌跡控制原理

    隨著制造業(yè)的不斷發(fā)展,機(jī)器人技術(shù)在各個(gè)領(lǐng)域都得到了廣泛應(yīng)用,其中機(jī)械焊接機(jī)器人在汽車制造、電子產(chǎn)品制造等行業(yè)中發(fā)揮著重要作用。機(jī)械
    的頭像 發(fā)表于 11-16 17:20 ?704次閱讀

    掃地機(jī)器人加裝了機(jī)械

    該系統(tǒng)可以實(shí)現(xiàn)機(jī)械手與現(xiàn)有的掃地機(jī)器人無縫集成,只需對(duì)真空機(jī)器人進(jìn)行較少的改動(dòng)即可輕松連接和拆卸機(jī)械手,并在不影響掃地機(jī)器人原始功能的基礎(chǔ)上
    的頭像 發(fā)表于 11-16 10:40 ?872次閱讀
    掃地<b class='flag-5'>機(jī)器人</b>加裝了<b class='flag-5'>六</b><b class='flag-5'>軸</b><b class='flag-5'>機(jī)械</b><b class='flag-5'>臂</b>!

    開源協(xié)作機(jī)械MechArm 拖動(dòng)示教模型案例

    介紹 今天,我將向大家展示一個(gè)我獨(dú)立設(shè)計(jì)并實(shí)現(xiàn)的機(jī)械模型。這個(gè)模型的核心功能是實(shí)現(xiàn)實(shí)時(shí)的手勢(shì)追蹤——只需用手輕輕拖拽,機(jī)械就能立即跟隨你的動(dòng)作進(jìn)行移動(dòng)。 我之所以想要?jiǎng)?chuàng)造這樣一個(gè)模
    的頭像 發(fā)表于 11-06 14:29 ?879次閱讀
    開源<b class='flag-5'>六</b><b class='flag-5'>軸</b><b class='flag-5'>協(xié)作</b><b class='flag-5'>機(jī)械</b><b class='flag-5'>臂</b><b class='flag-5'>MechArm</b> 拖動(dòng)示教模型案例

    華數(shù)機(jī)器布局工業(yè)協(xié)作機(jī)器人,發(fā)布多款工業(yè)協(xié)作機(jī)器人新品

    華數(shù)CR系列工業(yè)協(xié)作機(jī)器人新品負(fù)載覆蓋5-16kg,展覆蓋785-1455mm,工業(yè)協(xié)作機(jī)器人獨(dú)特的設(shè)計(jì)和自主研發(fā)的控制系統(tǒng)賦予了其獨(dú)特的
    的頭像 發(fā)表于 10-09 16:58 ?1321次閱讀
    華數(shù)<b class='flag-5'>機(jī)器</b>布局工業(yè)<b class='flag-5'>協(xié)作</b><b class='flag-5'>機(jī)器人</b>,發(fā)布多款工業(yè)<b class='flag-5'>協(xié)作</b><b class='flag-5'>機(jī)器人</b>新品