leggedrobotics / darknet_ros

YOLO ROS: Real-Time Object Detection for ROS
BSD 3-Clause "New" or "Revised" License
2.14k stars 1.17k forks source link

program crashes after i try to read data from my custom topic #416

Open federista opened 10 months ago

federista commented 10 months ago

Describe the bug Program crashes as soon as i read from my EO topic "/Image_EO/image_raw/compressed"

This topic exists in my rostopic list

I have edited the launch file accordingly

<arg name="launch_prefix" default=""/>
  <arg name="image" default="/Image_EO/image_raw/compressed" />

my ros.yaml file

`subscribers:

  camera_reading:
    topic: /Image_EO/image_raw/compressed
    queue_size: 1

actions:

  camera_reading:
    name: /project_main_gui_v13/check_for_objects

publishers:

  object_detector:
    topic: /project_main_gui_v13/found_object
    queue_size: 1
    latch: false

  bounding_boxes:
    topic: /project_main_gui_v13/bounding_boxes
    queue_size: 1
    latch: false

  detection_image:
    topic: /project_main_gui_v13/detection_image
    queue_size: 1
    latch: true

image_view:

  enable_opencv: false
  wait_key_delay: 1
  enable_console_output: true`

Part of the code where i declared to the topic to which i have to subcsribe


    nodeHandle_.param("project_main_gui_v13/subscribers/camera_reading/topic", cameraTopicName, std::string("/Image_EO/image_raw/compressed"));
    nodeHandle_.param("project_main_gui_v13/subscribers/camera_reading/queue_size", cameraQueueSize, 1);
    nodeHandle_.param("project_main_gui_v13/publishers/object_detector/topic", objectDetectorTopicName, std::string("found_object"));
    nodeHandle_.param("project_main_gui_v13/publishers/object_detector/queue_size", objectDetectorQueueSize, 1);
    nodeHandle_.param("project_main_gui_v13/publishers/object_detector/latch", objectDetectorLatch, false);
    nodeHandle_.param("project_main_gui_v13/publishers/bounding_boxes/topic", boundingBoxesTopicName, std::string("bounding_boxes"));
    nodeHandle_.param("project_main_gui_v13/publishers/bounding_boxes/queue_size", boundingBoxesQueueSize, 1);
    nodeHandle_.param("project_main_gui_v13/publishers/bounding_boxes/latch", boundingBoxesLatch, false);
    nodeHandle_.param("project_main_gui_v13/publishers/detection_image/topic", detectionImageTopicName, std::string("detection_image"));
    nodeHandle_.param("project_main_gui_v13/publishers/detection_image/queue_size", detectionImageQueueSize, 1);
    nodeHandle_.param("project_main_gui_v13/publishers/detection_image/latch", detectionImageLatch, true);

The part of the code where it crashes

Allocate additional workspace_size = 24.92 MB 
 Try to load weights: /home/rack_dl/MINISAR_Project/MINISAR_V13_corretto/MINISAR_Project_SW_V13/src/project_main_gui_v13/yolo_network_config/weights/yolov2-tiny.weights 
Loading weights from /home/rack_dl/MINISAR_Project/MINISAR_V13_corretto/MINISAR_Project_SW_V13/src/project_main_gui_v13/yolo_network_config/weights/yolov2-tiny.weights...
 seen 64, trained: 26316 K-images (411 Kilo-batches_64) 
Done! Loaded 16 layers from weights-file 
 try to allocate additional workspace_size = 24.92 MB 
 CUDA allocate done! 
Waiting for image.
[project_main_gui_v13-1] process has died [pid 35278, exit code -11, cmd /home/rack_dl/MINISAR_Project/MINISAR_V13_corretto/MINISAR_Project_SW_V13/devel/lib/project_main_gui_v13/project_main_gui_v13 camera/rgb/image_raw:=/Image_EO/image_raw/compressed __name:=project_main_gui_v13 __log:=/home/rack_dl/.ros/log/1ace219c-4588-11ee-8085-e4434b9afbad/project_main_gui_v13-1.log].
log file: /home/rack_dl/.ros/log/1ace219c-4588-11ee-8085-e4434b9afbad/project_main_gui_v13-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done

It actually reads from a topic. i can see the visualization window for a second and then it crashes. It will be highly appreciated if someone can assist me in finding the problem. Thank you