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

72 Add YOLO object detection #167

Closed
wants to merge 10 commits into from
Closed

72 Add YOLO object detection #167

wants to merge 10 commits into from

Conversation

jackguo380
Copy link
Collaborator

Adds YOLO object detection into simulation.

The integration of YOLO into ROS is done by darknet_ros. Unfortunately I had to fix a bunch of bugs with OpenCV in my own fork of it as well as fork darknet to fix some stuff as well.

@jackguo380
Copy link
Collaborator Author

Still WIP, not fully done yet. Still TODO:

  • Write a simple node to convert from bounding boxes (In the image frame) to people (in the map frame).

#include <functional>
#include <deque>

class BoundingBoxTransformer
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs

, tf_timeout_(tf_timeout)
{}

void handleCameraImage(const sensor_msgs::ImageConstPtr& image_msg,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use capital letters for all words in the function names for the rest of the codebase (except for mapviz plugins)

tfScalar radius;
tfScalar height;

BoundingCylinder(std::string objectClass, int id, ros::Time creationTime,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you ever use the default constructor? If not can you delete it?

@@ -0,0 +1,46 @@
cmake_minimum_required(VERSION 2.8.3)
project(propbot_object_detection)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to propbot_perception, or put this in a propbot_perception directory and name it propbot_object_detection

@@ -0,0 +1,128 @@
# Propbot Object Detection
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great README! I won't comment on this for now, once you put it into the design doc, we can fix things up and open another pr to change the readme if necessary

//ROS_INFO_STREAM("Find Angles: " << angle_left << ", " << angle_right <<
// " from " << laser->angle_min << ", " << laser->angle_max);

float left_from_min = angle_left - laser->angle_min;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be also helpful to provide a brief description above each function

}

if (groups.size() >= 2) {
//if (groups.size() >= 3) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

last_image_time_ = image_msg->header.stamp;

// Update our camera model from this image
pinhole_camera_.fromCameraInfo(cam_info_msg);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the CameraInfo message shouldn't change during operation. It would be sufficient for you to just load it in once. The CameraInfo message depends on some calibrations that are done before operation.

const darknet_ros_msgs::BoundingBoxesConstPtr& bb_msg)
{
if (!pinhole_camera_.initialized()) {
ROS_WARN_STREAM_THROTTLE(1, "Waiting for Camera Initialization");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ROS_WARN instead to keep things consistent with the rest of our code


// Find a 3D point (in the laser frame) corresponding to the pixel
// this is done by extending the ray from camera to pixel out to ray length
auto projectPt = [&](int x, int y) -> tf::Point {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, why a lambda instead of a private function tho? bc nothing else uses it?


<!--- Launch Object Detection -->
<include file="$(find propbot_object_detection)/launch/detect_objects.launch" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a setting "track_dynamic_objects"?

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

Successfully merging this pull request may close these issues.

Detect and predict human position and velocity Run YOLO on TX1 alongside SLAM
4 participants