Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launch引数指定 #55

Merged
merged 17 commits into from
Aug 6, 2024
Merged

Launch引数指定 #55

merged 17 commits into from
Aug 6, 2024

Conversation

H1rono
Copy link
Member

@H1rono H1rono commented Aug 4, 2024

#23 関連

Copy link
Collaborator

@Chikurin1014 Chikurin1014 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ためしに質問してみました

index_specified = PythonExpression([index, ">= 0"])
indexed_imshow = imshow_node(
name=["imshow_", index],
remappings=[("/app/camera_image", ["/packet/camera_image_", index])],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

["/packet/camera_image_", index]

は文字列の結合のようなことをしているのでしょうか?

f"/packet/camera_image_{index}"

などしないのは、indexLaunchConfiguration()の返り値であることと関係がありますか?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文字列の結合のようなことをしているのでしょうか?

はい。

indexLaunchConfiguration()の返り値であることと関係がありますか?

はい。これはlaunchファイルのsubstitutionという機能で、launchの実行時に文字列の結合が行われます。例えばros2 launch --show-args imshow imshow_launch.pyではlaunchの読み込みのみが行われて該当部分の文字列の結合は発生しません。

ref: ROS2を深く理解する:launchファイル編2 substitution

@H1rono H1rono merged commit 65bd050 into main Aug 6, 2024
1 check passed
@H1rono H1rono deleted the launch-argument branch August 6, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants