So far so good, so far everything works, can turn the engine and also use other actions.
I use smaller wheels and would like to save them as a configuration in order to reuse them faster with less code, I would also like to load the direction of rotation of all four wheels by means of configuration.
motor_fl.save_config('m0.conf')
Storing configuration in m0.conf
Then I would like to reload the configuration.
motor_fl.from_file('m0.conf')
Loading configuration from m0.conf
Recreating EncoderMotor (from pitop.pma.encoder_motor) with {'port_name': 'M0', 'name': 'encoder_motor', 'forward_direction': 1, 'braking_type': 0, 'wheel_diameter': 0.6}
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3/dist-packages/pitop/core/mixins/recreatable.py", line 57, in from_file
return cls.from_config(config_dict)
File "/usr/lib/python3/dist-packages/pitop/core/mixins/recreatable.py", line 48, in from_config
return main_cls(**config_dict)
File "/usr/lib/python3/dist-packages/pitop/pma/encoder_motor.py", line 65, in init
self.__motor_core = EncoderMotorController(self._pma_port, braking_type.value)
AttributeError: 'int' object has no attribute 'value'
from time import sleep from pitop import BrakingType, EncoderMotor, ForwardDirection
motor_fl = EncoderMotor("M0", ForwardDirection.CLOCKWISE) motor_fl.braking_type = BrakingType.COAST
I use smaller wheels and would like to save them as a configuration in order to reuse them faster with less code, I would also like to load the direction of rotation of all four wheels by means of configuration.
Then I would like to reload the configuration.