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

Communication Failure Depending on Startup Order When Running mros2-posix and mros2-host-example on a Single #11

Open
MrBearing opened this issue Sep 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@MrBearing
Copy link
Collaborator

MrBearing commented Sep 27, 2024

PC一つのPC上でmros2-posixとmros2-host-exampleを動作させると起動順序によって通信できない場合がある

2つの端末A,Bを用意し、それぞれ以下のビルドした。

[端末A]

source /opt/ros/humble/setup.bash
cd ws_ros
git clone https://github.com/mROS-base/mros2-host-examples
cd mros2-host-examples
colcon build --packages-select mros2_echoreply_string
source install/setup.bash

[端末B]

git clone --recursive https://github.com/mROS-base/mros2-posix.git
cd mros2-posix/
bash build.bash clean
bash build.bash all echoback_string

ビルド完了後、端末A実行後に端末Bで下記のコマンド実行したところ端末Bに以下の様なログが表示された。

[端末A プログラム実行コマンド]

ros2 run mros2_echoreply_string echoreply_node

[端末B プログラム実行コマンド]

./cmake_build/mros2-posix 

[端末B 実行時ログ]

ipaddr=0xef20a8c0
mask=0x00feffff
LOG_NOTICE : 00000000.000 : osKernelStart
LOG_NOTICE : 00000000.000 : mros2-posix start!

LOG_NOTICE : 00000000.000 : app name: echoback_string

LOG_DEBUG : 00000000.000 : mROS 2 initialization is completed

LOG_DEBUG : 00000000.000 : [MROS2LIB] create_node
LOG_DEBUG : 00000000.000 : [MROS2LIB] start creating participant
LOG_DEBUG : 00000000.000 : [MROS2LIB] mros2_init task start
LOG_DEBUG : 00000000.000 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_init() 28: enter
LOG_DEBUG : 00000000.000 : [MROS2LIB] Initilizing lwIP complete
LOG_DEBUG : 00000000.000 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_new() 306: enter
LOG_DEBUG : 00000000.000 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_alloc() 24: enter
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_alloc() 42: mcp=0x79f648000db0 exit
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_new() 326: exit
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_bind() 141: ipaddr=0x0 port=7401 enter
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_bind() 154: mcp exist 0x79f648000db0
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_bind() 224: exit
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_recv() 239: enter
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_recv() 250: exit
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_new() 306: enter
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_alloc() 24: enter
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_alloc() 42: mcp=0x79f648000dd0 exit
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_new() 326: exit
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_bind() 141: ipaddr=0x0 port=7400 enter
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_bind() 154: mcp exist 0x79f648000dd0
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_bind() 224: exit
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_recv() 239: enter
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_recv() 250: exit
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_joingroup() 78: enter ifaddr=0xef20a8c0 groupaddr=0x100ffef
LOG_NOTICE : 00000000.001 : thread_udp_recv:UP: mcp=0x79f648000db0
LOG_NOTICE : 00000000.001 : udp_mc_joingroup(): mcp=0x79f648000db0 ifaddr=0xef20a8c0 groupaddr=0x100ffef
LOG_NOTICE : 00000000.001 : udp_mc_joingroup(): mcp=0x79f648000dd0 ifaddr=0xef20a8c0 groupaddr=0x100ffef
LOG_DEBUG : 00000000.001 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_joingroup() 93: exit
LOG_NOTICE : 00000000.001 : thread_udp_recv:UP: mcp=0x79f648000dd0
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_new() 306: enter
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_alloc() 24: enter
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_alloc() 42: mcp=0x79f648000df0 exit
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_new() 326: exit
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_bind() 141: ipaddr=0x0 port=7411 enter
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_bind() 154: mcp exist 0x79f648000df0
LOG_ERROR : 00000000.101 : udp_bind() bind() err=98
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_remove() 267: enter
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_free() 52: enter
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_free() 62: exit
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_remove() 287: exit
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_new() 306: enter
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_alloc() 24: enter
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_alloc() 42: mcp=0x79f648000df0 exit
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_new() 326: exit
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_bind() 141: ipaddr=0x0 port=7410 enter
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_bind() 154: mcp exist 0x79f648000df0
LOG_ERROR : 00000000.101 : udp_bind() bind() err=98
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_remove() 267: enter
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_free() 52: enter
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_free() 62: exit
LOG_DEBUG : 00000000.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_remove() 287: exit
LOG_DEBUG : 00000000.101 : [MROS2LIB] successfully created participant
LOG_DEBUG : 00000000.101 : [MROS2LIB] create_publisher complete.
LOG_DEBUG : 00000000.201 : [MROS2LIB] Initilizing Domain complete
LOG_DEBUG : 00000001.102 : [MROS2LIB] create_subscription complete.
LOG_NOTICE : 00000001.102 : ready to pub/sub message

