CommonplaceRobotics / iRC_ROS

ROS2 packages for the igus Robot Control
Apache License 2.0
15 stars 7 forks source link

Replace bitsets for digital IO? #9

Open cpr-fer opened 1 year ago

cpr-fer commented 1 year ago

Currently each module has a bitset of fixed size that contains the values of digital IOsfor the CAN side of the hardware interface. A copy of this data is stored in a vector of doubles, which size is set depending on the number of IOs configured for the module in the hardware interface init. This limits the number of usable inputs to the size of these bitsets. Currently no module has more than 7 inputs or outputs, as such the bitsets of size 8 are sufficient. Still, it would be cleaner to also dynamically change the size of the bitsets, which is not supported by the datatype. The cpp reference recommends the use of vector or boost::dynamic bitset. For easy parsing of bytes the current solution is superior and does not require boost.