mROS-base / mros2

agent-less and lightweight communication library compatible with rclcpp for embedded devices
Apache License 2.0
164 stars 15 forks source link

header_generator.py generated file with wrong file name #34

Closed TatsukiNishimura closed 1 year ago

TatsukiNishimura commented 2 years ago

environment

When I tried to generate Transform.hpp from Transform.msg with header_generator.py, the generated file name wasTransfor.hpp. Maybe this code is the cause. https://github.com/mROS-base/mros2/blob/d66f3b15bb5f3cdf5f889ab0baa2bd5bd9cb5710/mros2_header_generator/msg_data_generator.py#L16

rstrip() removes the trailing characters from the string. In this case, it removes ".msg" from Transform.msg, but it removes all combines of.msg such as m, ms , g and so on. Therefore, not Transform.hpp but Transfor.hpp was generated.

TatsukiNishimura commented 2 years ago

I use

lineArr[2] = os.path.splitext(lineArr[2])[0]

instead of original code, and it works.

takasehideki commented 1 year ago

@TatsukiNishimura san, thank you so much for an important report! I confirmed the issue you suggested and completely agree with your idea. We are grateful if you send a PR to fix this issue :D

TatsukiNishimura commented 1 year ago

I made a PR #35. I would appreciate if you check it.

takasehideki commented 1 year ago

thanks again!! ❤️