Skip to content

Commit

Permalink
use camera_ros for full libcamera support
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrauch committed Mar 4, 2025
1 parent aba76f5 commit 4fec9d2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ apriltag_ros
AprilTagNode
```

This `AprilTagNode` component can be loaded with other nodes into a "container node" process where they used shared-memory communication to prevent unnecessary data copies. The example launch file [v4l2_36h11.launch.yml](launch/v4l2_36h11.launch.yml) loads the `AprilTagNode` component together with the `v4l2_camera::V4L2Camera` component from the [`v4l2_camera` package](https://gitlab.com/boldhearts/ros2_v4l2_camera) (`sudo apt install ros-$ROS_DISTRO-v4l2-camera`) into one container and enables `use_intra_process_comms` for both:
This `AprilTagNode` component can be loaded with other nodes into a "container node" process where they used shared-memory communication to prevent unnecessary data copies. The example launch file [camera_36h11.launch.yml](launch/camera_36h11.launch.yml) loads the `AprilTagNode` component together with the `camera::CameraNode` component from the [`camera_ros` package](https://index.ros.org/p/camera_ros/) (`sudo apt install ros-$ROS_DISTRO-camera-ros`) into one container and enables `use_intra_process_comms` for both:
```sh
ros2 launch apriltag_ros v4l2_36h11.launch.yml
ros2 launch apriltag_ros camera_36h11.launch.yml
```
22 changes: 12 additions & 10 deletions launch/v4l2_36h11.launch.yml → launch/camera_36h11.launch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,26 @@ launch:
name: apriltag_container
namespace: ""
composable_node:
- pkg: v4l2_camera
plugin: v4l2_camera::V4L2Camera
- pkg: camera_ros
plugin: camera::CameraNode
name: camera
namespace: v4l2
namespace: camera
param:
- name: video_device
value: /dev/video$(var device)
- name: camera
value: $(var device)
extra_arg:
- name: use_intra_process_comms
value: "True"

- pkg: image_proc
plugin: image_proc::RectifyNode
name: rectify
namespace: v4l2
namespace: camera
remap:
- from: image
to: image_raw
to: /camera/camera/image_raw
- from: camera_info
to: /camera/camera/camera_info
extra_arg:
- name: use_intra_process_comms
value: "True"
Expand All @@ -37,9 +39,9 @@ launch:
namespace: apriltag
remap:
- from: /apriltag/image_rect
to: /v4l2/image_rect
- from: /apriltag/camera_info
to: /v4l2/camera_info
to: /camera/image_rect
- from: /camera/camera_info
to: /camera/camera/camera_info
param:
- from: $(find-pkg-share apriltag_ros)/cfg/tags_36h11.yaml
extra_arg:
Expand Down
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<depend>image_transport</depend>
<depend>cv_bridge</depend>

<exec_depend>camera_ros</exec_depend>
<exec_depend>image_proc</exec_depend>

<test_depend>ament_lint_auto</test_depend>
Expand Down

0 comments on commit 4fec9d2

Please sign in to comment.