- make sure the Command Window and the Editor are docked in the Desktop, i.e. visible simultaneously.
- turn the code into a function, i.e add the line "function a_good_name()" at the top of the code and "end" at the end. Save the function.
- start explore the code
Dissecting someone elses Matlab code
조회 수: 5 (최근 30일)
이전 댓글 표시
Recently I've tried to dissect this code http://benjamin-goldberg.com/Robot_Arm_Inverse_Kinematics.m
But to no avail, however, I will tell you what I know and what I want to know:
a. This code attempts to have the end of the 'arm' reach (0,0) b. The angles between each link is limited, hence why when Theta# is changed, it will sometimes not reach (0,0) (I think?) c. Arm lengths are changed in lines 11 and 13, Axis located at 42 d. He's working in radians e. Lines 14 - 16 allows the free motion of the links of the arms
That's pretty much all I know so far, things I would like to know are:
Pretty much what is happening in that For-Loop.
These are some things I want to do to the code after I've understood it:
Change the angle limitations
Lose the arm trail (But display the 'hand' trail)
Put this in a GUI so that it will follow my mouse constantly until I click it. It'll be impossible for it to reach some places (it'll only reach a distance of 3 units from the centre, hence a circle), so instead, it'll keep following it the best it can whilst fully intact.
All help very much appreciated, thanks!
댓글 수: 0
답변 (1개)
per isakson
2012년 5월 13일
Are you posing this question to experts of robot arm kinematics? Do you have a problem using the tools of Matlab?
Did you ask Goldberg? He writes: "If you have any questions, please don’t hesitate to email me at ***."
Edit [13 May 2012, 11:32 BST - OK] Erased email.
--- Continue ---
There are a few videos on youtube, which address debugging in Matlab. (There should be demos/videos, which focus on debugging, on The Mathworks website, but I fail to find one now.) See e.g. Matlab Debugger tutorial, Part A. and MATLAB Tutorial: Debugger to walk through code. The latter is presented by Doug Hull of The Mathworks. He has a blog with hundreds of videos on The Mathworks website. If you are not comfortable with the debugging tools you might want to watch a couple of videos.
What I would have done
참고 항목
카테고리
Help Center 및 File Exchange에서 Robotics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!