From 81d2332eecf0d87d9c9c8edcc402f6c0bc4d1bf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Fri, 19 Jan 2024 15:19:51 +0100 Subject: [PATCH] Add support for floating point fps (#866) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Related with this PR https://github.com/ros-perception/image_pipeline/pull/723 --------- Signed-off-by: Alejandro Hernández Cordero --- image_view/include/image_view/video_recorder_node.hpp | 2 +- image_view/src/video_recorder_node.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/image_view/include/image_view/video_recorder_node.hpp b/image_view/include/image_view/video_recorder_node.hpp index cf6ca784a..52d6b5bd7 100644 --- a/image_view/include/image_view/video_recorder_node.hpp +++ b/image_view/include/image_view/video_recorder_node.hpp @@ -43,7 +43,7 @@ class VideoRecorderNode rclcpp::Time g_last_wrote_time; std::string encoding; std::string codec; - int fps; + double fps; double min_depth_range; double max_depth_range; bool use_dynamic_range; diff --git a/image_view/src/video_recorder_node.cpp b/image_view/src/video_recorder_node.cpp index bed3ced59..0ea1d465c 100644 --- a/image_view/src/video_recorder_node.cpp +++ b/image_view/src/video_recorder_node.cpp @@ -42,7 +42,7 @@ VideoRecorderNode::VideoRecorderNode(const rclcpp::NodeOptions & options) filename = this->declare_parameter("filename", std::string("output.avi")); stamped_filename = this->declare_parameter("stamped_filename", false); - fps = this->declare_parameter("fps", 15); + fps = this->declare_parameter("fps", 15.0); codec = this->declare_parameter("codec", std::string("MJPG")); encoding = this->declare_parameter("encoding", std::string("bgr8")); // cv_bridge::CvtColorForDisplayOptions @@ -108,7 +108,7 @@ void VideoRecorderNode::callback(const sensor_msgs::msg::Image::ConstSharedPtr & RCLCPP_INFO( this->get_logger(), - "Starting to record %s video at %ix%i@%i fps. Press Ctrl+C to stop recording.", + "Starting to record %s video at %ix%i@%.2f fps. Press Ctrl+C to stop recording.", codec.c_str(), size.height, size.width, fps); }