Change Axis on S1

I’m creating a pyi stub from the flat_endpoints.json for ODriveS1, and am trying to figure out how to change the selected axis. The json simply refers to axis0. I’m not sure if this just refers to the current axis, or if this is intended to be axis[0], with the other axes selected by index.

Edit: I’m also curious if this applies to attributes such as onboard_encoder0 or encoder_estimator0. In the latter case there is an encoder_estimator1.

Well the S1 is a single axis ODrive, so I’m not sure what other axis there would be – do you mean other ODrives? Or a multi-axis ODrive like the ODrive v3.6?

Ah that makes sense, sorry I didn’t realize that model was a single axis. Thank you

No worries! Would absolutely love to see how you do the .pyi file if you don’t mind sharing when you’re done!

Yeah of course. I have a script that automatically converts the json, once it’s bug free I think it would be helpful for other ODrive users

1 Like

Very cool! Was working on something similar myself – however I’m a bit less familiar with modern Python tooling, so I haven’t been able to find a much better way than actually doing code generation for the pyi stubs; is there an AST or namespaces-based method that’s a bit more elegant?