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

rosnode kill /naoqi_driver してもlaunchが終了しない #8

Open
kochigami opened this issue May 6, 2019 · 2 comments
Open

rosnode kill /naoqi_driver してもlaunchが終了しない #8

kochigami opened this issue May 6, 2019 · 2 comments

Comments

@kochigami
Copy link
Owner

これは正しい挙動なのか?

roslaunch naoqi_driver naoqi_driver.launch network_interface:=enp0s31f6

して、

rosnode kill /naoqi_driver 
killing /naoqi_driver
killed

すると

[ WARN] [1557115485.364477975]: Shutdown request received.
[ WARN] [1557115485.364536168]: Reason given for shutdown: [user request]

が出てくるがnaoqi_driver.launchは終了しない。

rosnode listを見るとノードは死んでいるけどプロセスは残っている。

ps aux | grep roscore
pepper    7348 12.9  0.3 1421272 54676 ?       Ssl  13:04   0:20 /home/pepper/catkin_ws/devel/lib/naoqi_driver/naoqi_driver_node --qi-url=tcp://133.11.216.147:9559 --roscore_ip=127.0.0.1 --network_interface=enp0s31f6 --namespace=naoqi_driver --bootconfig_name=boot_config.json __name:=naoqi_driver __log:=/home/pepper/.ros/log/791306d6-6faa-11e9-a27f-e86a6433c63f/naoqi_driver-1.log
pepper    8221  0.0  0.0  15244   976 pts/25   S+   13:07   0:00 grep --exclude-dir=.svn roscore

それで、別ターミナルで

roslaunch naoqi_driver naoqi_driver.launch network_interface:=enp0s31f6

すると、

terminate called after throwing an instance of 'qi::FutureUserException'
  what():  Service "ROS-Driver" (#242) is already registered. Rejecting conflicting registration attempt.
================================================================================REQUIRED process [naoqi_driver-1] has died!
process has died [pid 7968, exit code -6, cmd /home/pepper/catkin_ws/devel/lib/naoqi_driver/naoqi_driver_node --qi-url=tcp://133.11.216.147:9559 --roscore_ip=127.0.0.1 --network_interface=enp0s31f6 --namespace=naoqi_driver --bootconfig_name=boot_config.json __name:=naoqi_driver __log:=/home/pepper/.ros/log/791306d6-6faa-11e9-a27f-e86a6433c63f/naoqi_driver-1.log].
log file: /home/pepper/.ros/log/791306d6-6faa-11e9-a27f-e86a6433c63f/naoqi_driver-1*.log
Initiating shutdown!
================================================================================
[naoqi_driver-1] killing on exit

が出て落ちる。

@kochigami
Copy link
Owner Author

kochigami commented May 6, 2019

kochigami/naoqi_bridge#11 の元
roslaunch naoqi_pose pose_manager.launch

rosnode kill /pose_controller 
killing /pose_controller
killed

したら、

================================================================================REQUIRED process [pose_controller-1] has died!
process has finished cleanly
log file: /home/pepper/.ros/log/791306d6-6faa-11e9-a27f-e86a6433c63f/pose_controller-1*.log
Initiating shutdown!
================================================================================

こうなった。naoqi_driverにバグがあるのではないか

@kochigami
Copy link
Owner Author

ちょっと調べた。理由は分かったけれど、解決策は全然分からない。

naoqi_driver/src/external_registration.cpp

  std::cout << BOLDYELLOW << "naoqi_driver initialized" << RESETCOLOR << std::endl;
  app.run();
  std::cout << BOLDYELLOW << "1" << RESETCOLOR << std::endl;
  bs->stopService();
  std::cout << BOLDYELLOW << "2" << RESETCOLOR << std::endl;
  app.session()->close();
  std::cout << BOLDYELLOW << "3" << RESETCOLOR << std::endl;

で、rosnode killするときは、app.run()の中にいるから、シグナルを受け取るだけで、実際にノードを落とせていない。
app.session()->close();まで行って、
ようやくnaoqi_driver.cppのDriverクラスのデコンストラクタが呼ばれて、ros::shutdown()される。

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

No branches or pull requests

1 participant