Skip to content

Commit 2640ee0

Browse files
style(pre-commit): autofix
1 parent 87dd1c4 commit 2640ee0

File tree

11 files changed

+200
-173
lines changed

11 files changed

+200
-173
lines changed

common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/CMakeLists.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ set(
3131
src/include/minimap.hpp
3232
src/include/tile.hpp
3333
src/include/tile_field.hpp
34-
src/include/overlay_utils.hpp
34+
src/include/overlay_utils.hpp
3535
)
3636

3737
foreach(header "${headers_to_moc}")
@@ -59,17 +59,17 @@ target_compile_options(
5959
"-DVEHICLEMAP_VERSION=\"${vehicle_map_VERSION}\""
6060
)
6161

62-
target_include_directories(${PROJECT_NAME}
62+
target_include_directories(${PROJECT_NAME}
6363
PRIVATE src
6464
PRIVATE /usr/include/x86_64-linux-gnu/qt5
6565
PRIVATE ${OGRE_INCLUDE_DIRS}
6666
PRIVATE ${rviz_common_INCLUDE_DIRS}
6767
PRIVATE ${rviz_default_plugins_INCLUDE_DIRS}
6868
)
6969

70-
target_link_libraries(${PROJECT_NAME}
71-
Qt5::Network
72-
Qt5::Widgets
70+
target_link_libraries(${PROJECT_NAME}
71+
Qt5::Network
72+
Qt5::Widgets
7373
${OGRE_LIBRARIES}
7474
${rviz_common_LIBRARIES}
7575
${rviz_default_plugins_LIBRARIES}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<!-- rviz2 -d $(ros2 pkg prefix - -share rviz_satellite)/launch/demo.rviz
22
ros2 run rviz_satellite publish_demo_data.py LATITUDE LONGITUDE -->
3-
43
<launch>
5-
<node pkg="rviz2" exec="rviz2" />
6-
7-
<node pkg="autoware_minimap_overlay_rviz_plugin" exec="publish_demo_data" args="40.9908 29.0452" />
4+
<node pkg="rviz2" exec="rviz2"/>
85

9-
<!-- Both frames need to be present, so just coupling them https://github.com/nobleo/rviz_satellite/issues/110 -->
10-
<node pkg="tf2_ros" exec="static_transform_publisher" args="--frame-id map --child-frame-id gps_sensor" />
6+
<node pkg="autoware_minimap_overlay_rviz_plugin" exec="publish_demo_data" args="40.9908 29.0452"/>
117

8+
<!-- Both frames need to be present, so just coupling them https://github.com/nobleo/rviz_satellite/issues/110 -->
9+
<node pkg="tf2_ros" exec="static_transform_publisher" args="--frame-id map --child-frame-id gps_sensor"/>
1210
</launch>

common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/demo/publish_demo_data

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
"""
33
Periodically publish gps positions in a circle around a given origin as NavSatFix messages.
44
"""
5-
import rclpy
5+
from argparse import ArgumentParser
66
import math
7+
78
import numpy as np
8-
from argparse import ArgumentParser
9+
import rclpy
910
from rclpy.time import CONVERSION_CONSTANT
10-
from sensor_msgs.msg import NavSatFix, NavSatStatus
11+
from sensor_msgs.msg import NavSatFix
12+
from sensor_msgs.msg import NavSatStatus
1113

1214

1315
class CircularTranslate:

common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
<maintainer email="khalil@leodrive.ai">khalil</maintainer>
88
<license>TODO: License declaration</license>
99

10+
<depend>angles</depend>
1011
<depend>rclcpp</depend>
1112
<depend>rcpputils</depend>
1213
<depend>rviz_common</depend>
1314
<depend>rviz_default_plugins</depend>
1415
<depend>sensor_msgs</depend>
1516
<depend>tf2_ros</depend>
16-
<depend>angles</depend>
1717

1818
<build_depend>qtbase5-dev</build_depend>
1919
<buildtool_depend>ament_cmake_auto</buildtool_depend>

common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/minimap.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef MINIMAP_H
2-
#define MINIMAP_H
1+
#ifndef MINIMAP_HPP_
2+
#define MINIMAP_HPP_
33

44
#include "overlay_utils.hpp"
55
#include "rviz_common/properties/color_property.hpp"
@@ -92,4 +92,4 @@ protected Q_SLOTS:
9292

9393
} // namespace autoware_minimap_overlay_rviz_plugin
9494

95-
#endif // MINIMAP_H
95+
#endif // MINIMAP_HPP_

common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/overlay_utils.hpp

+17-16
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,20 @@
6868
#include <memory>
6969
#include <string>
7070

71-
namespace rviz_satellite {
71+
namespace rviz_satellite
72+
{
7273
class OverlayObject;
7374

74-
class ScopedPixelBuffer {
75+
class ScopedPixelBuffer
76+
{
7577
public:
7678
explicit ScopedPixelBuffer(Ogre::HardwarePixelBufferSharedPtr pixel_buffer);
7779
virtual ~ScopedPixelBuffer();
7880
virtual Ogre::HardwarePixelBufferSharedPtr getPixelBuffer();
7981
virtual QImage getQImage(unsigned int width, unsigned int height);
80-
virtual QImage getQImage(OverlayObject &overlay);
81-
virtual QImage getQImage(unsigned int width, unsigned int height,
82-
QColor &bg_color);
83-
virtual QImage getQImage(OverlayObject &overlay, QColor &bg_color);
82+
virtual QImage getQImage(OverlayObject & overlay);
83+
virtual QImage getQImage(unsigned int width, unsigned int height, QColor & bg_color);
84+
virtual QImage getQImage(OverlayObject & overlay, QColor & bg_color);
8485

8586
protected:
8687
Ogre::HardwarePixelBufferSharedPtr pixel_buffer_;
@@ -96,11 +97,12 @@ enum class HorizontalAlignment : uint8_t { LEFT, RIGHT, CENTER };
9697
* This class is supposed to be instantiated in the onInitialize method of the
9798
* rviz_common::Display class.
9899
*/
99-
class OverlayObject {
100+
class OverlayObject
101+
{
100102
public:
101103
using SharedPtr = std::shared_ptr<OverlayObject>;
102104

103-
explicit OverlayObject(const std::string &name);
105+
explicit OverlayObject(const std::string & name);
104106
virtual ~OverlayObject();
105107

106108
virtual std::string getName() const;
@@ -109,22 +111,21 @@ class OverlayObject {
109111
virtual bool isTextureReady() const;
110112
virtual void updateTextureSize(unsigned int width, unsigned int height);
111113
virtual ScopedPixelBuffer getBuffer();
112-
virtual void
113-
setPosition(double hor_dist, double ver_dist,
114-
HorizontalAlignment hor_alignment = HorizontalAlignment::LEFT,
115-
VerticalAlignment ver_alignment = VerticalAlignment::TOP);
114+
virtual void setPosition(
115+
double hor_dist, double ver_dist, HorizontalAlignment hor_alignment = HorizontalAlignment::LEFT,
116+
VerticalAlignment ver_alignment = VerticalAlignment::TOP);
116117
virtual void setDimensions(double width, double height);
117118
virtual bool isVisible() const;
118119
virtual unsigned int getTextureWidth() const;
119120
virtual unsigned int getTextureHeight() const;
120121

121122
protected:
122123
const std::string name_;
123-
Ogre::Overlay *overlay_;
124-
Ogre::PanelOverlayElement *panel_;
124+
Ogre::Overlay * overlay_;
125+
Ogre::PanelOverlayElement * panel_;
125126
Ogre::MaterialPtr panel_material_;
126127
Ogre::TexturePtr texture_;
127128
};
128-
} // namespace rviz_satellite
129+
} // namespace rviz_satellite
129130

130-
#endif // OVERLAY_UTILS_HPP_
131+
#endif // OVERLAY_UTILS_HPP_
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
#ifndef TILE_HPP
2-
#define TILE_HPP
1+
#ifndef TILE_HPP_
2+
#define TILE_HPP_
33

44
#include <QImage>
55
#include <QNetworkAccessManager>
66
#include <QNetworkReply>
77
#include <QObject>
8+
89
#include <future>
910

10-
class Tile : public QObject {
11+
class Tile : public QObject
12+
{
1113
Q_OBJECT
1214

1315
public:
14-
Tile(int zoom, int x, int y, QObject *parent = nullptr);
16+
Tile(int zoom, int x, int y, QObject * parent = nullptr);
1517
~Tile();
1618
void fetch();
1719
QImage getImage() const;
18-
bool isValidUrl(const std::string &url) const;
20+
bool isValidUrl(const std::string & url) const;
1921

2022
int getZoom() const { return zoom_; }
2123
int getX() const { return x_; }
@@ -25,19 +27,19 @@ class Tile : public QObject {
2527
void tileFetched();
2628

2729
private Q_SLOTS:
28-
void onTileFetched(QNetworkReply *reply);
30+
void onTileFetched(QNetworkReply * reply);
2931

3032
private:
3133
int zoom_;
3234
int x_;
3335
int y_;
3436
std::string last_url_;
3537
QImage image_;
36-
QNetworkAccessManager *network_manager_;
38+
QNetworkAccessManager * network_manager_;
3739

3840
std::promise<QImage> tile_promise_;
3941

4042
std::future<QImage> requestRemote();
4143
};
4244

43-
#endif // TILE_HPP
45+
#endif // TILE_HPP_

common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/src/include/tile_field.hpp

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
#ifndef TILE_FIELD_HPP
2-
#define TILE_FIELD_HPP
1+
#ifndef TILE_FIELD_HPP_
2+
#define TILE_FIELD_HPP_
33

44
#include "tile.hpp"
5+
56
#include <QImage>
67
#include <QObject>
8+
79
#include <cmath>
810
#include <map>
911
#include <memory>
1012
#include <mutex>
1113
#include <string>
1214

13-
class TileField : public QObject {
15+
class TileField : public QObject
16+
{
1417
Q_OBJECT
1518

1619
public:
17-
TileField(QObject *parent = nullptr);
20+
TileField(QObject * parent = nullptr);
1821
~TileField();
1922

2023
void initializeTiles(int center_x_tile, int center_y_tile);
@@ -44,4 +47,4 @@ private Q_SLOTS:
4447
std::mutex tile_mutex_;
4548
};
4649

47-
#endif // TILE_FIELD_HPP
50+
#endif // TILE_FIELD_HPP_

0 commit comments

Comments
 (0)