jsk-ros-pkg / jsk_robot

jsk-ros-pkg/jsk_robot
https://github.com/jsk-ros-pkg/jsk_robot
73 stars 97 forks source link

[jsk_robot_startup/lifelog] LightweightLoggerでnodelet managerをloadすると起動できない #1743

Open tkmtnt7000 opened 2 years ago

tkmtnt7000 commented 2 years ago

以下のようにしてLightweightLoggerで画像をdatabaseにためようとするとnodeletがロードできなくて落ちます.

ログ

started roslaunch server http://133.11.216.83:35535/

SUMMARY

PARAMETERS

NODES / mongodb_go_to_kitchen_nodelet_manager (nodelet/nodelet) /go_to_kitchen/ camera_throttle (nodelet/nodelet) dialogflow_logger (jsk_robot_startup/mongo_record.py) rgb_camera_info_logger (nodelet/nodelet) rgb_image_logger (nodelet/nodelet)

ROS_MASTER_URI=http://fetch15:11311

process[mongodb_go_to_kitchen_nodelet_manager-1]: started with pid [74988] process[go_to_kitchen/camera_throttle-2]: started with pid [74989] process[go_to_kitchen/rgb_image_logger-3]: started with pid [74990] process[go_to_kitchen/rgb_camera_info_logger-4]: started with pid [74991] process[go_to_kitchen/dialogflow_logger-5]: started with pid [74992] [ERROR] [1669714590.441017927]: Skipped loading plugin with error: XML Document '/opt/ros/noetic/share/prosilica_camera/plugins/nodelet_plugins.xml' has no Root Element. This likely means the XML is malformed or missing.. [ INFO] [1669714590.678425409]: Initializing nodelet with 32 worker threads. [ WARN] [1669714591.357427133]: This nodelet is deprecated. Use topic_tools/Relay with stealth_mode nodelet: /usr/include/boost/smart_ptr/shared_ptr.hpp:734: typename boost::detail::sp_member_access::type boost::shared_ptr::operator->() const [with T = jsk_topic_tools::VitalChecker; typename boost::detail::sp_member_access::type = jsk_topic_tools::VitalChecker]: Assertion px != 0' failed. [FATAL] [1669714593.429982375]: Failed to load nodelet '/go_to_kitchen/rgb_camera_info_logger of type jsk_robot_lifelog/LightweightLogger to manager /mongodb_go_to_kitchen_nodelet_manager' [FATAL] [1669714593.429983577]: Failed to load nodelet '/go_to_kitchen/rgb_image_logger of type jsk_robot_lifelog/LightweightLogger to manager `/mongodb_go_to_kitchen_nodelet_manager' [mongodb_go_to_kitchen_nodelet_manager-1] process has died [pid 74988, exit code -6, cmd /opt/ros/noetic/lib/nodelet/nodelet manager __name:=mongodb_go_to_kitchen_nodelet_manager __log:=/home/tsukamoto/.ros/log/4acdc09c-6fc7-11ed-9b1a-f3e8d7031083/mongodb_go_to_kitchen_nodelet_manager-1.log]. log file: /home/tsukamoto/.ros/log/4acdc09c-6fc7-11ed-9b1a-f3e8d7031083/mongodb_go_to_kitchen_nodelet_manager-1.log [go_to_kitchen/rgb_image_logger-3] process has died [pid 74990, exit code 255, cmd /opt/ros/noetic/lib/nodelet/nodelet load jsk_robot_lifelog/LightweightLogger /mongodb_go_to_kitchen_nodelet_manager ~input:=rgb/image_rect_color/compressed name:=rgb_image_logger log:=/home/tsukamoto/.ros/log/4acdc09c-6fc7-11ed-9b1a-f3e8d7031083/go_to_kitchen-rgb_image_logger-3.log]. log file: /home/tsukamoto/.ros/log/4acdc09c-6fc7-11ed-9b1a-f3e8d7031083/go_to_kitchen-rgb_image_logger-3.log [go_to_kitchen/rgb_camera_info_logger-4] process has died [pid 74991, exit code 255, cmd /opt/ros/noetic/lib/nodelet/nodelet load jsk_robot_lifelog/LightweightLogger /mongodb_go_to_kitchen_nodelet_manager ~input:=rgb/camera_info __name:=rgb_camera_info_logger __log:=/home/tsukamoto/.ros/log/4acdc09c-6fc7-11ed-9b1a-f3e8d7031083/go_to_kitchen-rgb_camera_info_logger-4.log]. log file: /home/tsukamoto/.ros/log/4acdc09c-6fc7-11ed-9b1a-f3e8d7031083/go_to_kitchen-rgb_camera_info_logger-4.log

topics: - /sound_play/goal - /speech_to_text

common_logger.launch
https://github.com/tkmtnt7000/jsk_robot/blob/mongo-kitchen-test/jsk_robot_common/jsk_robot_startup/lifelog/common_logger.launch
knorth55 commented 2 years ago

with your branch, I can run the launch...

$ git status
ブランチ mongo-kitchen-test
Your branch is up to date with 'tkmtnt7000/mongo-kitchen-test'.

追跡されていないファイル:
  (use "git add <file>..." to include in what will be committed)

    spam.launch

nothing added to commit but untracked files present (use "git add" to track)
$ roslaunch ./spam.launch 
... logging to /home/knorth55/.ros/log/9df9375a-7063-11ed-9c05-93f1ec0226b2/roslaunch-melodic-p50-14946.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
WARNING: disk usage in log directory [/home/knorth55/.ros/log] is over 1GB.
It's recommended that you use the 'rosclean' command.

started roslaunch server http://10.20.0.2:40173/

SUMMARY
========

PARAMETERS
 * /go_to_kitchen/camera_throttle/approximate_sync: True
 * /go_to_kitchen/camera_throttle/topics: ['/head_camera/rg...
 * /go_to_kitchen/camera_throttle/update_rate: 1.0
 * /go_to_kitchen/dialogflow_logger/topics: ['/dialogflow_cli...
 * /go_to_kitchen/face_logger/topics: ['/aws_auto_check...
 * /go_to_kitchen/rgb_camera_info_logger/collection: go_to_kitchen
 * /go_to_kitchen/rgb_camera_info_logger/database: jsk_robot_lifelog
 * /go_to_kitchen/rgb_camera_info_logger/enable_monitor: False
 * /go_to_kitchen/rgb_camera_info_logger/monitor_topic: /head_camera/rgb/...
 * /go_to_kitchen/rgb_camera_info_logger/vital_check: True
 * /go_to_kitchen/rgb_image_logger/collection: go_to_kitchen
 * /go_to_kitchen/rgb_image_logger/database: jsk_robot_lifelog
 * /go_to_kitchen/rgb_image_logger/enable_monitor: False
 * /go_to_kitchen/rgb_image_logger/monitor_topic: /head_camera/rgb/...
 * /go_to_kitchen/rgb_image_logger/vital_check: True
 * /go_to_kitchen/speech_logger/topics: ['/sound_play/goa...
 * /rosdistro: melodic
 * /rosversion: 1.14.12

NODES
  /
    mongodb_go_to_kitchen_nodelet_manager (nodelet/nodelet)
  /go_to_kitchen/
    camera_throttle (nodelet/nodelet)
    dialogflow_logger (jsk_robot_startup/mongo_record.py)
    face_logger (jsk_robot_startup/mongo_record.py)
    rgb_camera_info_logger (nodelet/nodelet)
    rgb_image_logger (nodelet/nodelet)

ROS_MASTER_URI=http://fetch15:11311

process[mongodb_go_to_kitchen_nodelet_manager-1]: started with pid [14965]
process[go_to_kitchen/camera_throttle-2]: started with pid [14966]
process[go_to_kitchen/rgb_image_logger-3]: started with pid [14967]
process[go_to_kitchen/rgb_camera_info_logger-4]: started with pid [14968]
process[go_to_kitchen/face_logger-5]: started with pid [14969]
process[go_to_kitchen/dialogflow_logger-6]: started with pid [14970]
[ INFO] [1669780973.414238272]: Initializing nodelet with 8 worker threads.
[ WARN] [1669780973.558666923]: This nodelet is deprecated. Use `topic_tools/Relay` with `stealth_mode`
[ WARN] [1669780974.868671892]: This nodelet is deprecated. Use `topic_tools/Relay` with `stealth_mode`
[ INFO] [1669780979.829291825]: All topics are now published and synchronized
[ INFO] [1669780984.489838364]: successsfully stopped logger thread
[ INFO] [1669780985.222243709]: successsfully stopped logger thread
[go_to_kitchen/rgb_image_logger-3] process has finished cleanly
log file: /home/knorth55/.ros/log/9df9375a-7063-11ed-9c05-93f1ec0226b2/go_to_kitchen-rgb_image_logger-3*.log
[go_to_kitchen/camera_throttle-2] process has finished cleanly
log file: /home/knorth55/.ros/log/9df9375a-7063-11ed-9c05-93f1ec0226b2/go_to_kitchen-camera_throttle-2*.log
[go_to_kitchen/rgb_camera_info_logger-4] process has finished cleanly
log file: /home/knorth55/.ros/log/9df9375a-7063-11ed-9c05-93f1ec0226b2/go_to_kitchen-rgb_camera_info_logger-4*.log
^C[go_to_kitchen/dialogflow_logger-6] killing on exit
[go_to_kitchen/face_logger-5] killing on exit
[mongodb_go_to_kitchen_nodelet_manager-1] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
tkmtnt7000 commented 2 years ago

Thank you for debugging offline @knorth55

This issue may be solved by the following commits.

[jsk_robot_startup] not calling vitalchecker until initializing

[jsk_robot_startup] Fix private name space resolution

tkmtnt7000 commented 2 years ago
  1. nodeletを起動する際にvital_checker_が初期化される前に呼ばれて落ちる.(このissueの最初のログで出ているエラー)
  2. rosparamの~collectionで~が正しい名前空間としてセットされない.具体的には...
    • nodeletのload時にはnodelet managerの名前がセットされる (ex: /mongodb_go_to_kitchen_nodelet_manager/hoge_param)
    • nodeletをstandaloneで起ち上げた際はこのnodeの名前空間でセットされる (ex: /go_to_kitchen/rgb_image_logger/hoge_param) そのため,名前空間の違いにより,load時は正しくrosparamがセットされていなかった

これを解決するために,https://github.com/jsk-ros-pkg/jsk_robot/pull/1728/commits/63aeef03d8b37e7cfc135cc19966d96e4fe4e886 では

pnh_->resolveName(`hoge`)

を利用した.これによって正しい名前空間を引っ張ってくることができる