Skip to content

Latest commit

 

History

History
48 lines (38 loc) · 1.32 KB

README.md

File metadata and controls

48 lines (38 loc) · 1.32 KB

ODrive

Odrive controller library written in C++

Generic badge Generic badge

Requirements

Usage

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