Skip to content

Commit

Permalink
Added image_pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-palmer committed Oct 15, 2024
1 parent c6d87ac commit cc81b83
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
6 changes: 3 additions & 3 deletions barlus_gstreamer_proxy/config/camera_info.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
image_width: 640
image_height: 480
camera_name: test_camera
image_width: 3072
image_height: 2048
camera_name: barlus
camera_matrix:
rows: 3
cols: 3
Expand Down
18 changes: 17 additions & 1 deletion barlus_gstreamer_proxy/launch/gstreamer_proxy.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,28 @@ def generate_launch_description():
extra_arguments=[{"use_intra_process_comms": True}],
)

rectify_node = ComposableNode(
package="image_proc",
plugin="image_proc::RectifyNode",
name="rectify_node",
namespace=LaunchConfiguration("ns"),
remappings=[("image", "image_raw")],
)

debayer_node = ComposableNode(
package="image_proc",
plugin="image_proc::DebayerNode",
namespace=LaunchConfiguration("ns"),
name="debayer_node",
remappings=[("image_raw", "image_raw")],
)

container = ComposableNodeContainer(
name="barlus_container",
namespace="",
package="rclcpp_components",
executable="component_container",
composable_node_descriptions=[gstreamer_proxy_node],
composable_node_descriptions=[gstreamer_proxy_node, rectify_node, debayer_node],
)

return LaunchDescription([declare_parameters_file, declare_ns, container])
1 change: 1 addition & 0 deletions barlus_gstreamer_proxy/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<depend>cv_bridge</depend>
<depend>camera_info_manager</depend>
<depend>image_transport</depend>
<depend>image_proc</depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
6 changes: 5 additions & 1 deletion barlus_gstreamer_proxy/src/gstreamer_proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ auto GStreamerProxy::configure_stream() -> bool

*self->camera_info_ = self->camera_info_manager_->getCameraInfo();
self->camera_info_->header.stamp = self->now();
self->camera_pub_->publish(cv_mat_to_ros_image(image), *self->camera_info_);

sensor_msgs::msg::Image image_msg = cv_mat_to_ros_image(image);
image_msg.header = self->camera_info_->header;

self->camera_pub_->publish(image_msg, *self->camera_info_);

gst_sample_unref(sample);

Expand Down

0 comments on commit cc81b83

Please sign in to comment.