Closed ShotaAk closed 4 years ago
ament_copyright
を通すため、ソースファイルのヘッダにMITライセンスの条文を書き加える。
文章のテンプレートは下記を参照。
コンフリクトを防ぐため、lint対策するときはissueを立てる。
こちらについて,protobufについてlintがうまくいく時といかない時があるようです.
senderではgrSim_Packet.protoのように大文字やアンダーバーを含んだものになっていて,変換後にもgrSim_Packet.pb.hのように大文字となっています. 一方,receiverではreferee.protoのように小文字のみとなっていて,変換後にもreferee.pb.hとなっています.
これらのheaderをincludeすると,colcon testで前者は通るが後者は通りません. 後者は
Include the directory when naming .h files
というエラーが出ており,どうやら
#include "(何らかのディレクトリ)/referee.pb.h"
とする必要がありそうですが,protobufは何かのディレクトリの下にpb.hを出力する仕様ではないため,エラーを消すことができなさそうです.
今のところ思いついている解決策は2つあって,
#include "./referee.pb.h"
とする referee.protoをSSL_Referee.protoにrenameする といった感じです.
https://stackoverflow.com/questions/26147454/how-to-automatically-move-pb-h-and-pb-h-under-include-and-src-directories これの一番下のコメントを参考にして,protoディレクトリにCMakeLists.txtを足して,add_subdirectoryを呼ぶのもありかもしれません.
一旦"./referee.pb.h"のようにすることで,現在あるPull Requestのcolcon testを(多分)(あと8分程度で確定する)すべて通しました. https://github.com/SSL-Roots/consai2r2/pull/34 https://github.com/SSL-Roots/consai2r2/pull/35
そういう問題があるんですね。
今回はディレクトリをきれいに保つため、*.pb.hをprotoディレクトリに生成しないようにしてました。
consai2ではadd_subdirectory使ってました。 https://github.com/SSL-Roots/consai2/blob/master/consai2_sender/scripts/proto/CMakeLists.txt
最終的にどうするか、考え中(保留)
issueが抽象的なことと、lintが通ったことにより、本件closeします。 protoをどうするかは他のPRやissueで議論する(議論済み)
CIにlintを取り入れる予定です。 コード量が増える前に対策したい。