Okay no one would answer my question so I have to figure it out. I wanted to share what I learned for other people that are struggling. This is how to use an Arduino to control ODrive very simply stated.
If you want to set position use a command like odrive.SetPosition(0, 100000);
This sets the position to 100000 counts for motor 0.
To set velocity use a command like odrive.SetVelocity(0, -2000, 10);
This sets velocity to negative 2000 [count/s] for motor 0 at 10 amps. If you don’t want to control the amps just don’t add it.
And to the part that was very poorly explained in my opinion on GitHub.
To get the bus voltage use two commands like this:
odrive_serial.write(“r vbus_voltage\n”);
volt = odrive.readFloat();
And to get the encoder position and add it to a variable use two commands like this:
odrive_serial.write(“r axis0.encoder.pos_estimate\n”);
endstopPos = odrive.readFloat();
I believe the “r” means read or something like that? Idk I like the GetParameters command better but I guess this works too. I would do your odrive.readFloat(); immediately after you ask for the variable because it seems to go away after you ask the ODrive for it (this doesn’t seems like a strong way to do this to me). If you want to get the position of the other motor I believe that you need to use axis1. Not sure because I am only driving one motor. You don’t have to put an axis number to get the voltage because it is a constant I believe.
If you are not a super strong programmer like me then I hope this clears up what is happening on GitHub for ODriveArduino. Some of the code I copied directly from GitHub wouldn’t compile. But I know that these commands work as of writing this because I have tested it. I am sure that this could change in the future as ODrive evolves. It probably should because this is confusing.