I finally wrote a class to manage the RAZOR IMU. I inherited the Razor from a Thread. @Pierre I wanted to inherit from a Sensor class but in fact, I should instanciate a razor class inside a razorSensor class inherited from a Sensor class ? (to make it as clean as possible)
The functions are:
The COM port is automatically detected (I use pypot)
The module can get the Euler angles (in aeronautical convention)
but it can also return the acceleration seen by accelero, the gyro and the compass component
So first as a general comment, you should directly open a pull request this make commenting, improving and collaborating on code soon much easier Plus it also keeps track of the history of modification! You can open pull request as soon as you propose a new idea and not only when all the code is clean.
Then, I think you should not always use auto-detection but rather make it possible for users. Iām saying that because you have to open all port and send message. Depending on whatās on the other bus this could go wrong
Finally for this sensor architecture, Iāll make it clearer while Iām adding a camera sensor, qrcode detectionā¦ Iāll try to see how your Razor class can fit into that and propose you a solution. (Yours is pretty good, but defining it as a sensor will automatically make it available through the REST API and this kind of thingsā¦)
I am not yet ready.
The big issue is that the connection is not possible every 4 timesā¦ It would be useful to have the name of the ports taken by the pypot robot instanciation.
The serial port are not easy to manage with reliabilityā¦
With a timeout of 3 seconds, it works very well on my computer (ubuntu 14.04).
But on Poppyā¦ nothing. I oppened the head and removed the USB2AX to test, still nothing.
Any idea, suggestion ?
What do you say about ānothingā? Can you connect to the RAZOR ? The serial port is open ?
Or the output value is always equal to zero ?
I advise you to open the serial port in an ipython console so that you can play with it.
There is somethink to know about RAZOR, when you read a line, the first line is very long with a lot of āzeroā characters. That is why I use the āstripā method to remove these.
Hello,
This is a version that integrate get_available_ports(only_free=True) and a filter for some extraneous characters with ordinal > 127 when I read my captor razor.py (3.4 KB)
Hello @Thot
I would like to know if there have been any advances in the question made by @JuanMiguel, are we capable of having a sensor class that could be used through the REST API?