mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-24 01:23:52 +08:00
Merge pull request #638 from madewhatnow/patch-1
Update to use axis0.controller.input_pos
This commit is contained in:
@@ -26,7 +26,7 @@ my_drive.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
|
||||
print("Bus voltage is " + str(my_drive.vbus_voltage) + "V")
|
||||
|
||||
# Or to change a value, just assign to the property
|
||||
my_drive.axis0.controller.pos_setpoint = 3.14
|
||||
my_drive.axis0.controller.input_pos = 3.14
|
||||
print("Position setpoint is " + str(my_drive.axis0.controller.pos_setpoint))
|
||||
|
||||
# And this is how function calls are done:
|
||||
@@ -38,7 +38,7 @@ t0 = time.monotonic()
|
||||
while True:
|
||||
setpoint = 4.0 * math.sin((time.monotonic() - t0)*2)
|
||||
print("goto " + str(int(setpoint)))
|
||||
my_drive.axis0.controller.pos_setpoint = setpoint
|
||||
my_drive.axis0.controller.input_pos = setpoint
|
||||
time.sleep(0.01)
|
||||
|
||||
# Some more things you can try:
|
||||
|
||||
Reference in New Issue
Block a user