mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-19 19:32:00 +08:00
Fix ::run_state method (wait_for_idle instead of idle) and better vel_limit setting in .ino sketch example
Pull changes from arduino-improvements branch into master
This commit is contained in:
@@ -59,10 +59,10 @@ int32_t ODriveArduino::readInt() {
|
||||
return readString().toInt();
|
||||
}
|
||||
|
||||
bool ODriveArduino::run_state(int axis, int requested_state, bool wait) {
|
||||
int timeout_ctr = 100;
|
||||
bool ODriveArduino::run_state(int axis, int requested_state, bool wait_for_idle, float timeout) {
|
||||
int timeout_ctr = (int)(timeout * 10.0f);
|
||||
serial_ << "w axis" << axis << ".requested_state " << requested_state << '\n';
|
||||
if (wait) {
|
||||
if (wait_for_idle) {
|
||||
do {
|
||||
delay(100);
|
||||
serial_ << "r axis" << axis << ".current_state\n";
|
||||
|
||||
Reference in New Issue
Block a user