How to utilizes APIs provided by robot manufactures and then control the robot

3 ビュー (過去 30 日間)
snow John
snow John 2023 年 11 月 7 日
編集済み: snow John 2024 年 1 月 8 日
Hello ,experts in matlab.
I am very pleased that matlab already has hardware packages that support connecting and controlling UR and kinova robots. However, I am very interested in the specific implementation process.
In other words, if I have the api provided by the robot manufacturer, how can I realize the communication and control with the robot in matlab without using the ROS interface?
Any suggestions or tips on experience are appreciated.
Best regards,
-Jian

採用された回答

Walter Roberson
Walter Roberson 2023 年 11 月 10 日
編集済み: Walter Roberson 2023 年 11 月 10 日
In some cases, manufacturers might provide .NET assemblies. If the ones you are interested in do that, and if you happen to be using MS Windows then see https://www.mathworks.com/help/matlab/getting-started.html .
In some cases, manufacturers might provide ActiveX interfaces. if the ones you are interested in do that, and if you happen to be using MS Windows then see https://www.mathworks.com/help/matlab/using-com-objects-in-matlab.html
  4 件のコメント
snow John
snow John 2023 年 11 月 10 日
Hello sir, thanks for the paper you provide, it is also a great help for my reaserch.
The Diana7 API is from the Agile Robots in China, who recently announced the successful acquisition of robotics company Franka Emika (As i know that Franka Matlab contains the interfacing of the Franka Emika Robot through Matlab & Simulink Franka Matlab — Franka Control Interface (FCI) documentation (frankaemika.github.io)).
And i am just a student user may can not provid the API here.I will continue to explore how to use matlab to communicate and control the diana7 robot through the provided apis(C) by study the existing robot hardware support(UR,Kinova) and interfaces(Franka).
If you have such experence, i am glad to see your reply. If i get the authorization from the Agile Robots i may share the API for you. So with the help of professionals like you, maybe a new member can be added to the family of the hardware pack supported by matlab.
Oh,and in case i don't get your repy,
best regards for everyday.
-Jian
snow John
snow John 2023 年 12 月 16 日
編集済み: snow John 2024 年 1 月 8 日
Hello guys, this time i use the loadlibrary function as below to call the .dll
loadlibrary('DianaApi.dll', 'DianaAPI.h', 'addheader', 'DianaAPIDef.h', 'addheader', 'FunctionOptDef.h', ...
'addheader', 'DianaApiCommon.h', 'addheader', 'DianaApiSpecial.h', 'mfilename', ...
'E:/MatlabWorks/MexForRobot/DianaApi/lib/DianaApi.lib')
however, when run the loadlibrary the error are as follows:
错误使用 loadlibrary
无法对输入文件进行预处理。
预处理器生成的输出为: DianaApi.h
D:\VS studio\VC\Tools\MSVC\14.34.31933\include\yvals_core.h(29): fatal error C1189: #error: Error in C++ Standard Library usage
Can someone tell me how to fix the error? i have vs 2022 and wingw63 installed
mex -setup C++
MEX 配置为使用 'MinGW64 Compiler with Windows 10 SDK or later (C++)' 以进行 C++ 语言编译。
要选择不同的 C++ 编译器,请从以下选项中选择一种命令:
MinGW64 Compiler (C++) mex -setup:D:\matlab\bin\win64\mexopts\mingw64_g++.xml C++
MinGW64 Compiler with Windows 10 SDK or later (C++) mex -setup:C:\Users\Admin\AppData\Roaming\MathWorks\MATLAB\R2022b\mex_C++_win64.xml C++
Microsoft Visual C++ 2022 mex -setup:D:\matlab\bin\win64\mexopts\msvcpp2022.xml C++
According to the error messages. The code inside of the DianaAPI.h are :
#pragma once
#include "DianaAPIDef.h"
#include "FunctionOptDef.h"
#include "DianaApiCommon.h"
#include "DianaApiSpecial.h"
#define LIBRARY_MAIN_VERSION 3
#define LIBRARY_SUB_VERSION 0
The zip file contains more detials about the API files from agile-robot[思灵机器人-链接人工智能与物理世界 (agile-robots.cn)]. Ownership is also vested in agile-robot. Hope it can help with the problem.
Thanks for any reply.
Best regards ~~
-Jian

サインインしてコメントする。

その他の回答 (1 件)

atharva
atharva 2023 年 11 月 10 日
Hey Jian,
I understand that you want to learn about the implementation process of connecting and controlling UR and kinova robots.
You will need Robotics System Toolbox to control your robotic system and go through the below steps -
1.Create an API instance to Connect to the Robot: Create an API instance using your robot's IP address to establish connection with the robot. This involves creating an object in MATLAB that serves as a handle for interacting with the robot.
2.Connect to the Robot: Use the created API instance to connect to the robot. This step is necessary before sending or receiving any commands or data.
3.Get Sensor Data from the Robot: After establishing a connection, you can retrieve sensor data from the robot. This could include information from various sensors like cameras, lidars, encoders, etc., depending on the capabilities of the robot.
4.Control Command Modes: The toolbox allows you to send control commands to the robot to make it move or perform specific tasks. This involves specifying the desired motion or action in the form of control commands.
5.Disconnect from the Robot: Once you have completed your tasks or simulation, it's essential to disconnect from the robot. This releases the resources and ensures a clean termination of the connection.
You can also go through the example Connect to Kinova Gen3 Robot and Manipulate the Arm using MATLAB, this example demonstrates how to connect the Kinova® Gen3 7-DoF Ultralightweight Robot arm to MATLAB and Simulink. This also helps you to get feedback from the robot and to send control commands.
You can also go through the mathworks documentation of Robotics System Toolbox https://www.mathworks.com/help/releases/R2019b/robotics/index.html
I hope this helps!
  1 件のコメント
snow John
snow John 2023 年 11 月 10 日
Thanks for your GTP style reply.
That's actually a pretty good answer, but it's still not what I expected.
Perhaps going deeper into the implementation details of UR and Kinova is something I need further work on.

サインインしてコメントする。

製品


リリース

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by