sbgisen / vesc

VESC Interface for ROS
Apache License 2.0
44 stars 33 forks source link

Position unit is revolution not radians #42

Closed AbdElRahmanFarhan closed 1 year ago

AbdElRahmanFarhan commented 2 years ago

I think that the driver returns position as a revolution, not radians. I checked the code and I didn't find any conversion from revolution to radians.

ssr-yuki commented 2 years ago

It is not a bug.

Currently we use vesc_driver as a library, and binaries in vesc_driver package are only for debugging.

See https://github.com/sbgisen/vesc/tree/develop/vesc_hw_interface ; this package supports the unit conversion for various types of hardware integration.

Or, please contribute if you have problems on that.

AbdElRahmanFarhan commented 2 years ago

Thanks for pointing that out. So, you mean that the position is actually returned as revolution and I only need to convert it to radians, right?

ssr-yuki commented 2 years ago

No, in my understanding. I think that the unit of position is not the number of rotations but the number of hall sensor pulses.

The following codes would help you, where the number of pole pairs and the gear ratio are parameters you have to set. https://github.com/sbgisen/vesc/blob/3d25c6a61d7cd14c673efe7412cbccd8afb7cad5/vesc_hw_interface/src/vesc_hw_interface.cpp#L218-L225