This is an example on how to use epos2
This example shows how to move a motor in a specified velocity. It initates a new epos2 object called controller, checks if exist any error (always a CAN passive mode error exists at switch on the controller). Then it tries to enable motor in velocity mode and moves it 5 seconds at 300 rpm in motor. After this time, it deletes the object then epos2 is disconnected.
This should be the output of the example
* $ sudo ./bin/test_epos2 * Epos2 Example: * <Epos2 hardware state> RED LED on (if just plugged power in) * [FTDI] ftdi_read_chipid: 0 * [FTDI] chipid: 667934CD * [EPOS2] online * RX No Data * : Resource temporarily unavailable * [EPOS2] State: 1 * [EPOS2] to Fault Reset * [EPOS2] State: 3 * [EPOS2] to Shutdown * [EPOS2] State: 4 * [EPOS2] to Switch on * [EPOS2] State: 5 * [EPOS2] to Enable Operation * [EPOS2] State: 8 * [EPOS2] Motor Ready * [EPOS2] Operation Mode: -2 * <Epos2 hardware state> GREEN LED on * [EPOS2] Mode Velocity Started * Wait 5 seconds * [EPOS2] Mode Velocity Stopped * * [EPOS2] offline * <Epos2 hardware state> Green Led blinking * Example ended *