Skip to content

Commit

Permalink
added object location in image to msg
Browse files Browse the repository at this point in the history
  • Loading branch information
fagnerpimentel committed Oct 24, 2018
1 parent 42ca4b6 commit 145768b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 5 additions & 1 deletion msg/DetectedObject.msg
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
std_msgs/String type
std_msgs/String tf_id
std_msgs/String tf_id
std_msgs/Int32 image_x
std_msgs/Int32 image_y
std_msgs/Int32 image_height
std_msgs/Int32 image_width
6 changes: 3 additions & 3 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package>
<name>dodo_detector_ros</name>
<version>0.1.1</version>
<version>0.2.0</version>
<description>A package for object detection and localization using computer vision and IR sensors.</description>

<!-- One maintainer tag required, multiple allowed, one person per tag -->
Expand Down Expand Up @@ -54,9 +54,9 @@
<build_depend>rospy</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>std_msgs</build_depend>

<buildtool_depend>catkin</buildtool_depend>

<run_depend>cv_bridge</run_depend>
<run_depend>geometry_msgs</run_depend>
<run_depend>libfreenect</run_depend>
Expand Down
8 changes: 6 additions & 2 deletions src/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,16 @@ def run(self):

detected_object = DetectedObject()
detected_object.type.data = obj_class

detected_object.image_x.data = xmin
detected_object.image_y.data = ymin
detected_object.image_width.data = xmax - xmin
detected_object.image_height.data = ymax - ymin
# TODO the timestamp of image, depth and point cloud should be checked
# to make sure we are using synchronized data...

publish_tf = False
if self._current_pc is None:
rospy.logwarn('No point cloud information available to track object in scene')
rospy.loginfo('No point cloud information available to track current object in scene')

# if there is point cloud data, we'll try to place a tf
# in the object's location
Expand Down

0 comments on commit 145768b

Please sign in to comment.