반응형
5. 3x3 Rotation 함수 정의
Rotation angle θ 을 입력하면
Rotation matrix를 만들어 주는 matlab 함수를 정의해 봅시다.
function y=TwoD_RMat(Theta);
y=Rotation_Matrix =...
[...
cosd(Theta) -sind(Theta) 0;...
sind(Theta) cosd(Theta) 0;...
0 0 1;...
];
함수는 m파일로 저장합니다.
해당 m파일이 들어있는 폴더를 matlab 경로에 추가해줍니다.
함수를 한번 사용해보겠습니다.
30도 회전시키는 3x3 Rotation matrix를 만들어 봅시다.
Theta=30;
RotMat1=TwoD_RMat(Theta)
코드를 입력한 결과입니다.
반응형
'MATLAB 코딩 > 로봇동역학' 카테고리의 다른 글
<Two Link Manipulator - 2D> 7. Rotation, Translation 행렬을 Point에 곱해주는 합수 정의 (0) | 2019.07.01 |
---|---|
<Two Link Manipulator - 2D> 6. 3x3 Translation 함수 정의 (0) | 2019.07.01 |
<Two Link Manipulator - 2D> 4. 3x3 Transformation 행렬 설명 (2x2 회전행렬의 한계 극복) (0) | 2019.07.01 |
<Two Link Manipulator - 2D> 3. Link 1 회전 정의 (2x2 회전행렬 이용) (0) | 2019.07.01 |
<Two Link Manipulator - 2D> 2. Link 1 추가하기 (0) | 2019.07.01 |
댓글