f1tenth / vesc

Repository for the VESC Controller (ROS1 and ROS2)
BSD 3-Clause "New" or "Revised" License
51 stars 74 forks source link

Add IMU Output #3

Closed JWhitleyWork closed 2 years ago

JWhitleyWork commented 3 years ago

The VESC has an internal IMU. Assuming the data are published on the serial bus (which the VescTool seems to indicate), we should be able to read the data and publish a sensor_msgs/Imu.

SAA1995 commented 3 years ago

Hi,

I was wondering if you have made some progress on this package, extracting IMU packets from VESC for use in ROS.

I would like to do this as well, but im not that great on coding in C++, and therefore cant really figure out how to start working on this. But if you or anyone wants more hands to make this package happen faster im willing to volunteer and help out on some aspects, provided I can understand what I need to do. ;)

JWhitleyWork commented 3 years ago

@SAA1995 Unfortunately, I have not been able to do this yet. The main reason is that I need to reverse-engineer the firmware in order to identify the keyword on the serial packet which allows us to parse the data over the serial line. I have been unable to do this successfully as of yet.

travelbureau commented 3 years ago

I don't know if this will be helpful, but I suggest looking for a component that is -9.81 or +9.81 etc (not sure if they zero out gravity, but this would be a dead giveaway). See https://github.com/f1tenth/vesc/blob/main/vesc_driver/src/vesc_packet.cpp line 127. Seems like mostly they just have one giant packet and specific values are by position?

SAA1995 commented 3 years ago

Hi all. @JWhitleyWork , i see, and this is something I also got in response from Benjamin vedder and some other people on the VESC github link, ive added that below for reference. There, I asked them about the ros implementation for IMU. https://github.com/vedderb/bldc/issues/253 I will also go through the code for the VESC and see if I can find the packet, if i do ill let you know.

@travelbureau I dont think the ROS implementation even mentions that packet, those are new packets added I guess after the package for vesc driver ros package was made. ANd so the packets in vesc driver code have packets which you already get on the topic /vesc/sensors/core and /vesc/sensors/servo.

I think we will need to go to the main vesc code on: https://github.com/vedderb/bldc and then find the packet from here or reuse their code which is used to transfer stuff to the VESC app made by Benjamin vedder.

hzheng40 commented 3 years ago

@SAA1995 The “ROS implementation” you mentioned IS this repo. Josh has done the CI work so it gets published as a ROS package.

SAA1995 commented 3 years ago

Oh apologies for that. I didnt notice that. I will have a look again then I guess.

JWhitleyWork commented 2 years ago

Closed with #19