Skip to content
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

Create README.md from Wiki content #342

Open
wants to merge 2 commits into
base: rolling
Choose a base branch
from
Open

Create README.md from Wiki content #342

wants to merge 2 commits into from

Conversation

tfoote
Copy link
Contributor

@tfoote tfoote commented Feb 4, 2025


`polled_camera` defines the ROS interface that client nodes use to request images from a polling camera driver node (e.g. [prosilica_camera](https://index.ros.org/p/prosilica_camera/)). The protocol is:

* The camera driver advertises a service call `<camera>/request_image` of type [polled_camera/GetPolledImage](http://www.ros.org/doc/api/polled_camera/html/srv/GetPolledImage.html).
Copy link
Collaborator

Choose a reason for hiding this comment

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

* The camera driver advertises a service call `<camera>/request_image` of type [polled_camera/GetPolledImage](http://www.ros.org/doc/api/polled_camera/html/srv/GetPolledImage.html).
* The client calls the service, specifying an output namespace.
* On receiving a request, the driver captures an image and returns its time stamp in the service response.
* The driver publishes (latching) the [sensor_msgs/Image](http://www.ros.org/doc/api/sensor_msgs/html/msg/Image.html) and [sensor_msgs/CameraInfo](http://www.ros.org/doc/api/sensor_msgs/html/msg/CameraInfo.html) to `<response_namespace>/image_raw` and `<response_namespace>/camera_info`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

There are several reasons for publishing images to topics instead of returning them from the service call:

* **Consistency:** Client-side processing is always performed in an image callback, regardless of what type of camera is used.
* **Visibility:** Topics can be monitored in [image_view](https://index.ros.org/p/image_view/) or [rviz](https://index.ros.org/p/rviz/).
Copy link
Collaborator

Choose a reason for hiding this comment

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


* **Consistency:** Client-side processing is always performed in an image callback, regardless of what type of camera is used.
* **Visibility:** Topics can be monitored in [image_view](https://index.ros.org/p/image_view/) or [rviz](https://index.ros.org/p/rviz/).
* **Reproducibility:** Topics can be [bagged](https://index.ros.org/p/rosbag/) and played back later.
Copy link
Collaborator

Choose a reason for hiding this comment

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

* **Consistency:** Client-side processing is always performed in an image callback, regardless of what type of camera is used.
* **Visibility:** Topics can be monitored in [image_view](https://index.ros.org/p/image_view/) or [rviz](https://index.ros.org/p/rviz/).
* **Reproducibility:** Topics can be [bagged](https://index.ros.org/p/rosbag/) and played back later.
* **Compression:** Can take advantage of [image_transport](https://index.ros.org/p/image_transport/) to compress images, if desired.
Copy link
Collaborator

Choose a reason for hiding this comment

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


```bash
# Poll "my_camera" at 5 Hz, publishing in namespace my_polled_output/.
$ poller 5 camera:=my_camera output:=my_polled_output
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this correct ?

ros2 run polled_camera poller 5 camera:=my_camera output:=my_polled_output

Comment on lines +34 to +41
Published Topics
* <output>/image_raw (sensor_msgs/Image)
Image topic, actually published by the camera driver. output should be remapped by the user.
* <output>/camera_info (sensor_msgs/CameraInfo)
Info topic, actually published by the camera driver. output should be remapped by the user.
Services Called
* <camera>/request_image (polled_camera/GetPolledImage)
The camera driver's polled image service. camera should be remapped by the user to the camera namespace.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Published Topics
* <output>/image_raw (sensor_msgs/Image)
Image topic, actually published by the camera driver. output should be remapped by the user.
* <output>/camera_info (sensor_msgs/CameraInfo)
Info topic, actually published by the camera driver. output should be remapped by the user.
Services Called
* <camera>/request_image (polled_camera/GetPolledImage)
The camera driver's polled image service. camera should be remapped by the user to the camera namespace.
Published Topics
* `<output>/image_raw` ([sensor_msgs/Image](https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/msg/Image.msg))
Image topic, actually published by the camera driver. output should be remapped by the user.
* `<output>/camera_info` ([sensor_msgs/CameraInfo](https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/msg/CameraInfo.msg))
Info topic, actually published by the camera driver. output should be remapped by the user.
Services Called
* `<camera>/request_image` ([polled_camera/GetPolledImage](https://github.com/ros-perception/image_common/blob/rolling/polled_camera/srv/GetPolledImage.srv))
The camera driver's polled image service. camera should be remapped by the user to the camera namespace.

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.

2 participants