Odrive controller library written in C
- License URL: https://www.gnu.org/licenses/gpl-3.0.html
- License GNU General Public License v3.0
The libaray consists of an odrive class and a thin wrapper functions that make working wiht the object easier. In order to use the libarary, you first need to create and initialize an odrive object:
int main(){
...
dhr:odrive od;
uint64_t serial_number = 0x000000000001;
od.init(serial_number);
...
}
From there you need to request the Odrive's json config file:
Json::Value json;
dhr::getJson(&od, &json);
Finally you can read and write from and to the Odrive the following way:
...
//WRITE
uint32_t state1 = 6; //Odrive's parameters' classes should be set appropriately to the documentation
dhr::writeOdriveData(&od, json, "axis0.requested_state", state1);
//READ
float vel_es;
dhr::readOdriveData(&od, json, "axis0.encoder.vel_estimate",vel_es);
...
Exmaple usage you can here