Pick the sphere object and place

390 views
Skip to first unread message

snow John

unread,
Jul 4, 2020, 5:32:28 AM7/4/20
to Robotics & Machine Vision Toolboxes
Hello Mr Corke and everyone in this group , I want to implement the pick and place simulation with RTB,I added some code in this example: https://www.youtube.com/watch?v=4ddfhcbIr1Y&list=PLF58C18380E9B356F
My codes are as follows
mdl_puma560
p = [0.8 0 0];
T = transl(p) * troty(pi/2);
qr(1) = -pi/2;
qqr = p560.ikine6s(T, 'ru');
qrt = jtraj(qr, qqr, 50);
ae = [138 8];
p(1) = 1;
clf
plot_sphere(p, 0.05, 'y');%position of the ball
p560.plot3d(qrt, 'view', ae);
%% For pick and place
qr(1) = pi/2;
qrt = jtraj(qqr, qr, 50);
for i=1:1:length(qrt)
    T=p560.fkine(qrt(i,:));
    P=transl(T.t(:,1)')*transl(0,0,0.2)*trotz(-pi/2);%tool transfrom
    P=P(1:3,end);
p560.plot3d(qrt(i,:), 'view', ae);
clf
plot_sphere(P, 0.05, 'y');%plot moving sphere
end
p560.plot3d(qrt(i,:), 'view', ae);
The result:
GIF0.gif
Obviously the sphere is not on the end effect of the robot, So my question is that the tool’s frame transformation code is wrong here?  If there are other alternative solutions to achieve the grab simulation.
Best regards ,
John.



Peter Corke

unread,
Jul 4, 2020, 7:12:30 PM7/4/20
to Robotics & Machine Vision Toolboxes
Hi John,

I tweaked your code a bit

 

mdl_puma560

p = [0.8 0 0];

T = transl(p) * troty(pi/2);

qr(1) = -pi/2;

qqr = p560.ikine6s(T, 'ru');

qrt = jtraj(qr, qqr, 50);  % path from qr' to T

 

ae = [138 8];

p(1) = 1;

clf

plot_sphere(p, 0.05, 'y');%position of the ball

 

p560.plot3d(qrt, 'view', ae, 'nowrist');  % animate moption to the ball

 

%% For pick and place

qr(1) = pi/2;

qrt = jtraj(qqr, qr, 50);  % path from T to qr'

 

clf

for i=1:length(qrt)

    T = p560.fkine(qrt(i,:)); % get EE pose

    Tball = T * SE3(0,0,0.2); %tool transfrom

    P = Tball.t;

    clf

    plot_sphere(P, 0.05, 'y');%plot moving sphere

    p560.plot3d(qrt(i,:), 'view', ae, 'nowrist');

 

    pause(0.1)

end

p560.plot3d(qrt(i,:), 'view', ae);



This is a nice demo, I should probably ship something like this :)  The main differences are:

- computing the position of the ball, you need to offset by z=0.2 in the wrist frame
- you clear the figure between drawing the robot and the ball, which means they are out by one time step
- plotting the ball before the robot stops flickering, not quite sure why...
- I turned the wrist frame off so it's easier to see what's going on.
- a bit of formatting, white space and comments make it easier for others to read your code.

peter

snow John

unread,
Nov 25, 2022, 7:31:47 AM11/25/22
to Robotics & Machine Vision Toolboxes
Hello,Prof. Peter  Corke ,
I want to improve the manipulability when the robot doing the pick and place task,And i have find a nice way in the paper“  NEO :A Novel Expeditious Optimisation Algorithm for Reactive Motion Control of Manipulators  ” to make the trajectory have hight manipulability .But the source code  is in python to get the Manipulability jacobian use the rbt. jacobm() function, which are not good for my project in matlab environment. And the QPsolver toolbox maybe can be replacered with the quadprog function in matlab.
1669378203542.jpg

But i really not well-know the manipulability jacobian  、Hessian Tensor matrix、vec (.)、computation 
Could you please help me change this part with matlab codes, Thanks in advance.
Best,
-Jian

Peter Corke

unread,
Nov 26, 2022, 3:34:08 AM11/26/22
to robotics...@googlegroups.com, Jesse Haviland
Hi John,

Sorry, but you are on your own with this.  This is my hobby, not my day job, and I don’t have the cycles to maintain/extend two toolboxes.  It shouldn’t be too hard to port to MATLAB, or you could call the Python code from MATLAB - theoretically possible but maybe harder than doing a port.  Calling RTB-P from MATLAB is on my long list of things to look at.

Peter

On 25 Nov 2022, at 11:31 pm, snow John <jianr...@gmail.com> wrote:

Hello,Prof. Peter  Corke ,
I want to improve the manipulability when the robot doing the pick and place task,And i have find a nice way in the paper“  NEO :A Novel Expeditious Optimisation Algorithm for Reactive Motion Control of Manipulators  ” to make the trajectory have hight manipulability .But the source code  is in python to get the Manipulability jacobian use the rbt. jacobm() function, which are not good for my project in matlab environment. And the QPsolver toolbox maybe can be replacered with the quadprog function in matlab.
--
You received this message because you are subscribed to a topic in the Google Groups "Robotics & Machine Vision Toolboxes" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/robotics-tool-box/IBOxJ4insek/unsubscribe.
To unsubscribe from this group and all its topics, send an email to robotics-tool-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/robotics-tool-box/cd90315c-f3b4-45e0-b79e-9a50446a187en%40googlegroups.com.
<1669378203542.jpg>

Reply all
Reply to author
Forward
0 new messages