Skip to content

Commit

Permalink
Adding numerical ID and launch param for image
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunal Tyagi authored and kunaltyagi committed Oct 4, 2019
1 parent 687d8f9 commit b6432e7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions darknet_ros/launch/darknet_ros.launch
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<launch>
<!-- Console launch prefix -->
<arg name="launch_prefix" default=""/>
<arg name="image" default="/camera/rgb/image_raw" />

<!-- Config and weights folder. -->
<arg name="yolo_weights_path" default="$(find darknet_ros)/yolo_network_config/weights"/>
Expand All @@ -20,6 +21,7 @@
<node pkg="darknet_ros" type="darknet_ros" name="darknet_ros" output="screen" launch-prefix="$(arg launch_prefix)">
<param name="weights_path" value="$(arg yolo_weights_path)" />
<param name="config_path" value="$(arg yolo_config_path)" />
<remap from="camera/rgb/image_raw" to="$(arg image)" />
</node>

<!--<node name="republish" type="republish" pkg="image_transport" output="screen" args="compressed in:=/front_camera/image_raw raw out:=/camera/image_raw" /> -->
Expand Down
2 changes: 2 additions & 0 deletions darknet_ros/launch/yolo_v3.launch
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

<!-- Use YOLOv3 -->
<arg name="network_param_file" default="$(find darknet_ros)/config/yolov3.yaml"/>
<arg name="image" default="camera/rgb/image_raw" />


<!-- Include main launch file -->
<include file="$(find darknet_ros)/launch/darknet_ros.launch">
<arg name="network_param_file" value="$(arg network_param_file)"/>
<arg name="image" value="$(arg image)" />
</include>

</launch>
1 change: 1 addition & 0 deletions darknet_ros/src/YoloObjectDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ void *YoloObjectDetector::publishInThread()
int ymax = (rosBoxes_[i][j].y + rosBoxes_[i][j].h / 2) * frameHeight_;

boundingBox.Class = classLabels_[i];
boundingBox.id = i;
boundingBox.probability = rosBoxes_[i][j].prob;
boundingBox.xmin = xmin;
boundingBox.ymin = ymin;
Expand Down
4 changes: 2 additions & 2 deletions darknet_ros_msgs/msg/BoundingBox.msg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
string Class
float64 probability
int64 xmin
int64 ymin
int64 xmax
int64 ymax

int16 id
string Class

0 comments on commit b6432e7

Please sign in to comment.