Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
src/dynamics.cpp@39:b765b6dd01c3, 2013-11-26 (annotated)
- Committer:
- sherryxy
- Date:
- Tue Nov 26 19:37:55 2013 +0000
- Revision:
- 39:b765b6dd01c3
- Parent:
- 37:bf257a0154db
- Child:
- 43:68faf056ed5c
lengths
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| calamaridudeman | 21:a9569c7b4379 | 1 | #include "mbed.h" |
| calamaridudeman | 23:112c0be5a7f3 | 2 | #include "include/dynamics.hpp" |
| calamaridudeman | 16:c21df8c0c458 | 3 | |
| calamaridudeman | 37:bf257a0154db | 4 | |
| calamaridudeman | 37:bf257a0154db | 5 | Joints invKinBody(Point &in){ |
| calamaridudeman | 37:bf257a0154db | 6 | float x=in.x; |
| calamaridudeman | 37:bf257a0154db | 7 | float y=in.y; |
| calamaridudeman | 37:bf257a0154db | 8 | float theta1 = (float) 2 * atan(sqrt( ( (l2+l3+l4)*(l2+l3+l4) - x*x - y*y) / (x*x + y*y - (l2+l4-l3)*(l2+l4-l3)) )); |
| calamaridudeman | 37:bf257a0154db | 9 | float theta2 = (float) atan2(y,x) - atan2(l3*sin(theta1), l2 + l4 + l3*cos(theta1)); |
| calamaridudeman | 37:bf257a0154db | 10 | return Joints(theta1, theta2); |
| sherryxy | 39:b765b6dd01c3 | 11 | } |
| sherryxy | 39:b765b6dd01c3 | 12 | |
| sherryxy | 39:b765b6dd01c3 | 13 | float kinGantry (theta3){ |
| sherryxy | 39:b765b6dd01c3 | 14 | float y_gplus = lg*sin(theta3); |
| sherryxy | 39:b765b6dd01c3 | 15 | float y_plus = y_gplus-l1; |
| sherryxy | 39:b765b6dd01c3 | 16 | return h+y_plus; |
| sherryxy | 39:b765b6dd01c3 | 17 | } |