LOG_NOTICE : 00000001.102 : publishing msg: 'TestMessage0'
LOG_DEBUG : 00000001.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_new() 306: enter
LOG_DEBUG : 00000001.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_alloc() 24: enter
LOG_DEBUG : 00000001.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_alloc() 42: mcp=0x79f648000df0 exit
LOG_DEBUG : 00000001.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_new() 326: exit
LOG_DEBUG : 00000001.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_bind() 141: ipaddr=0x0 port=7410 enter
LOG_DEBUG : 00000001.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_bind() 154: mcp exist 0x79f648000df0
LOG_ERROR : 00000001.102 : udp_bind() bind() err=98
LOG_DEBUG : 00000001.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_remove() 267: enter
LOG_DEBUG : 00000001.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_free() 52: enter
LOG_DEBUG : 00000001.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_free() 62: exit
LOG_DEBUG : 00000001.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_remove() 287: exit
LOG_NOTICE : 00000002.102 : publishing msg: 'TestMessage1'
LOG_NOTICE : 00000003.102 : publishing msg: 'TestMessage2'
LOG_DEBUG : 00000004.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_new() 306: enter
LOG_DEBUG : 00000004.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_alloc() 24: enter
LOG_DEBUG : 00000004.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_alloc() 42: mcp=0x79f648000df0 exit
LOG_DEBUG : 00000004.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_new() 326: exit
LOG_DEBUG : 00000004.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_bind() 141: ipaddr=0x0 port=7410 enter
LOG_DEBUG : 00000004.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_bind() 154: mcp exist 0x79f648000df0
LOG_ERROR : 00000004.101 : udp_bind() bind() err=98
LOG_DEBUG : 00000004.101 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_remove() 267: enter
LOG_DEBUG : 00000004.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_free() 52: enter
LOG_DEBUG : 00000004.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_free() 62: exit
LOG_DEBUG : 00000004.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_remove() 287: exit
LOG_DEBUG : 00000004.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_new() 306: enter
LOG_DEBUG : 00000004.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_alloc() 24: enter
LOG_DEBUG : 00000004.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_alloc() 42: mcp=0x79f648000df0 exit
LOG_DEBUG : 00000004.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_new() 326: exit
LOG_DEBUG : 00000004.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_bind() 141: ipaddr=0x0 port=7410 enter
LOG_DEBUG : 00000004.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_bind() 154: mcp exist 0x79f648000df0
LOG_ERROR : 00000004.102 : udp_bind() bind() err=98
LOG_DEBUG : 00000004.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_remove() 267: enter
LOG_DEBUG : 00000004.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_free() 52: enter
LOG_DEBUG : 00000004.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp_multicast_manager.c udp_mc_info_free() 62: exit
LOG_DEBUG : 00000004.102 : /home/takumi/mros2-posix/lwip-posix/src/core/udp.c udp_remove() 287: exit

(後略)

端末B実行コマンド後に端末A実行コマンドを動作させると、以下のような出力が得られ、テストプログラムが正常に終了する

(前略)
LOG_NOTICE : 00000001.101 : publishing msg: 'TestMessage0'
LOG_NOTICE : 00000002.101 : publishing msg: 'TestMessage1'
LOG_NOTICE : 00000003.101 : publishing msg: 'TestMessage2'
LOG_DEBUG : 00000003.394 : [MROS2LIB] subscriber matched with remote publisher
LOG_DEBUG : 00000003.394 : [MROS2LIB] publisher matched with remote subscriber
LOG_NOTICE : 00000004.101 : publishing msg: 'TestMessage3'
*test count : 1
LOG_DEBUG : 00000004.102 : Sub result:
 expect : 'TestMessage3',
 actural: 'TestMessage3'
LOG_DEBUG : 00000004.102 : expect length: 12, actual length: 13
LOG_NOTICE : 00000004.102 : ****SUCCEED****
LOG_NOTICE : 00000005.101 : publishing msg: 'TestMessage4'
*test count : 2
LOG_DEBUG : 00000005.102 : Sub result:
 expect : 'TestMessage4',
 actural: 'TestMessage4'
LOG_DEBUG : 00000005.102 : expect length: 12, actual length: 13
LOG_NOTICE : 00000005.102 : ****SUCCEED****
LOG_NOTICE : 00000006.101 : publishing msg: 'TestMessage5'
*test count : 3
LOG_DEBUG : 00000006.102 : Sub result:
 expect : 'TestMessage5',
 actural: 'TestMessage5'
LOG_DEBUG : 00000006.102 : expect length: 12, actual length: 13
LOG_NOTICE : 00000006.102 : ****SUCCEED****
LOG_NOTICE : 00000007.101 : publishing msg: 'TestMessage6'
*test count : 4
LOG_DEBUG : 00000007.102 : Sub result:
 expect : 'TestMessage6',
 actural: 'TestMessage6'
LOG_DEBUG : 00000007.102 : expect length: 12, actual length: 13
LOG_NOTICE : 00000007.102 : ****SUCCEED****
LOG_NOTICE : 00000008.101 : publishing msg: 'TestMessage7'

CIでの失敗例

@MrBearing MrBearing changed the title 一つのPC上でIP 一つのPC上でmros2-posixとmros2-host-exampleを動作させると起動順序によって通信できない Sep 27, 2024
@MrBearing MrBearing changed the title 一つのPC上でmros2-posixとmros2-host-exampleを動作させると起動順序によって通信できない 一つのPC上でmros2-posixとmros2-host-exampleを動作させると起動順序によって通信できない事がある Sep 27, 2024
@MrBearing MrBearing added the bug Something isn't working label Sep 27, 2024
@MrBearing MrBearing changed the title 一つのPC上でmros2-posixとmros2-host-exampleを動作させると起動順序によって通信できない事がある "Communication Failure Depending on Startup Order When Running mros2-posix and mros2-host-example on a Single Sep 28, 2024
@MrBearing MrBearing changed the title "Communication Failure Depending on Startup Order When Running mros2-posix and mros2-host-example on a Single Communication Failure Depending on Startup Order When Running mros2-posix and mros2-host-example on a Single Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant