rit-spex / rovers

Rovers software monorepo.
0 stars 2 forks source link

CAN C++ Interface #34

Open ryan-barry-99 opened 8 months ago

ryan-barry-99 commented 8 months ago

Set up FlexCAN interface to be supported by all Teensy boards

ryan-barry-99 commented 8 months ago

I added the general structure for CAN Message IDs and configured the object dictionary to use them.

Right now the only IDs are for the target and current velocity of the rover's wheels, with the idea being that we can have all 6 velocities in a single 8 byte array and use the unsigned char bits of each byte to scale the velocities between a min and max range, utilizing the first bit for forward and reverse (1111 1111 for max reverse vel, 0111 1111 for max forward vel, x000 0000 for neutral)

We need to decide exactly what messages need to be sent and received for each board/thread and then decide on the data structure for that message. Additionally, the priority of the messages is important (albeit less so because of the high baud rate of the CAN bus) as lower ID messages are prioritized