资源简介

PUMA560机械臂目标物块抓取系统,vrep与matlab联合仿真,有Qt写的上位机,功能有自由调整关节角、输入目标点定点移动、目标抓取等,可以将传送带上的物块夹到桌面上,适合初学者参考

资源截图

代码片段和文件信息

% This example illustrates how to execute complex commands from
% a remote API client. You can also use a similar construct for
% commands that are not directly supported by the remote API.
%
% Load the demo scene ‘remoteApiCommandServerExample.ttt‘ in V-REP then 
% start the simulation and run this program.
%
% IMPORTANT: for each successful call to simxStart there
% should be a corresponding call to simxFinish at the end!

function complexCommandTest()

    disp(‘Program started‘);
    % vrep=remApi(‘remoteApi‘‘extApi.h‘); % using the header (requires a compiler)
    vrep=remApi(‘remoteApi‘); % using the prototype file (remoteApiProto.m)
    vrep.simxFinish(-1); % just in case close all opened connections
    clientID=vrep.simxStart(‘127.0.0.1‘19999truetrue50005);

    if (clientID>-1)
        disp(‘Connected to remote API server‘);
        
        % 1. First send a command to display a specific message in a dialog box:
        [res retInts retFloats retStrings retBuffer]=vrep.simxCallscriptFunction(clientID‘remoteApiCommandServer‘vrep.sim_scripttype_childscript‘displayText_function‘[][]‘Hello world!‘[]vrep.simx_opmode_blocking);
        if (res==vrep.simx_return_ok)
            fprintf(‘Returned message: %s\n‘retStrings);
        else
            fprintf(‘Remote function call failed\n‘);
        end

        % 2. Now create a dummy object at coordinate 0.10.20.3 with name ‘MyDummyName‘:
        [res retInts retFloats retStrings retBuffer]=vrep.simxCallscriptFunction(clientID‘remoteApiCommandServer‘vrep.sim_scripttype_childscript‘createDummy_function‘[][0.1 0.2 0.3]‘MyDummyName‘[]vrep.simx_opmode_blocking);
        if (res==vrep.simx_return_ok)
            fprintf(‘Dummy handle: %d\n‘retInts(1));
        else
            fprintf(‘Remote function call failed\n‘);
        end

        % 3. Now send a code string to execute some random functions:
        code=[‘local octreeHandle=simCreateOctree(0.501)‘ char(10) ...
            ‘simInsertVoxelsIntoOctree(octreeHandle0{0.10.10.1}{2550255})‘ char(10) ...
            ‘return ‘‘done‘‘‘];
        [res retInts retFloats retStrings retBuffer]=vrep.simxCallscriptFunction(clientID‘remoteApiCommandServer‘vrep.sim_scripttype_childscript‘executeCode_function‘[][]code[]vrep.simx_opmode_blocking);
        if (res==vrep.simx_return_ok)
            fprintf(‘Code execution returned: %s\n‘retStrings);
        else
            fprintf(‘Remote function call failed\n‘);
        end

        % Now close the connection to V-REP:    
        vrep.simxFinish(clientID);
    else
        disp(‘Failed connecting to remote API server‘);
    end
    vrep.delete(); % call the destructor!
    
    disp(‘Program ended‘);
end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件          0  2020-06-07 21:37  project_puma_v6\backup\detect.m

     文件       1370  2020-06-08 19:36  project_puma_v6\backup\getTarget.m

     文件       1163  2020-06-07 20:43  project_puma_v6\backup\instruct.m

     文件        954  2020-06-08 10:30  project_puma_v6\backup\movel.m

     文件       1707  2020-06-08 15:42  project_puma_v6\backup\movelTrack.m

     文件        621  2020-06-08 10:30  project_puma_v6\backup\newPlace.m

     文件       2799  2018-01-25 18:03  project_puma_v6\complexCommandTest.m

     文件       2118  2020-06-12 18:11  project_puma_v6\ik_solution.m

     文件       7240  2020-06-14 18:05  project_puma_v6\ik_step.m

     文件       2151  2020-06-14 17:24  project_puma_v6\pick_and_place.m

     文件     772497  2020-06-14 19:59  project_puma_v6\puma560v2.ttt

     文件        876  2018-01-25 18:03  project_puma_v6\readMe.txt

     文件     100875  2018-01-25 18:03  project_puma_v6\remApi.m

     文件      70656  2018-01-25 18:03  project_puma_v6\remoteApi.dll

     文件      35378  2018-01-25 18:03  project_puma_v6\remoteApiProto.m

     文件          0  2020-06-06 17:58  project_puma_v6\sim.simxStart

     文件       1770  2018-01-25 18:03  project_puma_v6\simpleSynchronousTest.m

     文件       2718  2018-01-25 18:03  project_puma_v6\simpleTest.m

     文件         46  2020-06-12 12:53  project_puma_v6\Untitled.m

     文件       1161  2020-06-11 00:21  project_puma_v6\visionSensor.m

     目录          0  2020-06-14 16:02  project_puma_v6\backup

     目录          0  2020-06-14 16:02  project_puma_v6

----------- ---------  ---------- -----  ----

              1006100                    22


评论

共有 条评论