how to display the end-effector position?

I have a 3 links robot GUI software. The file can be downloaded through this link: http://www.sendspace.com/file/yrqzmp
I use the following command as callback for the textbox for x,y,z position:
set(handles.fromDHandTheta,'String',point4.x) but it doesn't work.
Anyone can help me with that?
Thanks in advance.

댓글 수: 3

Jiro Doke
Jiro Doke 2011년 5월 22일
Try putting a breakpoint on the line you mentioned, and see what the value for point4.x
Also, check to see if handles.fromDHandTheta is a valid handle:
ishandle(handles.fromDHandTheta)
Cheng Yoong
Cheng Yoong 2011년 5월 24일
Hi Jiro,
What you mean by putting a breakpoint?
Walter Roberson
Walter Roberson 2011년 5월 24일
click on the dot that appears to the left of the line number of the line you want to stop at. Then run the program. It will stop executing when you reach that line, and you will be able to examine the state of the variables.

댓글을 달려면 로그인하십시오.

답변 (1개)

Ben Mitch
Ben Mitch 2011년 5월 22일

0 개 추천

Hi Cheng
If you're going to post code, I think you'll have to trim it down to the essentials if you want anyone to look at it.
Perhaps you need this?
set(handles.fromDHandTheta, 'String', num2str(point4.x))
Cheers

댓글 수: 5

Cheng Yoong
Cheng Yoong 2011년 5월 22일
Hi Ben,
If u open the GUI interface I have attached in the link, u will see 3 textbox on the right hand side,which i'm going to display the position.
For the callback of x-position,I have insert the command as u suggested but when i executed it, there is no value change to the textbox.
Actually, I doubt whether we can handles the whole m file?
Cause from set(handles.fromDHandTheta,'String',num2str(point4.x))
fromDHandTheta represents a M file, which i created.
Ben Mitch
Ben Mitch 2011년 5월 25일
Hi Cheng - this is why you should post something trimmed down. I can't find the line
set(handles.fromDHandTheta,'String',point4.x)
in any of your files, so how am I supposed to help? How does your code work? I don't know and you can't expect me to spend very long figuring it out. At the very least, you need to direct me to the line that is not working as you expect and tell me exactly how to reproduce the problem. Sorry.
Ben Mitch
Ben Mitch 2011년 5월 25일
Sorry didn't mean that to sound rude, obviously hadn't had my coffee yet. Happy to help, but need more information :).
Cheng Yoong
Cheng Yoong 2011년 5월 27일
Thanks Ben, my problem solved, I just place the right code at the wrong place. =)
Anyway, do u familiar with robotic stuff?My final year project is about create this robot GUI software and simulate the motion of robot in virtual space. I would like to refine my robot drawing but I have limited knowledge on Matlab Graphic.
Ben Mitch
Ben Mitch 2011년 5월 27일
Do you mean simulate or <http://cowsheep.net/link/110527 visualize>? In either case, the key feature is geometry. I recommend you start with "homogeneous coordinates", as the guys in 3D graphics do. Then you've got points (4x1 vectors) and transforms (4x4 matrices, like rotations or translations). Build a model of your robot out of points (think, solid parts) and transforms (think, joints with angles that vary over time). Build faces out of points, build solid parts out of faces. Try "doc patch" to get started with visualizing faces. Change the renderer to "OpenGL", YMMV. If you get stuck, post a specific question as a new thread. Good luck.
Of course, there may be tools for robot visualization so you don't have to build everything yourself. Simscape? Have a Google on matlab robot visualization.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Model Import에 대해 자세히 알아보기

태그

질문:

2011년 5월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by