-
Notifications
You must be signed in to change notification settings - Fork 0
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
ported over cv model #37
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the detection node should not simply output to video. it should take input from image_raw (which is already done) and output detections to a different topic (i.e. /detections).
src/cvmodel_package/CMakeLists.txt
Outdated
@@ -0,0 +1,43 @@ | |||
cmake_minimum_required(VERSION 3.8) | |||
project(cvmodel_package) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we rename the package to detection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
including changing folder name, etc
src/cvmodel_package/CMakeLists.txt
Outdated
target_compile_features(video_publisher PUBLIC c_std_99 cxx_std_17) | ||
|
||
# Add cvmodel_node executable | ||
add_executable(cvmodel_node src/cvmodel_node.cpp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to detection_node as well
|
||
Mat edges = applyCanny(frame); | ||
|
||
frame = drawCenters(frame, "blue"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than just draw the centers, we should also publish the results to a different topic. implement this using detections2darray http://docs.ros.org/en/noetic/api/vision_msgs/html/msg/Detection2DArray.html, you only need to populate the position of the pose
last_frame_time = this->now(); | ||
|
||
} catch (cv_bridge::Exception &e) { | ||
RCLCPP_ERROR(this->get_logger(), "cv_bridge exception: %s", e.what()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this supposed to catch for exactly?
int frame_height = frame.rows; | ||
double fps = 120.0; | ||
|
||
writer.open(output_video, VideoWriter::fourcc('X', 'V', 'I', 'D'), fps, Size(frame_width, frame_height)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add in a parameter for video writer. in the standard use case, we don't want to output to video
} | ||
} | ||
|
||
void check_for_inactivity() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally this won't be needed in the future and doesn't fit with ROS but I think it's fine for now
Package Name: cvmodel_package
Ported over python cv_model code to detect lighted up sections. We require a input.mp4, the path/name must be specified in video_publisher.cpp. An output.mp4 is generated, an example of which is below.
output.mp4