ElettraSciComp / witmotion_IMU_ros

ROS wrapper for the family of IMU sensor devices manufactured by Witmotion Ltd.
MIT License
27 stars 31 forks source link

IMU ros driver compatible with i2c protocol #13

Open mramezani64 opened 1 year ago

mramezani64 commented 1 year ago

Thank you for releasing this nice driver. I was wondering if there is a way to make this driver compatible with i2c communication protocol or do you have a driver version working with i2c? Any insights on this are appreciated. Thanks

twdragon commented 1 year ago

@mramezani64 I2C is not only a protocol, actually, but it is also a hardware-defined bus that requires:

Thus I2C is popular due to protocol simplicity, but it is much more feasible to build tiny embedded devices, for example, to be used as converters between I2C and USB/TTL/RS232.

For Witmotion sensors I2C is both exposed externally as a communication line but it is also used as an internal communication bus between the UART transceiver and sensory chip. So, I understand your enthusiasm to involve I2C inside the driver, but I can also say that it will be much easier to do for embedded devices like Raspberry Pi and BeagleBone with the dedicated I2C intermediate kernel driver. To experiment with this variant, I can recommend using the i2c-tools package. For the general-purpose system equipped with ordinary Linux distribution, it will be difficult to successfully couple the device by I2C and run it.

Unfortunately, I now have no plan to develop I2C version of the driver because it requires total re-implementation of the underlying library with the compatible API. But as advice, I can suggest to you and all colleagues reading this to try to develop a dedicated I2C-compatible Witmotion kernel module accompanied with API conversion library, then the I2C branch could be created.