ut-issl / s2e-core

Spacecraft Simulation Environment Core codes
MIT License
46 stars 18 forks source link

最新のs2e-coreでHILSが動かせるようにする #634

Closed ogoogo closed 4 months ago

ogoogo commented 5 months ago

Related issues

633

Description

最新のs2e-coreでHILSが動かせるようにする

Test results

Provide the test results and a link to the detailed results log.

Impact

Describe the scope of influence of the changes, e.g., The behavior of feature ** changes.

Supplementary information

Provide any supplementary information.

ogoogo commented 5 months ago

E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_uart_port.cpp(54,32): warning C4101: 'e': ローカル変数は 1 度も使われていません。 E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_uart_port.cpp(71,50): warning C4101: 'e': ローカル変数は 1 度も使われていません。 E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_uart_port.cpp(81,50): warning C4101: 'e': ローカル変数は 1 度も使われていません。 E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_uart_port.cpp(88,40): warning C4101: 'e': ローカル変数は 1 度も使われていません。 E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_uart_port.cpp(97,38): warning C4101: 'e': ローカル変数は 1 度も使われていません。 E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_uart_port.cpp(116,32): warning C4101: 'e': ローカル変数は 1 度も使われていません。 E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_uart_port.cpp(133,39): warning C4101: 'e': ローカル変数は 1 度も使われていません。 E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_uart_port.cpp(140,32): warning C4101: 'e': ローカル変数は 1 度も使われていません。 E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_uart_port.cpp(153,32): warning C4101: 'e': ローカル変数は 1 度も使われていません。 E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_uart_port.cpp(167,32): warning C4101: 'e': ローカル変数は 1 度も使われていません。 E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_uart_port.cpp(180,32): warning C4101: 'e': ローカル変数は 1 度も使われていません。 E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_i2c_target_port.cpp(60,24): error C2131: 式は定数に評価されませんでした E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_i2c_target_port.cpp(60,24): message : 期限切れの変数の読み取りによってエラーが発生しました [E:\nlab_guest\user\ogoshi\s2e-core\CMakeBuilds\src\components\COMPONENT.vcxproj] E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_i2c_target_port.cpp(60,24): message : 'this' の使用量を参照してください [E:\nlab_guest\user\ogoshi\s2e-core\CMakeBuilds\src\components\COMPONENT.vcxproj] E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_i2c_target_port.cpp(63,22): warning C4018: '>': signed と unsigned の数値を比較しようとしました。 E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_i2c_target_port.cpp(92,24): error C2131: 式は定数に評価されませんでした E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_i2c_target_port.cpp(92,24): message : 期限切れの変数の読み取りによってエラーが発生しました [E:\nlab_guest\user\ogoshi\s2e-core\CMakeBuilds\src\components\COMPONENT.vcxproj] E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_i2c_target_port.cpp(92,24): message : 'this' の使用量を参照してください [E:\nlab_guest\user\ogoshi\s2e-core\CMakeBuilds\src\components\COMPONENT.vcxproj] E:\nlab_guest\user\ogoshi\s2e-core\src\components\ports\hils_i2c_target_port.cpp(94,15): error C3863: 配列型 'unsigned char [this->456]' を割り当てることはできません。 [E:\nlab_guest\user\ogoshi\s2e-core\CMakeBuilds\src\components\COMPONENT.vcxproj]

seki-hiro commented 5 months ago

@sksat @200km 最新のcoreで再度windowsのcom portをつかってHILSを動かしたく、デバッグを進めるにあたって参考にするため、質問させてください。HILSが保守されていたv5.0.0から、HILS周りに影響がありそうな変更がぱっとわかれば教えていただけないでしょうか?

現在、includeまわりを修正してHILSをまわそうとすると、上記のエラーが出ます。c++/cliを動かすための設定がうまくいっていないかと思い、この辺を見ています。HILSが保守されていたv5.0.0では以下の記述がありました。

set_target_properties(HILS_IO PROPERTIES COMMON_LANGUAGE_RUNTIME "") set_target_properties(RELATIVE_INFO PROPERTIES COMMON_LANGUAGE_RUNTIME "")

対応するproject(HILS_IO)やproject(RELATIVE_INFO)に関する記述が各cmakelists.txtから消えているのは、単にHILS以外のディレクトリ整理の都合上必要なくなったから(=HILSを動かすには復活させる必要がある)でしょうか?

200km commented 5 months ago

対応するproject(HILS_IO)やproject(RELATIVE_INFO)に関する記述が各cmakelists.txtから消えているのは、単にHILS以外のディレクトリ整理の都合上必要なくなったから(=HILSを動かすには復活させる必要がある)でしょうか?

HILS_IOとRELATIVE_INFOというディレクトリがなくなったので、それらの設定がなくなりました。ただし、ディレクトリが消えても中にあったファイルが別の場所に写っているので、写った先のプロジェクトに対して設定を行わないとHILSがうまく動かないと思うので、似たような設定を別プロジェクトに対して行わないといけないですね。

200km commented 5 months ago

ただ、現在のCMakeのHILSよう設定に入っていないのは、LIBRARYだけでLIBRARYには、HILS_IORELATIVE_INFOにあったものはなく、SIMULATIONに移っていると思うんですよね。

seki-hiro commented 5 months ago

ありがとうございます。すると、別のところに原因がありそうですね。。見てみます。

sksat commented 5 months ago

@seki-hiro COMMON_LANGUAGE_RUNTIME は確かに HILS 特有で必要となるライブラリですが,これはリンク時の問題なので https://github.com/ut-issl/s2e-core/pull/634#issuecomment-1999173946 にあるエラーとは関係が無いと思います.単に C++ の範囲内でのコンパイルエラーが出ているように見えます.具体的には C2131C3863

seki-hiro commented 5 months ago

変数定義の場所をもとに戻したらbuildできるようになった。kDefaultCommandSizeがprivateに移され、コンパイル時に評価可能な定数になっていなかったことが原因。

HILSが動いたらcloseする。