Skip to content

Commit

Permalink
style(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed May 28, 2024
1 parent 87dd1c4 commit 2640ee0
Show file tree
Hide file tree
Showing 11 changed files with 200 additions and 173 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -59,17 +59,17 @@ target_compile_options(
"-DVEHICLEMAP_VERSION=\"${vehicle_map_VERSION}\""

Check warning on line 59 in common/autoware_overlay_rviz_plugin/autoware_minimap_overlay_rviz_plugin/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / spell-check-partial

Unknown word (DVEHICLEMAP)
)

target_include_directories(${PROJECT_NAME}
target_include_directories(${PROJECT_NAME}
PRIVATE src
PRIVATE /usr/include/x86_64-linux-gnu/qt5
PRIVATE ${OGRE_INCLUDE_DIRS}
PRIVATE ${rviz_common_INCLUDE_DIRS}
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}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<!-- rviz2 -d $(ros2 pkg prefix - -share rviz_satellite)/launch/demo.rviz
ros2 run rviz_satellite publish_demo_data.py LATITUDE LONGITUDE -->

<launch>
<node pkg="rviz2" exec="rviz2" />

<node pkg="autoware_minimap_overlay_rviz_plugin" exec="publish_demo_data" args="40.9908 29.0452" />
<node pkg="rviz2" exec="rviz2"/>

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

<!-- Both frames need to be present, so just coupling them https://github.com/nobleo/rviz_satellite/issues/110 -->
<node pkg="tf2_ros" exec="static_transform_publisher" args="--frame-id map --child-frame-id gps_sensor"/>
</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<maintainer email="[email protected]">khalil</maintainer>
<license>TODO: License declaration</license>

<depend>angles</depend>
<depend>rclcpp</depend>
<depend>rcpputils</depend>
<depend>rviz_common</depend>
<depend>rviz_default_plugins</depend>
<depend>sensor_msgs</depend>
<depend>tf2_ros</depend>
<depend>angles</depend>

<build_depend>qtbase5-dev</build_depend>
<buildtool_depend>ament_cmake_auto</buildtool_depend>
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -92,4 +92,4 @@ protected Q_SLOTS:

} // namespace autoware_minimap_overlay_rviz_plugin

#endif // MINIMAP_H
#endif // MINIMAP_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,20 @@
#include <memory>
#include <string>

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_;
Expand All @@ -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<OverlayObject>;

explicit OverlayObject(const std::string &name);
explicit OverlayObject(const std::string & name);
virtual ~OverlayObject();

virtual std::string getName() const;
Expand All @@ -109,22 +111,21 @@ 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;
virtual unsigned int getTextureHeight() const;

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_
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
#ifndef TILE_HPP
#define TILE_HPP
#ifndef TILE_HPP_
#define TILE_HPP_

#include <QImage>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QObject>

#include <future>

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_; }
Expand All @@ -25,19 +27,19 @@ class Tile : public QObject {
void tileFetched();

private Q_SLOTS:
void onTileFetched(QNetworkReply *reply);
void onTileFetched(QNetworkReply * reply);

private:
int zoom_;
int x_;
int y_;
std::string last_url_;
QImage image_;
QNetworkAccessManager *network_manager_;
QNetworkAccessManager * network_manager_;

std::promise<QImage> tile_promise_;

std::future<QImage> requestRemote();
};

#endif // TILE_HPP
#endif // TILE_HPP_
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
#ifndef TILE_FIELD_HPP
#define TILE_FIELD_HPP
#ifndef TILE_FIELD_HPP_
#define TILE_FIELD_HPP_

#include "tile.hpp"

#include <QImage>
#include <QObject>

#include <cmath>
#include <map>
#include <memory>
#include <mutex>
#include <string>

class TileField : public QObject {
class TileField : public QObject
{
Q_OBJECT

public:
TileField(QObject *parent = nullptr);
TileField(QObject * parent = nullptr);
~TileField();

void initializeTiles(int center_x_tile, int center_y_tile);
Expand Down Expand Up @@ -44,4 +47,4 @@ private Q_SLOTS:
std::mutex tile_mutex_;
};

#endif // TILE_FIELD_HPP
#endif // TILE_FIELD_HPP_
Loading

0 comments on commit 2640ee0

Please sign in to comment.