boilerrobotics / rover-code

Source code repo for Purdue Boiler Robotics Club
GNU General Public License v3.0
6 stars 3 forks source link

ODrive Telemetry #88

Open tame0001 opened 8 months ago

tame0001 commented 8 months ago

We need to add a function periodically read Odrive value. Let's start with voltage , current. These two parameters are Odrive basic. So, there will be 6 values. Next, it would be nice to experiment with other parameters. I don't have done this before, so I can only point to potential parameters. mechanical power, electrical power, estimated velocity.

We will need to create a custom message for these parameters. The structure of the message is debatable. As well as the topic name. I am open to hearing what you think.

The challenge is we probably cannot write a dedicated package for this task since drive occupies the Odrive abstract. We need to add this function into drive package (still okay to write another file then import to drive's main file. We will need to create a periodical task but how to do that in the most effective way is still a question. Using time.sleep() is probably not a good idea as it will block the process. Let's think about it.

The end goal is to send this information as a topic to the base station. Then I will run MQTT bridge on the base station and pass this data to GUI.

ky28059 commented 8 months ago

I think we can probably use the ROS built-in Timer class? It's able to run a callback on a loop which is what we want here, and it doesn't block the process when doing so.

tame0001 commented 8 months ago

More requirements: