moteus_tool --restore-config
For the moteus brushless controller, the moteus_tool
utility has long had a --dump-config
command line action which will cause the entire contents of the configuration to be written to standard output.
--dump-config format
This configuration looks like this:
servo.pid_position.kp 4
servo.pid_position.kd 0.1
moteus_tool
has also had a --write-config
option, which is something of a misnomer, as it actually just sends any commands one at a time from a file to the controller. Notably, it requires that the file to contain actual valid diagnostic mode commands.
--write-config format
Thus, if you wanted to restore the above two configuration options, and then save those values to persistent storage, the file contents would need to be:
conf set servo.pid_position.kp 4
conf set servo.pid_position.kd 0.1
conf write
As of pypi version 0.3.62, the moteus_tool --restore-config
action will now accept the --dump-config
format directly and also send the conf write
at the conclusion. This means that --restore-config
can now be used directly with the output of --dump-config
. Yay!