mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-22 16:14:37 +08:00
Fix ::run_state method (wait_for_idle instead of idle) and better vel_limit setting in .ino sketch example
This commit is contained in:
@@ -62,7 +62,7 @@ int32_t ODriveArduino::readInt() {
|
||||
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";
|
||||
|
||||
@@ -53,7 +53,7 @@ void setup() {
|
||||
// You can of course set them different if you want.
|
||||
// See the documentation or play around in odrivetool to see the available parameters
|
||||
for (int axis = 0; axis < 2; ++axis) {
|
||||
odrive_serial << "w axis" << axis << ".controller.config.vel_limit " << 22000.0f << '\n';
|
||||
odrive_serial << "w axis" << axis << ".controller.config.vel_limit " << 10.0f << '\n';
|
||||
odrive_serial << "w axis" << axis << ".motor.config.current_lim " << 11.0f << '\n';
|
||||
// This ends up writing something like "w axis0.motor.config.current_lim 10.0\n"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user