Yaskawa-Global / motoros2

ROS 2 (rcl, rclc & micro-ROS) node for MotoPlus-compatible Yaskawa Motoman robot controllers
92 stars 15 forks source link

max TF prefix len > max total TF frame name len #36

Open gavanderhoorn opened 1 year ago

gavanderhoorn commented 1 year ago

The maximum TF frame prefix length is set to MAX_YAML_STRING_LEN here:

https://github.com/Yaskawa-Global/motoros2/blob/08329e5a1646315bffb5effdb40857eaea343523/src/ConfigFile.h#L107

with MAX_YAML_STRING_LEN set to 128 here:

https://github.com/Yaskawa-Global/motoros2/blob/08329e5a1646315bffb5effdb40857eaea343523/src/ConfigFile.h#L14

The total allowed TF frame name length is limited to MAX_TF_FRAME_NAME_LENGTH:

https://github.com/Yaskawa-Global/motoros2/blob/08329e5a1646315bffb5effdb40857eaea343523/src/CtrlGroup.h#L24

This is potentially problematic here:

https://github.com/Yaskawa-Global/motoros2/blob/08329e5a1646315bffb5effdb40857eaea343523/src/PositionMonitor.c#L191-L215

as we concatenate the prefix with the non-prefixed frame name. Theoretically, a user could configure a prefix with length 100 (or something > 96) and we'd end up with all transforms having their frame_id and child_frame_id set to the frame_prefix.

gavanderhoorn commented 1 year ago

An easy 'work-around' would be to just increase the involved constants, but that seems like it would only postpone eventual problems.

No single value would seem to fundamentally solve the actual issue, as unfortunately we have to use fixed-length strings due to memory/runtime constraints.