Lyrical support.
This commit is contained in:
parent
2ba0f2e9f6
commit
7eda1b11f7
|
|
@ -1,4 +1,4 @@
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
project(image2rtsp)
|
project(image2rtsp)
|
||||||
|
|
||||||
# Default to C99
|
# Default to C99
|
||||||
|
|
@ -34,7 +34,10 @@ include_directories(${OpenCV_INCLUDE_DIRS})
|
||||||
file(GLOB SOURCES src/video.cpp)
|
file(GLOB SOURCES src/video.cpp)
|
||||||
|
|
||||||
add_executable(image2rtsp src/image2rtsp.cpp ${SOURCES})
|
add_executable(image2rtsp src/image2rtsp.cpp ${SOURCES})
|
||||||
ament_target_dependencies(image2rtsp rclcpp sensor_msgs)
|
target_link_libraries(image2rtsp
|
||||||
|
rclcpp::rclcpp
|
||||||
|
${sensor_msgs_TARGETS}
|
||||||
|
)
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${GST_INCLUDE_DIRS}
|
${GST_INCLUDE_DIRS}
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@ void Image2rtsp::topic_callback(const sensor_msgs::msg::Image::SharedPtr msg){
|
||||||
void Image2rtsp::compressed_topic_callback(const sensor_msgs::msg::CompressedImage::SharedPtr msg){
|
void Image2rtsp::compressed_topic_callback(const sensor_msgs::msg::CompressedImage::SharedPtr msg){
|
||||||
if (appsrc == NULL) return;
|
if (appsrc == NULL) return;
|
||||||
// Decompress the image
|
// Decompress the image
|
||||||
cv::Mat img = cv::imdecode(cv::Mat(msg->data), cv::IMREAD_UNCHANGED);
|
cv::Mat img = cv::imdecode(cv::Mat(msg->data.to_vector()), cv::IMREAD_UNCHANGED);
|
||||||
if (img.empty()) {
|
if (img.empty()) {
|
||||||
RCLCPP_ERROR(this->get_logger(), "Failed to decompress image");
|
RCLCPP_ERROR(this->get_logger(), "Failed to decompress image");
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue