diff --git a/include/ignition/sensors/SegmentationCameraSensor.hh b/include/ignition/sensors/SegmentationCameraSensor.hh index a294b150..de3eb83b 100644 --- a/include/ignition/sensors/SegmentationCameraSensor.hh +++ b/include/ignition/sensors/SegmentationCameraSensor.hh @@ -18,8 +18,8 @@ #ifndef IGNITION_SENSORS_SEGMENTATIONCAMERASENSOR_HH_ #define IGNITION_SENSORS_SEGMENTATIONCAMERASENSOR_HH_ -#include #include +#include #include #include @@ -83,7 +83,7 @@ namespace ignition /// \brief Get the rendering segmentation camera /// \return Segmentation camera pointer - public: virtual rendering::SegmentationCameraPtr SegmentationCamera(); + public: virtual rendering::SegmentationCameraPtr SegmentationCamera() const; /// \brief Segmentation data callback used to get the data from the sensor /// \param[in] _data pointer to the data from the sensor diff --git a/src/SegmentationCameraSensor.cc b/src/SegmentationCameraSensor.cc index 167deb68..99b89799 100644 --- a/src/SegmentationCameraSensor.cc +++ b/src/SegmentationCameraSensor.cc @@ -15,8 +15,8 @@ * */ -#include #include +#include #include #include @@ -41,9 +41,8 @@ class ignition::sensors::SegmentationCameraSensorPrivate /// \param[in] _width width of image in pixels /// \param[in] _height height of image in pixels /// \return True if the image was saved successfully. False can mean - /// that the path provided to the constructor does exist and creation + /// that the image save path does not exist and creation /// of the path was not possible. - /// \sa ImageSaver public: bool SaveImage(const uint8_t *_coloredBuffer, const uint8_t *_labelsBuffer, unsigned int _width, unsigned int _height); @@ -188,8 +187,8 @@ bool SegmentationCameraSensor::Load(const sdf::Sensor &_sdf) this->dataPtr->type = rendering::SegmentationType::PANOPTIC; else { - igndbg << "Wrong type {" << type << - "}, type should be semantic or instance or panoptic" << std::endl; + igndbg << "Wrong type [" << type << + "], type should be semantic or instance or panoptic" << std::endl; return false; } } @@ -327,6 +326,7 @@ bool SegmentationCameraSensor::CreateCamera() ///////////////////////////////////////////////// rendering::SegmentationCameraPtr SegmentationCameraSensor::SegmentationCamera() + const { return this->dataPtr->camera; } diff --git a/test/integration/segmentation_camera_plugin.cc b/test/integration/segmentation_camera_plugin.cc index 97b3a080..582feee2 100644 --- a/test/integration/segmentation_camera_plugin.cc +++ b/test/integration/segmentation_camera_plugin.cc @@ -57,7 +57,7 @@ uint8_t *g_buffer = nullptr; /// \brief counter of received segmentation msgs unsigned int g_counter = 0; -/// \brief Label of the hidden box +/// \brief Label of the boxes in the scene const uint8_t hiddenLabel = 4; const uint8_t leftBoxLabel = 1; const uint8_t rightBoxLabel = 1; @@ -223,8 +223,8 @@ void SegmentationCameraSensorTest::ImagesWithBuiltinSDF( ASSERT_NE(sensor, nullptr); sensor->SetScene(scene); - EXPECT_EQ(width, (int)sensor->ImageWidth()); - EXPECT_EQ(height, (int)sensor->ImageHeight()); + EXPECT_EQ(width, static_cast(sensor->ImageWidth())); + EXPECT_EQ(height, static_cast(sensor->ImageHeight())); auto camera = sensor->SegmentationCamera(); ASSERT_NE(camera, nullptr);