Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tier4_system_rviz_plugin): add package #4945

36 changes: 36 additions & 0 deletions common/tier4_system_rviz_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
cmake_minimum_required(VERSION 3.14)
project(tier4_system_rviz_plugin)

find_package(autoware_cmake REQUIRED)
autoware_package()

find_package(Qt5 REQUIRED Core Widgets)
set(QT_LIBRARIES Qt5::Widgets)

set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_definitions(-DQT_NO_KEYWORDS)

set(HEADERS
src/mrm_summary_overlay_display.hpp
src/jsk_overlay_utils.hpp
)

## Declare a C++ library
ament_auto_add_library(tier4_system_rviz_plugin SHARED
src/mrm_summary_overlay_display.cpp
src/jsk_overlay_utils.cpp
${HEADERS}
)

target_link_libraries(tier4_system_rviz_plugin
${QT_LIBRARIES}
)

# Export the plugin to be imported by rviz2
pluginlib_export_plugin_description_file(rviz_common plugins/plugin_description.xml)

ament_auto_package(
INSTALL_TO_SHARE
plugins
)
1 change: 1 addition & 0 deletions common/tier4_system_rviz_plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# tier4_system_rviz_plugin
30 changes: 30 additions & 0 deletions common/tier4_system_rviz_plugin/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>tier4_system_rviz_plugin</name>
<version>0.1.0</version>
<description>The tier4_vehicle_rviz_plugin package</description>
<maintainer email="[email protected]">Koji Minoda</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>autoware_auto_system_msgs</depend>
<depend>diagnostic_msgs</depend>
<depend>libqt5-core</depend>
<depend>libqt5-gui</depend>
<depend>libqt5-widgets</depend>
<depend>qtbase5-dev</depend>
<depend>rviz_common</depend>
<depend>rviz_default_plugins</depend>
<depend>rviz_ogre_vendor</depend>
<depend>tier4_autoware_utils</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<library path="tier4_system_rviz_plugin">
<class name="rviz_plugins/MrmSummaryOverlayDisplay"
type="rviz_plugins::MrmSummaryOverlayDisplay"
base_class_type="rviz_common::Display">
</class>
</library>
222 changes: 222 additions & 0 deletions common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
// Copyright 2022 Tier IV, Inc.

Check warning on line 1 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Complex Conditional

OverlayObject::updateTextureSize has 1 complex conditionals with 2 branches, threshold = 2. A complex conditional is an expression inside a branch (e.g. if, for, while) which consists of multiple, logical operators such as AND/OR. The more logical operators in an expression, the more severe the code smell.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Copyright (c) 2014, JSK Lab
// All rights reserved.
//
// Software License Agreement (BSD License)
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of {copyright_holder} nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.S SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

#include "jsk_overlay_utils.hpp"

#include <string>

