Skip to content

Commit 8841d53

Browse files
committed
Fixed tests.
1 parent 3365d52 commit 8841d53

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

test/test_robot_model_renderer.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <cras_cpp_common/log_utils/memory.h>
2121
#include <cras_cpp_common/log_utils/node.h>
2222
#include <geometry_msgs/TransformStamped.h>
23+
#include <opencv2/imgcodecs.hpp>
2324
#include <robot_model_renderer/RobotModelRenderer.hpp>
2425
#include <robot_model_renderer/robot/tf_link_updater.hpp>
2526
#include <sensor_msgs/CameraInfo.h>
@@ -517,7 +518,7 @@ TEST(RobotModelRenderer, MaskBackground) // NOLINT
517518

518519
robot_model_renderer::RobotModelRendererConfig config;
519520
config.pixelFormat = Ogre::PF_BYTE_RGBA;
520-
config.staticMaskImage = cv::Mat(1616, 1212, CV_8UC4);
521+
config.staticMaskImage = cv::Mat::zeros(1616, 1212, CV_8UC4);
521522
config.staticMaskImage.at<cv::Vec4b>(0, 0) = cv::Vec4b(255, 128, 0, 255);
522523
config.staticMaskImage.at<cv::Vec4b>(1616 / 2, 1212 / 2) = cv::Vec4b(0, 128, 0, 255);
523524
config.staticMaskIsBackground = true;
@@ -586,7 +587,7 @@ TEST(RobotModelRenderer, MaskForeground) // NOLINT
586587

587588
robot_model_renderer::RobotModelRendererConfig config;
588589
config.pixelFormat = Ogre::PF_BYTE_RGBA;
589-
config.staticMaskImage = cv::Mat(1616, 1212, CV_8UC4);
590+
config.staticMaskImage = cv::Mat::zeros(1616, 1212, CV_8UC4);
590591
config.staticMaskImage.at<cv::Vec4b>(0, 0) = cv::Vec4b(255, 128, 0, 255);
591592
config.staticMaskImage.at<cv::Vec4b>(1616 / 2, 1212 / 2) = cv::Vec4b(0, 128, 0, 255);
592593
config.staticMaskIsBackground = false;
@@ -655,7 +656,7 @@ TEST(RobotModelRenderer, MaskForegroundColorMode) // NOLINT
655656

656657
robot_model_renderer::RobotModelRendererConfig config;
657658
config.pixelFormat = Ogre::PF_BYTE_RGBA;
658-
config.staticMaskImage = cv::Mat(1616, 1212, CV_8UC4);
659+
config.staticMaskImage = cv::Mat::zeros(1616, 1212, CV_8UC4);
659660
config.staticMaskImage.at<cv::Vec4b>(0, 0) = cv::Vec4b(255, 128, 0, 255);
660661
config.staticMaskImage.at<cv::Vec4b>(1616 / 2, 1212 / 2) = cv::Vec4b(0, 128, 0, 255);
661662
config.staticMaskIsBackground = false;
@@ -725,7 +726,7 @@ TEST(RobotModelRenderer, MaskForegroundMaskMode) // NOLINT
725726

726727
robot_model_renderer::RobotModelRendererConfig config;
727728
config.pixelFormat = Ogre::PF_BYTE_RGBA;
728-
config.staticMaskImage = cv::Mat(1616, 1212, CV_8UC4);
729+
config.staticMaskImage = cv::Mat::zeros(1616, 1212, CV_8UC4);
729730
config.staticMaskImage.at<cv::Vec4b>(0, 0) = cv::Vec4b(255, 128, 0, 255);
730731
config.staticMaskImage.at<cv::Vec4b>(1616 / 2, 1212 / 2) = cv::Vec4b(0, 128, 0, 255);
731732
config.staticMaskIsBackground = false;

test/test_robot_model_renderer_nodelet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ std::unique_ptr<NodeletType> createNodelet(const cras::LogHelperPtr& log,
6060
{
6161
// Declaration order of these variables is important to make sure they can be properly stopped and destroyed.
6262
auto nodelet = class_loader::impl::createInstance<nodelet::Nodelet>(
63-
"robot_model_renderer::RobotModelRenderer", nullptr);
63+
"robot_model_renderer::RobotModelRendererNodelet", nullptr);
6464
if (nodelet == nullptr)
6565
return nullptr;
6666

0 commit comments

Comments
 (0)