Skip to content

add rmf_human_detector#1

Closed
PranayShirodkar wants to merge 27 commits intoopen-rmf:mainfrom
PranayShirodkar:feature/rmf_human_detector
Closed

add rmf_human_detector#1
PranayShirodkar wants to merge 27 commits intoopen-rmf:mainfrom
PranayShirodkar:feature/rmf_human_detector

Conversation

@PranayShirodkar
Copy link
Copy Markdown
Contributor

@PranayShirodkar PranayShirodkar commented Aug 22, 2022

rmf_human_detector

ROS 2 node that subscribes to sensor_msgs::Image messages published by a monocular camera and publishes the detections over /rmf_obstacles as rmf_obstacle_msgs::Obstacles message. The node runs YOLOv5 to detect the presence of humans as obstacles.

Launch human detector

First launch rmf demos hotel world with a camera in it from this PR. Then:

ros2 launch rmf_human_detector human_detector_launch.py

Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
YoloDetector::YoloDetector(std::shared_ptr<Config> config) : _config(config)
{
calibrate();
if (_config->visualize)
Copy link
Copy Markdown
Contributor Author

@PranayShirodkar PranayShirodkar Aug 22, 2022

Choose a reason for hiding this comment

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

This _config->visualize variable is used to control if the user wants to see the final image with bounding boxes in a seperate OpenCV window. Either way, the final image is being published as a ros topic. The OpenCV window was useful during debugging to see what was going on.

Do we want to just do away with this option and not create the OpenCV window at all since it can be seen from the ros topic?

Copy link
Copy Markdown
Member

@Yadunund Yadunund left a comment

Choose a reason for hiding this comment

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

High level comments

  • Let's not commit the onnx model here. It will inflate the size of the repo and more importantly we shouldn't commit binaries as they dont diff. Best option would be to provide instructions on how to download the model (could be a script) and then have the path to the model be a ROS 2 param.
  • The camera mesh should also be removed from here. Either it should go on fuel or rmf_demos_assets. The latter would be easier.
  • Remove the worlds. Update one of the rmf_demos_worlds to include the camera model
  • Use ROS 2 params for other configurable parameters (topic names, strings, etc)
  • Uncrustify
  • Update README

Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
Signed-off-by: Pranay Shirodkar <39498451+PranayShirodkar@users.noreply.github.com>
std::vector<std::string> _class_list;
cv::dnn::Net _net;
std::shared_ptr<Config> _config;
geometry_msgs::msg::Transform _camera_pose;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need this camera pose? I don't understand the logic

If your code is waiting for this value to be received, it should be an std::optional<Transform>. Then if nullopt don't process.

@ahcorde
Copy link
Copy Markdown
Collaborator

ahcorde commented Nov 11, 2022

Closing this PR in favour of this other one #3

@ahcorde ahcorde closed this Nov 11, 2022
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.

3 participants