|
FP Perception 0.1.2
|
OpenCVDriver class for handling video input from a camera using OpenCV. More...
#include <opencv_vision_driver.hpp>


Public Member Functions | |
| OpenCVDriver () | |
| ~OpenCVDriver () override | |
| void | initialize (const rclcpp::Node::SharedPtr &node) override |
| Initialize the driver. | |
| void | deinitialize () override |
| Stop driver streaming. | |
| vision_frame | captureFrame () override |
| Get the latest image data from the driver. | |
| void | test () override |
| Test function to check the driver functionality by writing the image to a file This function creates a "test" directory if it doesn't exist and saves the captured image. | |
Public Member Functions inherited from fp_perception::DriverBase | |
| virtual | ~DriverBase ()=default |
| virtual std::string | getName () const |
| Get the name of the driver. | |
| void | check_directory (std::string folder_name) |
| Check if the test directory exists, create it if not. | |
| const std::filesystem::path | check_file (const std::string &file_name) |
Protected Member Functions | |
| void | produce_diagnostics (diagnostic_updater::DiagnosticStatusWrapper &status) |
Protected Member Functions inherited from fp_perception::DriverBase | |
| void | initialize_base (const rclcpp::Node::SharedPtr &node) |
| Initializer base driver in place of constructor due to plugin semantics. | |
| bool | diagnostics_enabled () const |
| void | enable_diagnostics (const std::string &hardware_id, const std::string &task_name, std::function< void(diagnostic_updater::DiagnosticStatusWrapper &)> task, std::chrono::milliseconds period=std::chrono::seconds(1)) |
| void | disable_diagnostics () |
Protected Attributes | |
| int | device_id |
| cv::VideoCapture | capture_device |
| std::atomic< uint64_t > | successful_capture_count_ { 0 } |
| std::atomic< uint64_t > | capture_failure_count_ { 0 } |
Protected Attributes inherited from fp_perception::DriverBase | |
| rclcpp::Node::SharedPtr | node_ |
| ROS node for the driver. | |
| std::string | name_ |
| Name of the driver. | |
| std::mutex | buffer_mutex_ |
| Mutex to protect access to the driver data. | |
| std::condition_variable | buffer_cv_ |
| Condition variable to notify when new data is available. | |
| std::atomic< bool > | is_running_ { false } |
| Flag to indicate if the driver thread is running. | |
| bool | diagnostics_enabled_ { false } |
| Flag to enable standard ROS diagnostics publishing. | |
| std::unique_ptr< diagnostic_updater::Updater > | diagnostics_updater_ |
| rclcpp::TimerBase::SharedPtr | diagnostics_timer_ |
OpenCVDriver class for handling video input from a camera using OpenCV.
This class is responsible for managing the video input from a camera using OpenCV. It provides methods to start and stop the video stream, as well as retrieve image data.
|
inline |
|
inlineoverride |
|
inlineoverridevirtual |
Get the latest image data from the driver.
| fp_perception_exception | if not implemented in derived classes |
Implements fp_perception::VisionSourceDriver.
|
inlineoverridevirtual |
Stop driver streaming.
Implements fp_perception::DriverBase.
|
inlineoverridevirtual |
Initialize the driver.
This function should be overridden in derived classes to provide specific initialization.
| node | Shared pointer to the ROS node |
Reimplemented from fp_perception::DriverBase.
|
inlineprotected |
|
inlineoverridevirtual |
Test function to check the driver functionality by writing the image to a file This function creates a "test" directory if it doesn't exist and saves the captured image.
Reimplemented from fp_perception::DriverBase.
|
protected |
|
protected |
|
protected |
|
protected |