From 2640ee03b67c83c94edb3e786942bf406b0f8d98 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Tue, 28 May 2024 09:31:25 +0000
Subject: [PATCH] style(pre-commit): autofix
---
.../CMakeLists.txt | 10 +-
.../demo/demo.launch.xml | 10 +-
.../demo/publish_demo_data | 8 +-
.../package.xml | 2 +-
.../src/include/minimap.hpp | 6 +-
.../src/include/overlay_utils.hpp | 33 ++--
.../src/include/tile.hpp | 18 +-
.../src/include/tile_field.hpp | 13 +-
.../src/overlay_utils.cpp | 177 ++++++++++--------
.../src/tile.cpp | 2 +-
.../src/tile_field.cpp | 94 +++++-----
11 files changed, 200 insertions(+), 173 deletions(-)
diff --git a/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/CMakeLists.txt b/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/CMakeLists.txt
index f3161082925b5..410b3280d1cd0 100644
--- a/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/CMakeLists.txt
+++ b/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/CMakeLists.txt
@@ -31,7 +31,7 @@ set(
src/include/minimap.hpp
src/include/tile.hpp
src/include/tile_field.hpp
- src/include/overlay_utils.hpp
+ src/include/overlay_utils.hpp
)
foreach(header "${headers_to_moc}")
@@ -59,7 +59,7 @@ target_compile_options(
"-DVEHICLEMAP_VERSION=\"${vehicle_map_VERSION}\""
)
-target_include_directories(${PROJECT_NAME}
+target_include_directories(${PROJECT_NAME}
PRIVATE src
PRIVATE /usr/include/x86_64-linux-gnu/qt5
PRIVATE ${OGRE_INCLUDE_DIRS}
@@ -67,9 +67,9 @@ target_include_directories(${PROJECT_NAME}
PRIVATE ${rviz_default_plugins_INCLUDE_DIRS}
)
-target_link_libraries(${PROJECT_NAME}
- Qt5::Network
- Qt5::Widgets
+target_link_libraries(${PROJECT_NAME}
+ Qt5::Network
+ Qt5::Widgets
${OGRE_LIBRARIES}
${rviz_common_LIBRARIES}
${rviz_default_plugins_LIBRARIES}
diff --git a/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/demo/demo.launch.xml b/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/demo/demo.launch.xml
index c069726394c74..fefdc4569a256 100644
--- a/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/demo/demo.launch.xml
+++ b/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/demo/demo.launch.xml
@@ -1,12 +1,10 @@
-
-
-
-
+
-
-
+
+
+
diff --git a/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/demo/publish_demo_data b/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/demo/publish_demo_data
index de4aa43d86f4a..57188ae2f0618 100755
--- a/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/demo/publish_demo_data
+++ b/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/demo/publish_demo_data
@@ -2,12 +2,14 @@
"""
Periodically publish gps positions in a circle around a given origin as NavSatFix messages.
"""
-import rclpy
+from argparse import ArgumentParser
import math
+
import numpy as np
-from argparse import ArgumentParser
+import rclpy
from rclpy.time import CONVERSION_CONSTANT
-from sensor_msgs.msg import NavSatFix, NavSatStatus
+from sensor_msgs.msg import NavSatFix
+from sensor_msgs.msg import NavSatStatus
class CircularTranslate:
diff --git a/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/package.xml b/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/package.xml
index 59b667189f57f..a625f6a3c4a15 100644
--- a/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/package.xml
+++ b/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/package.xml
@@ -7,13 +7,13 @@
khalil
TODO: License declaration
+ angles
rclcpp
rcpputils
rviz_common
rviz_default_plugins
sensor_msgs
tf2_ros
- angles
qtbase5-dev
ament_cmake_auto
diff --git a/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/minimap.hpp b/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/minimap.hpp
index 90196c8508a8e..93cc3a2a0a0de 100644
--- a/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/minimap.hpp
+++ b/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/minimap.hpp
@@ -1,5 +1,5 @@
-#ifndef MINIMAP_H
-#define MINIMAP_H
+#ifndef MINIMAP_HPP_
+#define MINIMAP_HPP_
#include "overlay_utils.hpp"
#include "rviz_common/properties/color_property.hpp"
@@ -92,4 +92,4 @@ protected Q_SLOTS:
} // namespace autoware_minimap_overlay_rviz_plugin
-#endif // MINIMAP_H
+#endif // MINIMAP_HPP_
diff --git a/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/overlay_utils.hpp b/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/overlay_utils.hpp
index 90aa61d1c6cd4..9e28d989ee2ee 100644
--- a/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/overlay_utils.hpp
+++ b/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/overlay_utils.hpp
@@ -68,19 +68,20 @@
#include
#include
-namespace rviz_satellite {
+namespace rviz_satellite
+{
class OverlayObject;
-class ScopedPixelBuffer {
+class ScopedPixelBuffer
+{
public:
explicit ScopedPixelBuffer(Ogre::HardwarePixelBufferSharedPtr pixel_buffer);
virtual ~ScopedPixelBuffer();
virtual Ogre::HardwarePixelBufferSharedPtr getPixelBuffer();
virtual QImage getQImage(unsigned int width, unsigned int height);
- virtual QImage getQImage(OverlayObject &overlay);
- virtual QImage getQImage(unsigned int width, unsigned int height,
- QColor &bg_color);
- virtual QImage getQImage(OverlayObject &overlay, QColor &bg_color);
+ virtual QImage getQImage(OverlayObject & overlay);
+ virtual QImage getQImage(unsigned int width, unsigned int height, QColor & bg_color);
+ virtual QImage getQImage(OverlayObject & overlay, QColor & bg_color);
protected:
Ogre::HardwarePixelBufferSharedPtr pixel_buffer_;
@@ -96,11 +97,12 @@ enum class HorizontalAlignment : uint8_t { LEFT, RIGHT, CENTER };
* This class is supposed to be instantiated in the onInitialize method of the
* rviz_common::Display class.
*/
-class OverlayObject {
+class OverlayObject
+{
public:
using SharedPtr = std::shared_ptr;
- explicit OverlayObject(const std::string &name);
+ explicit OverlayObject(const std::string & name);
virtual ~OverlayObject();
virtual std::string getName() const;
@@ -109,10 +111,9 @@ class OverlayObject {
virtual bool isTextureReady() const;
virtual void updateTextureSize(unsigned int width, unsigned int height);
virtual ScopedPixelBuffer getBuffer();
- virtual void
- setPosition(double hor_dist, double ver_dist,
- HorizontalAlignment hor_alignment = HorizontalAlignment::LEFT,
- VerticalAlignment ver_alignment = VerticalAlignment::TOP);
+ virtual void setPosition(
+ double hor_dist, double ver_dist, HorizontalAlignment hor_alignment = HorizontalAlignment::LEFT,
+ VerticalAlignment ver_alignment = VerticalAlignment::TOP);
virtual void setDimensions(double width, double height);
virtual bool isVisible() const;
virtual unsigned int getTextureWidth() const;
@@ -120,11 +121,11 @@ class OverlayObject {
protected:
const std::string name_;
- Ogre::Overlay *overlay_;
- Ogre::PanelOverlayElement *panel_;
+ Ogre::Overlay * overlay_;
+ Ogre::PanelOverlayElement * panel_;
Ogre::MaterialPtr panel_material_;
Ogre::TexturePtr texture_;
};
-} // namespace rviz_satellite
+} // namespace rviz_satellite
-#endif // OVERLAY_UTILS_HPP_
+#endif // OVERLAY_UTILS_HPP_
diff --git a/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/tile.hpp b/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/tile.hpp
index 18b261b73c562..db7265a7be521 100644
--- a/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/tile.hpp
+++ b/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/tile.hpp
@@ -1,21 +1,23 @@
-#ifndef TILE_HPP
-#define TILE_HPP
+#ifndef TILE_HPP_
+#define TILE_HPP_
#include
#include
#include
#include
+
#include
-class Tile : public QObject {
+class Tile : public QObject
+{
Q_OBJECT
public:
- Tile(int zoom, int x, int y, QObject *parent = nullptr);
+ Tile(int zoom, int x, int y, QObject * parent = nullptr);
~Tile();
void fetch();
QImage getImage() const;
- bool isValidUrl(const std::string &url) const;
+ bool isValidUrl(const std::string & url) const;
int getZoom() const { return zoom_; }
int getX() const { return x_; }
@@ -25,7 +27,7 @@ class Tile : public QObject {
void tileFetched();
private Q_SLOTS:
- void onTileFetched(QNetworkReply *reply);
+ void onTileFetched(QNetworkReply * reply);
private:
int zoom_;
@@ -33,11 +35,11 @@ private Q_SLOTS:
int y_;
std::string last_url_;
QImage image_;
- QNetworkAccessManager *network_manager_;
+ QNetworkAccessManager * network_manager_;
std::promise tile_promise_;
std::future requestRemote();
};
-#endif // TILE_HPP
\ No newline at end of file
+#endif // TILE_HPP_
diff --git a/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/tile_field.hpp b/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/tile_field.hpp
index cc8c8a0adc5c2..e3bf35a0fa2a5 100644
--- a/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/tile_field.hpp
+++ b/common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/tile_field.hpp
@@ -1,20 +1,23 @@
-#ifndef TILE_FIELD_HPP
-#define TILE_FIELD_HPP
+#ifndef TILE_FIELD_HPP_
+#define TILE_FIELD_HPP_
#include "tile.hpp"
+
#include
#include
+
#include
#include