Skip to content

Commit

Permalink
Use image_raw instead of image_color (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kotochleb authored Oct 11, 2024
1 parent b34b56c commit cdfd216
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 51 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ The node provides the following ROS topics:

### Subscribers

- **\<camera name\>/image_color** [sensor_msgs/msg/Image]
- **\<camera name\>/image_raw** [sensor_msgs/msg/Image]

Video stream from a given camera. This is a default topic subscribed by a given camera. Can be changed to compressed image via parameters.

Disabled by the parameter **cameras.\<camera name\>.compressed**.

- **\<camera name\>/image_color/compressed** [sensor_msgs/msg/CompressedImage]
- **\<camera name\>/image_raw/compressed** [sensor_msgs/msg/CompressedImage]

Compressed video stream from a given camera.

Expand Down
5 changes: 0 additions & 5 deletions happypose_examples/launch/multi_view_demo.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ def launch_setup(
"camera_info_url": camera_info_url,
}
],
remappings=[
# Remapped topics are created to match camera names in
# happypose_examples/config/cosypose_params_multiview.yaml
("image_raw", "image_color"),
],
)
)

Expand Down
5 changes: 0 additions & 5 deletions happypose_examples/launch/single_view_demo.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ def launch_setup(
"camera_info_url": camera_info_url,
}
],
remappings=[
# Remapped topics have to match the names from
# happypose_examples/config/cosypose_params.yaml
("image_raw", "image_color"),
],
)

# Include common part of the demo launch files
Expand Down
2 changes: 1 addition & 1 deletion happypose_examples/rviz/happypose_example.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Visualization Manager:
Durability Policy: Volatile
History Policy: Keep Last
Reliability Policy: Reliable
Value: /cam_1/image_color
Value: /cam_1/image_raw
Value: true
Visibility:
Grid: false
Expand Down
6 changes: 3 additions & 3 deletions happypose_examples/rviz/happypose_multiview_example.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Visualization Manager:
Durability Policy: Volatile
History Policy: Keep Last
Reliability Policy: Reliable
Value: /cam_1/image_color
Value: /cam_1/image_raw
Value: true
- Class: rviz_default_plugins/Image
Enabled: true
Expand All @@ -110,7 +110,7 @@ Visualization Manager:
Durability Policy: Volatile
History Policy: Keep Last
Reliability Policy: Reliable
Value: /cam_2/image_color
Value: /cam_2/image_raw
Value: true
- Class: rviz_default_plugins/Image
Enabled: true
Expand All @@ -124,7 +124,7 @@ Visualization Manager:
Durability Policy: Volatile
History Policy: Keep Last
Reliability Policy: Reliable
Value: /cam_3/image_color
Value: /cam_3/image_raw
Value: true
Enabled: true
Global Options:
Expand Down
4 changes: 2 additions & 2 deletions happypose_ros/happypose_ros/camera_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ def __init__(

if params.get_entry(self._camera_name).compressed:
img_msg_type = CompressedImage
topic_postfix = "/image_color/compressed"
topic_postfix = "/image_raw/compressed"
else:
img_msg_type = Image
topic_postfix = "/image_color"
topic_postfix = "/image_raw"

self._image = None
self._cvb = CvBridge()
Expand Down
4 changes: 2 additions & 2 deletions happypose_ros/test/happypose_testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ def __init__(
cam[1],
# Choose topic name based on the type
(
f"{cam[0]}/image_color"
f"{cam[0]}/image_raw"
if isinstance(cam[1], Metaclass_Image)
else f"{cam[0]}/image_color/compressed"
else f"{cam[0]}/image_raw/compressed"
),
10,
),
Expand Down
4 changes: 2 additions & 2 deletions happypose_ros/test/single_view_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ def test_02_check_topics(self) -> None:
# Check if node subscribes to correct topics
if self.compressed:
self.node.assert_node_is_subscriber(
"cam_1/image_color/compressed",
"cam_1/image_raw/compressed",
timeout=3.0,
)
else:
self.node.assert_node_is_subscriber(
"cam_1/image_color",
"cam_1/image_raw",
timeout=3.0,
)
self.node.assert_node_is_subscriber("cam_1/camera_info", timeout=3.0)
Expand Down
6 changes: 3 additions & 3 deletions happypose_ros/test/test_multi_view_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ def test_01_node_startup(self, proc_output: ActiveIoHandler) -> None:

def test_02_check_topics(self) -> None:
# Check if node subscribes to correct topics
self.node.assert_node_is_subscriber("cam_1/image_color", timeout=3.0)
self.node.assert_node_is_subscriber("cam_1/image_raw", timeout=3.0)
self.node.assert_node_is_subscriber("cam_1/camera_info", timeout=3.0)
self.node.assert_node_is_subscriber("cam_2/image_color/compressed", timeout=3.0)
self.node.assert_node_is_subscriber("cam_2/image_raw/compressed", timeout=3.0)
self.node.assert_node_is_subscriber("cam_2/camera_info", timeout=3.0)
self.node.assert_node_is_subscriber("cam_3/image_color", timeout=3.0)
self.node.assert_node_is_subscriber("cam_3/image_raw", timeout=3.0)
self.node.assert_node_is_subscriber("cam_3/camera_info", timeout=3.0)
self.node.assert_node_is_publisher("happypose/detections", timeout=3.0)
self.node.assert_node_is_publisher("happypose/vision_info", timeout=3.0)
Expand Down
Loading

0 comments on commit cdfd216

Please sign in to comment.