namespace jsk_rviz_plugins
{
ScopedPixelBuffer::ScopedPixelBuffer(Ogre::HardwarePixelBufferSharedPtr pixel_buffer)
: pixel_buffer_(pixel_buffer)

Check warning on line 55 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L54-L55

Added lines #L54 - L55 were not covered by tests
{
pixel_buffer_->lock(Ogre::HardwareBuffer::HBL_NORMAL);
}

Check warning on line 58 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L57-L58

Added lines #L57 - L58 were not covered by tests

ScopedPixelBuffer::~ScopedPixelBuffer()

Check warning on line 60 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L60

Added line #L60 was not covered by tests
{
pixel_buffer_->unlock();
}

Check warning on line 63 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L62-L63

Added lines #L62 - L63 were not covered by tests

Ogre::HardwarePixelBufferSharedPtr ScopedPixelBuffer::getPixelBuffer()

Check warning on line 65 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L65

Added line #L65 was not covered by tests
{
return pixel_buffer_;

Check warning on line 67 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L67

Added line #L67 was not covered by tests
}

QImage ScopedPixelBuffer::getQImage(unsigned int width, unsigned int height)

Check warning on line 70 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L70

Added line #L70 was not covered by tests
{
const Ogre::PixelBox & pixelBox = pixel_buffer_->getCurrentLock();
Ogre::uint8 * pDest = static_cast<Ogre::uint8 *>(pixelBox.data);
memset(pDest, 0, width * height);
return QImage(pDest, width, height, QImage::Format_ARGB32);

Check warning on line 75 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L72-L75

Added lines #L72 - L75 were not covered by tests
}

QImage ScopedPixelBuffer::getQImage(unsigned int width, unsigned int height, QColor & bg_color)

Check warning on line 78 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L78

Added line #L78 was not covered by tests
{
QImage Hud = getQImage(width, height);
for (unsigned int i = 0; i < width; i++) {
for (unsigned int j = 0; j < height; j++) {
Hud.setPixel(i, j, bg_color.rgba());

Check warning on line 83 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L80-L83

Added lines #L80 - L83 were not covered by tests
}
}
return Hud;
}

Check warning on line 87 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L86-L87

Added lines #L86 - L87 were not covered by tests

QImage ScopedPixelBuffer::getQImage(OverlayObject & overlay)

Check warning on line 89 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L89

Added line #L89 was not covered by tests
{
return getQImage(overlay.getTextureWidth(), overlay.getTextureHeight());

Check warning on line 91 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L91

Added line #L91 was not covered by tests
}

QImage ScopedPixelBuffer::getQImage(OverlayObject & overlay, QColor & bg_color)

Check warning on line 94 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L94

Added line #L94 was not covered by tests
{
return getQImage(overlay.getTextureWidth(), overlay.getTextureHeight(), bg_color);

Check warning on line 96 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L96

Added line #L96 was not covered by tests
}

OverlayObject::OverlayObject(const std::string & name) : name_(name)

Check warning on line 99 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L99

Added line #L99 was not covered by tests
{
std::string material_name = name_ + "Material";
Ogre::OverlayManager * mOverlayMgr = Ogre::OverlayManager::getSingletonPtr();
overlay_ = mOverlayMgr->create(name_);
panel_ = static_cast<Ogre::PanelOverlayElement *>(
mOverlayMgr->createOverlayElement("Panel", name_ + "Panel"));
panel_->setMetricsMode(Ogre::GMM_PIXELS);

Check warning on line 106 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L101-L106

Added lines #L101 - L106 were not covered by tests

panel_material_ = Ogre::MaterialManager::getSingleton().create(

Check warning on line 108 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L108

Added line #L108 was not covered by tests
material_name, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
panel_->setMaterialName(panel_material_->getName());
overlay_->add2D(panel_);
}

Check warning on line 112 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L110-L112

Added lines #L110 - L112 were not covered by tests

OverlayObject::~OverlayObject()

Check warning on line 114 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L114

Added line #L114 was not covered by tests
{
hide();
panel_material_->unload();
Ogre::MaterialManager::getSingleton().remove(panel_material_->getName());

Check warning on line 118 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L116-L118

Added lines #L116 - L118 were not covered by tests
// Ogre::OverlayManager* mOverlayMgr = Ogre::OverlayManager::getSingletonPtr();
// mOverlayMgr->destroyOverlayElement(panel_);
// delete panel_;
// delete overlay_;
}

Check warning on line 123 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L123

Added line #L123 was not covered by tests

std::string OverlayObject::getName()

Check warning on line 125 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L125

Added line #L125 was not covered by tests
{
return name_;

Check warning on line 127 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L127

Added line #L127 was not covered by tests
}

void OverlayObject::hide()

Check warning on line 130 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L130

Added line #L130 was not covered by tests
{
if (overlay_->isVisible()) {
overlay_->hide();

Check warning on line 133 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L132-L133

Added lines #L132 - L133 were not covered by tests
}
}

Check warning on line 135 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L135

Added line #L135 was not covered by tests

void OverlayObject::show()

Check warning on line 137 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L137

Added line #L137 was not covered by tests
{
if (!overlay_->isVisible()) {
overlay_->show();

Check warning on line 140 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L139-L140

Added lines #L139 - L140 were not covered by tests
}
}

Check warning on line 142 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L142

Added line #L142 was not covered by tests

bool OverlayObject::isTextureReady()

Check warning on line 144 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L144

Added line #L144 was not covered by tests
{
return static_cast<bool>(texture_);

Check warning on line 146 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L146

Added line #L146 was not covered by tests
}

void OverlayObject::updateTextureSize(unsigned int width, unsigned int height)

Check warning on line 149 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L149

Added line #L149 was not covered by tests
{
const std::string texture_name = name_ + "Texture";
if (width == 0) {
RCLCPP_WARN(rclcpp::get_logger("OverlayObject"), "width=0 is specified as texture size");

Check warning on line 153 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L151-L153

Added lines #L151 - L153 were not covered by tests
width = 1;
}
if (height == 0) {
RCLCPP_WARN(rclcpp::get_logger("OverlayObject"), "height=0 is specified as texture size");

Check warning on line 157 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L156-L157

Added lines #L156 - L157 were not covered by tests
height = 1;
}
if (!isTextureReady() || ((width != texture_->getWidth()) || (height != texture_->getHeight()))) {
if (isTextureReady()) {
Ogre::TextureManager::getSingleton().remove(texture_name);
panel_material_->getTechnique(0)->getPass(0)->removeAllTextureUnitStates();

Check warning on line 163 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L160-L163

Added lines #L160 - L163 were not covered by tests
}
texture_ = Ogre::TextureManager::getSingleton().createManual(

Check warning on line 165 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L165

Added line #L165 was not covered by tests
texture_name, // name
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
Ogre::TEX_TYPE_2D, // type
width, height, // width & height of the render window
0, // number of mipmaps
Ogre::PF_A8R8G8B8, // pixel format chosen to match a format Qt can use
Ogre::TU_DEFAULT // usage
);
panel_material_->getTechnique(0)->getPass(0)->createTextureUnitState(texture_name);

Check warning on line 174 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L174

Added line #L174 was not covered by tests

panel_material_->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);

Check warning on line 176 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L176

Added line #L176 was not covered by tests
}
}

Check warning on line 178 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L178

Added line #L178 was not covered by tests

ScopedPixelBuffer OverlayObject::getBuffer()

Check warning on line 180 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L180

Added line #L180 was not covered by tests
{
if (isTextureReady()) {
return ScopedPixelBuffer(texture_->getBuffer());

Check warning on line 183 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L182-L183

Added lines #L182 - L183 were not covered by tests
} else {
return ScopedPixelBuffer(Ogre::HardwarePixelBufferSharedPtr());

Check warning on line 185 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L185

Added line #L185 was not covered by tests
}
}

void OverlayObject::setPosition(double left, double top)

Check warning on line 189 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L189

Added line #L189 was not covered by tests
{
panel_->setPosition(left, top);
}

Check warning on line 192 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L191-L192

Added lines #L191 - L192 were not covered by tests

void OverlayObject::setDimensions(double width, double height)

Check warning on line 194 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L194

Added line #L194 was not covered by tests
{
panel_->setDimensions(width, height);
}

Check warning on line 197 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L196-L197

Added lines #L196 - L197 were not covered by tests

bool OverlayObject::isVisible()

Check warning on line 199 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L199

Added line #L199 was not covered by tests
{
return overlay_->isVisible();

Check warning on line 201 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L201

Added line #L201 was not covered by tests
}

unsigned int OverlayObject::getTextureWidth()

Check warning on line 204 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L204

Added line #L204 was not covered by tests
{
if (isTextureReady()) {
return texture_->getWidth();

Check warning on line 207 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L206-L207

Added lines #L206 - L207 were not covered by tests
} else {
return 0;
}
}

unsigned int OverlayObject::getTextureHeight()

Check warning on line 213 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L213

Added line #L213 was not covered by tests
{
if (isTextureReady()) {
return texture_->getHeight();

Check warning on line 216 in common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_system_rviz_plugin/src/jsk_overlay_utils.cpp#L215-L216

Added lines #L215 - L216 were not covered by tests
} else {
return 0;
}
}

} // namespace jsk_rviz_plugins
Loading
Loading