Simulink Mex File Integration of UR Control with RTDE

Versione 1.0.0 (37,6 KB) da SMEAC
Easy Universal Robot Control integration into simulink through a mex file project using the ur-rtde
26 download
Aggiornato 18 gen 2024

View Simulink Mex File Integration of UR Control with RTDE on File Exchange

ur_rtde_mex

Simulink mex project for connecting a universal robot to matlab/simulink

File : mex_rtde_moveL.cpp

Abstract: An CPP-file S-function for Simulink to control a UR Robot

Inputs:

  • 1x6 TCPPose Target (X,Y,Z,RX,RY,RZ)

Outputs:

  • 1x6 TCPPose Actual (X,Y,Z,RX,RY,RZ)
  • 1x6 Q Actual (Q1, Q2, Q3, Q4, Q5, Q6)

Parameters:

  • Speed of Robot
  • Accel of Robot
  • Sample Time of s-Function
  • string IP Address of Robot

Example Parameter List: 3 5 0.05 '192.168.255.128'

Notes for compilation:

This file needs to be compiled against the ur-rtde and boost libraries

Link for ur-rtde here: https://gitlab.com/sdurobotics/ur_rtde Link for boost here: https://www.boost.org/

Tested are the following versions:

  • Microsoft Visual C++ 2019

  • Matlab 2023b

  • URSim Virtual 5.14.6

  • Boost Version 1.84.0

  • ur_rtde Branch Version: bbbd7a42 IMPORTANT!!!! In order to maintain Real-time performance, the branch needs to be modified in accordance with Issue 151. https://gitlab.com/sdurobotics/ur_rtde/-/issues/151 Although the solution is in a submitted merge request, it is not solved in the current Master. Solution: Comment out break at line 518 in rtde.cpp

                   }
                   robot_state->unlockUpdateStateMutex();
    
                   //break;
               }                             
    

My Compiler function:

 mex -r2018a mex_rtde_moveL.cpp ...
        -IC:\Users\Gavin\source\repos\ur_rtde\include ...
        -IC:\dev\boost_1_84_0 ...
        -LC:\Users\Gavin\source\repos\ur_rtde-build\Release ...
        -lrtde.lib ...
        -LC:\dev\boost_1_84_0\bin.v2\libs\thread\build\msvc-14.3\release\link-static\threadapi-win32\threading-multi ...
        -LC:\dev\boost_1_84_0\bin.v2\libs\system\build\msvc-14.3\release\link-static\threading-multi ...
        -llibboost_system-vc143-mt-x64-1_84.lib ...
        -llibboost_thread-vc143-mt-x64-1_84.lib 

Copyright Gavin Kane 2023

Cita come

SMEAC (2025). Simulink Mex File Integration of UR Control with RTDE (https://github.com/SMEAC/ur_rtde_mex), GitHub. Recuperato .

Compatibilità della release di MATLAB
Creato con R2023b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Tag Aggiungi tag

Community Treasure Hunt

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

Start Hunting!

Le versioni che utilizzano il ramo predefinito di GitHub non possono essere scaricate

Versione Pubblicato Note della release
1.0.0

Per visualizzare o segnalare problemi su questo componente aggiuntivo di GitHub, visita GitHub Repository.
Per visualizzare o segnalare problemi su questo componente aggiuntivo di GitHub, visita GitHub Repository.