https://github.com/emcfarlane/xl320
Dynamixel XL-320
https://github.com/emcfarlane/xl320
Last synced: 2 months ago
JSON representation
Dynamixel XL-320
- Host: GitHub
- URL: https://github.com/emcfarlane/xl320
- Owner: emcfarlane
- License: mit
- Created: 2015-07-30T15:34:06.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-05-04T17:56:35.000Z (about 10 years ago)
- Last Synced: 2024-04-21T00:58:22.473Z (about 2 years ago)
- Language: C++
- Size: 317 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xl320
Dynamixel XL-320
## Example
```
#include "motors.h"
DM2 m(p13, p14); // Tx, Rx, Baud=1000000
...
int encode_theta(const double &t) {
int md = (int) (t*195.5696 + 512.5); // Int cast (t)/(150/180*pi)*512
if (md > 1024) {
md = 1024;
}
if (md < 0) {
md = 0;
}
return md;
}
... {
int ec = 0; // Error code
ec = m.SetGoalPosition(1, encode_theta(angle_to_encode));
if (ec != 0) {
// Handle error
}
}
```