Here is the problem I have,
I have a python class, which contain properties that are memebers of specific class, typically to rotate a motor.
pd42_1370.py wrapper to connect to the PD42-X-1370 stepper motor
from pytrinamic.connections import ConnectionManager
from pytrinamic.connections import UsbTmclInterface
from pytrinamic.modules import TMCM1370
def __init__(self,com_port,baudrate):
options = "--interface serial_tmcl --port "+ str(self.com_port)+ " --data_rate "+str(self.baudrate)
self.connection_manager = ConnectionManager(options)
self.interface = self.connection_manager.connect()
self.module = TMCM1370(self.interface)
self.motor = self.module.motors[0]
self.connection_manager.disconnect()
def rotateRight(self,speed):
my MATLAB code is:
py.importlib.import_module('pd42_1370')
ax = py.pd42_1370.PD42_1370('COM5',9600)
ax.rotateRight(int32(10000000))
It is working really fine. But instead of sending the command:
ax.rotateRight(int32(10000000))
I would like to write it:
ax.motor.rotate(int32(100000000))
this later throw back an error:
Unrecognized method, property, or field 'rotate' for class 'py.pytrinamic.modules.TMCM1370._MotorTypeA'.
I cannot figure out what is wrong.
If this could be sorted, then it would help by using direct calls to python, rather than keeping developping the wrapper.