Reading Bool Property With Arduino

Is it possible to read boolean values using the ASCII protocol? I am interested in reading the ODrive’s

odrv0.axis0.motor.is_calibrated

property using a Teensy. The response I receive is 0 (false) even though it should be 1(true).

I am using the following two lines of code to read that specific property using the Teensy

Serial2 << “r axis” << 0 << “.encoder.is_ready” << “\n”;

bool calib = (bool) odrive.readFloat();

Not using the Arduino library but the ASCII protocol directly.
And yes, it responds with 0 or 1 for boolean variables.

Example:
r axis0.motor.is_calibrated\n
or
r axis0.encoder.is_ready\n
returns
1

Looking at the code I would check what odrive.readString() returns. Can’t see a reason why “1”.toFloat() should not return 1 and a cast from float to bool should be a float==0.0 but…

I rather suspect the read operation times out. Can you guarantee you get any data, e.g. readFloat() after sending the battery voltage command?

Yes. I get data for voltage, pos_estimate, vel_estimate, and Ibus

Try using odrive.readInt(); instead?
What ODrive firmware version are you using?