VESC_packet.cpp fix vesc fw3.3
motors ROS VESC

ROS Driver VESC 3.33 Firmware Fix

In order to be able to use encoders on the HW pins on the VESC (avoid modification of the VESC hall sensor filter) one need to upgrade the Firmware to a later version with the option //#define AS5047_USE_HW_SPI_PINS 1 in the conf_general.h file. by uncommenting that line the VESC will use HW ports to communicate with the encoder.

If one have integrated Hall sensors PCB on the motors one could still use the hall sensor port to receive engine temperature (this is how I do it)

But with the new firmware it turns out that the current ROS Driver does not work. datatypes.h changed with new VESC hardware. So in order to fix that look at https://github.com/mit-racecar/vesc/issues/11

vesc /sensor/core topic error
vesc /sensor/core topic error

Second problem, Looking at the /sensor/core topic in ROS one would see that the values are all messed up. The problem is the vesc_packet.cpp and the the mapping of the bytes. So to fix this I remapped the bytes and everything is working great.

Here is my vesc_packet.cpp that is confirmed working on Firmware 3.33

VESC_packet.cpp fix vesc fw3.3
VESC_packet.cpp fix vesc fw3.3

Don’t forget to recompile the catkin workspace after change are made to the vesc_driver with catkin_make.

I take no responsibility for injury or hardware damage. So please continue at your own risk!

 

raess

Chief Technology Officer with a demonstrated history of working in the internet industry. Skilled in Business Planning, Computer-Aided Design (CAD), Quality Process Development, and SolidWorks. Strong business development professional with a Higher Education Diploma with specialization in Mechanical Engineering focused in Product development from Blekinge Institute of Technology.

http://valify.se

Leave a Reply

Your email address will not be published. Required fields are marked *