trplot gives line not frame with hold on function

495 views
Skip to first unread message

Michael Shenouda

unread,
Apr 23, 2015, 12:20:09 PM4/23/15
to robotics...@googlegroups.com
dear sir
i am trying to plot two frames on the same figure using trplot to plot end effector frame with the camera frame using hold on but it is not working as when i command hold on it is only draw a straight lines not frames, kindly support 
thanks 

Peter Corke

unread,
Apr 23, 2015, 3:54:03 PM4/23/15
to robotics...@googlegroups.com
Kindly provide information: the code you're using, the graphics that appears, MATLAB and toolbox version.  

peter

Michael Shenouda

unread,
Apr 25, 2015, 5:02:28 AM4/25/15
to robotics...@googlegroups.com
dear peter 
kindly i am using robotics toolbok 9.10, on matlab 2013a
my code is ;
b=[0,0,1,304.8;0,1,0,0;-1,0,0,508;0,0,0,1]
trplot(b,'color','r')
a=[0.0237,0.9997,-0.0014,-22.5099;-0.9995,0.0238,0.0189,0.5554;0.0190,0.0010,0.9998,146.6948;0,0,0,1]
d=b*a;
trplot(d,'color','g')
Inline image 1
my second code is ;
b=[0,0,1,304.8;0,1,0,0;-1,0,0,508;0,0,0,1]
trplot(b,'color','r')
a=[0.0237,0.9997,-0.0014,-22.5099;-0.9995,0.0238,0.0189,0.5554;0.0190,0.0010,0.9998,146.6948;0,0,0,1]
d=b*a;
hold on
trplot(d,'color','g')
Inline image 2
i want just to place both frames on the same figure 
thanks


--
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/0tNjI8Ca9Ng/unsubscribe.
To unsubscribe from this group and all its topics, send an email to robotics-tool-...@googlegroups.com.
To post to this group, send email to robotics...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotics-tool-box.
For more options, visit https://groups.google.com/d/optout.

Felipe

unread,
Apr 26, 2015, 1:19:59 PM4/26/15
to robotics...@googlegroups.com
Hi, Michael.

The two frames you are trying to plot on the same figure are very distant from each other. If you change the scale of the axis, you can plot both frames on the same figure using "hold on":

b=[0,0,1,304.8;0,1,0,0;-1,0,0,508;0,0,0,1]
a=[0.0237,0.9997,-0.0014,-22.5099;-0.9995,0.0238,0.0189,0.5554;0.0190,0.0010,0.9998,146.6948;0,0,0,1]
d=b*a;
trplot(d,'color','g')
axis([300 455 -50 50 450 550])
hold on
trplot(b,'color','r')

Peter Corke

unread,
May 3, 2015, 5:26:23 PM5/3/15
to robotics...@googlegroups.com
Thanks Felipe,

in the original example from Michael, both frames are rendered, but the axis scaling is locked after the first plot.  If you follow that example with

axis([300 455 -50 50 450 550])

as suggested by Felipe we can see both frames.  They are indeed a long way apart.

Under 2015a I get a warning

Warning: The new value for the Matrix property may cause rendering problems 
> In trplot at 301 

which is due I think to the matrix d having an improper rotation component

>> ishomog(d,1)

ans =

     0

but that's not causing the problem reported.

peter

On Friday, 24 April 2015 02:20:09 UTC+10, Michael Shenouda wrote:
Reply all
Reply to author
Forward
0 new messages