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

Iron Compatibility #779

Merged
merged 7 commits into from Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion mapviz/CMakeLists.txt
Expand Up @@ -133,9 +133,15 @@ target_compile_definitions(rqt_${PROJECT_NAME}
PRIVATE
USE_NEW_TF2_TOMSG=${USE_NEW_TF2_TOMSG}
)

# Foxy uses TF2 .h files, not .hpp files
if ("$ENV{ROS_DISTRO}" STRLESS_EQUAL "galactic")
target_compile_definitions(rqt_${PROJECT_NAME} PRIVATE "-DUSE_TF2_H_FILES")
endif()

target_link_libraries(rqt_${PROJECT_NAME}
OpenGL::GL
${GLUT_LIBRARY}
${GLUT_LIBRARIES}
GLEW::GLEW
opencv_core
opencv_highgui
Expand Down
2 changes: 1 addition & 1 deletion mapviz/include/mapviz/config_item.h
Expand Up @@ -50,7 +50,7 @@ class ConfigItem : public QWidget
Q_OBJECT

public:
explicit ConfigItem(QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr);
explicit ConfigItem(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
~ConfigItem() override = default;

void SetName(QString name);
Expand Down
4 changes: 4 additions & 0 deletions mapviz/include/mapviz/map_canvas.h
Expand Up @@ -41,7 +41,11 @@
#include <rclcpp/rclcpp.hpp>
#include <tf2/transform_datatypes.h>
#include <tf2_ros/transform_listener.h>
#ifdef USE_TF2_H_FILES
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#else
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#endif

#include <mapviz/mapviz_plugin.h>

Expand Down
2 changes: 1 addition & 1 deletion mapviz/include/mapviz/mapviz.hpp
Expand Up @@ -83,7 +83,7 @@ class Mapviz : public QMainWindow
int argc,
char** argv,
QWidget *parent = 0,
Qt::WindowFlags flags = 0);
Qt::WindowFlags flags = Qt::WindowFlags());
~Mapviz();

rclcpp::Node::SharedPtr GetNode();
Expand Down
10 changes: 5 additions & 5 deletions mapviz/include/mapviz/widgets.h
Expand Up @@ -27,8 +27,8 @@
//
// *****************************************************************************

#ifndef MAPVIZ__WIDGETS_H_
#define MAPVIZ__WIDGETS_H_
#ifndef MAPVIZ_WIDGETS_H_
#define MAPVIZ_WIDGETS_H_

// QT libraries
#include <QWidget>
Expand Down Expand Up @@ -87,7 +87,7 @@ class SingleClickLabel : public QLabel
Q_OBJECT

public:
explicit SingleClickLabel(QWidget *parent = 0, Qt::WindowFlags flags = 0) :
explicit SingleClickLabel(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()) :
QLabel(parent, flags) {}

~SingleClickLabel() override = default;
Expand All @@ -107,7 +107,7 @@ class DoubleClickWidget : public QWidget
Q_OBJECT

public:
explicit DoubleClickWidget(QWidget *parent = 0, Qt::WindowFlags flags = 0) :
explicit DoubleClickWidget(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()) :
QWidget(parent, flags) {}

~DoubleClickWidget() override = default;
Expand Down Expand Up @@ -137,7 +137,7 @@ class IconWidget : public QWidget
Q_OBJECT

public:
explicit IconWidget(QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr) :
explicit IconWidget(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags()) :
QWidget(parent, flags)
{
pixmap_ = QPixmap(16, 16);
Expand Down
5 changes: 2 additions & 3 deletions mapviz/src/map_canvas.cpp
Expand Up @@ -252,8 +252,7 @@ void MapCanvas::paintEvent(QPaintEvent* event)
QPainter p(this);
p.setRenderHints(QPainter::Antialiasing |
QPainter::TextAntialiasing |
QPainter::SmoothPixmapTransform |
QPainter::HighQualityAntialiasing,
QPainter::SmoothPixmapTransform,
enable_antialiasing_);
p.beginNativePainting();
// .beginNativePainting() disables blending and clears a handful of other
Expand Down Expand Up @@ -330,7 +329,7 @@ void MapCanvas::popGlMatrices()

void MapCanvas::wheelEvent(QWheelEvent* e)
{
float numDegrees = e->delta() / -8;
float numDegrees = e->angleDelta().y() / -8;

Zoom(numDegrees / 10.0);
}
Expand Down
2 changes: 1 addition & 1 deletion mapviz/src/mapviz.cpp
Expand Up @@ -1471,7 +1471,7 @@ void Mapviz::SelectBackgroundColor(const QColor &color)
void Mapviz::SetCaptureDirectory()
{
QFileDialog dialog(this, "Select Capture Directory");
dialog.setFileMode(QFileDialog::DirectoryOnly);
dialog.setOption(QFileDialog::ShowDirsOnly, true);

dialog.exec();

Expand Down
8 changes: 8 additions & 0 deletions mapviz_plugins/CMakeLists.txt
Expand Up @@ -167,12 +167,20 @@ add_library(${PROJECT_NAME} SHARED
${SRC_FILES}
${UI_SRC_FILES}
)

target_include_directories(${PROJECT_NAME}
PUBLIC
include)

target_compile_definitions(${PROJECT_NAME}
PUBLIC
"PLUGINLIB__DISABLE_BOOST_FUNCTIONS")

# Iron and later switched some cv_bridge files to .hpp from .h
if ("$ENV{ROS_DISTRO}" STRLESS "iron")
target_compile_definitions(${PROJECT_NAME} PRIVATE "-DUSE_CVBRIDGE_H_FILES")
endif()

ament_target_dependencies(${PROJECT_NAME}
ament_cmake
ament_index_cpp
Expand Down
4 changes: 4 additions & 0 deletions mapviz_plugins/include/mapviz_plugins/disparity_plugin.h
Expand Up @@ -40,7 +40,11 @@
#include <QWidget>

// ROS libraries
#ifdef USE_CVBRIDGE_H_FILES
#include <cv_bridge/cv_bridge.h>
#else
#include <cv_bridge/cv_bridge.hpp>
#endif
#include <opencv2/highgui.hpp>
#include <rclcpp/rclcpp.hpp>
#include <stereo_msgs/msg/disparity_image.hpp>
Expand Down
4 changes: 4 additions & 0 deletions mapviz_plugins/include/mapviz_plugins/image_plugin.h
Expand Up @@ -43,7 +43,11 @@
#include <tf2/transform_datatypes.h>
#include <sensor_msgs/msg/image.hpp>
#include <opencv2/highgui.hpp>
#ifdef USE_CVBRIDGE_H_FILES
#include <cv_bridge/cv_bridge.h>
#else
#include <cv_bridge/cv_bridge.hpp>
#endif
#include <image_transport/image_transport.hpp>

#include <mapviz/map_canvas.h>
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/attitude_indicator_plugin.cpp
Expand Up @@ -62,7 +62,7 @@ namespace mapviz_plugins

// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);
roll_ = pitch_ = yaw_ = 0;
topics_.emplace_back("nav_msgs/msg/Odometry");
Expand Down
6 changes: 5 additions & 1 deletion mapviz_plugins/src/disparity_plugin.cpp
Expand Up @@ -38,7 +38,11 @@
#include <sensor_msgs/image_encodings.hpp>
#include <opencv2/imgproc/imgproc.hpp>

#ifdef USE_CVBRIDGE_H_FILES
#include <cv_bridge/cv_bridge.h>
#else
#include <cv_bridge/cv_bridge.hpp>
#endif

#include <mapviz/select_topic_dialog.h>

Expand Down Expand Up @@ -74,7 +78,7 @@ namespace mapviz_plugins

// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/draw_polygon_plugin.cpp
Expand Up @@ -72,7 +72,7 @@ namespace mapviz_plugins
ui_.color->setColor(Qt::green);
// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);
// Set status text red
QPalette p3(ui_.status->palette());
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/float_plugin.cpp
Expand Up @@ -63,7 +63,7 @@ namespace mapviz_plugins
ui_.setupUi(config_widget_);
// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/gps_plugin.cpp
Expand Up @@ -58,7 +58,7 @@ namespace mapviz_plugins

// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/grid_plugin.cpp
Expand Up @@ -67,7 +67,7 @@ namespace mapviz_plugins

// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/image_plugin.cpp
Expand Up @@ -73,7 +73,7 @@ namespace mapviz_plugins

// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/laserscan_plugin.cpp
Expand Up @@ -77,7 +77,7 @@ namespace mapviz_plugins

// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/marker_plugin.cpp
Expand Up @@ -57,7 +57,7 @@ namespace mapviz_plugins

// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/navsat_plugin.cpp
Expand Up @@ -56,7 +56,7 @@ namespace mapviz_plugins

// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/occupancy_grid_plugin.cpp
Expand Up @@ -162,7 +162,7 @@ namespace mapviz_plugins

// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/odometry_plugin.cpp
Expand Up @@ -68,7 +68,7 @@ namespace mapviz_plugins

// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down
4 changes: 2 additions & 2 deletions mapviz_plugins/src/path_plugin.cpp
Expand Up @@ -62,7 +62,7 @@ namespace mapviz_plugins

// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down Expand Up @@ -169,7 +169,7 @@ namespace mapviz_plugins
bool lines;
bool points;
QColor old_color = ui_.path_color->color();
QColor color = old_color.dark(200);
QColor color = old_color.darker(200);
SetDrawStyle( LINES );
lines = DrawPoints(scale);
SetColor(color);
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/plan_route_plugin.cpp
Expand Up @@ -84,7 +84,7 @@ namespace mapviz_plugins
ui_.color->setColor(Qt::green);
// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);
// Set status text red
QPalette p3(ui_.status->palette());
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/pointcloud2_plugin.cpp
Expand Up @@ -80,7 +80,7 @@ namespace mapviz_plugins

// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/pose_plugin.cpp
Expand Up @@ -68,7 +68,7 @@ namespace mapviz_plugins

// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/robot_image_plugin.cpp
Expand Up @@ -72,7 +72,7 @@ namespace mapviz_plugins

// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/route_plugin.cpp
Expand Up @@ -72,7 +72,7 @@ namespace mapviz_plugins
ui_.color->setColor(Qt::green);
// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);
// Set status text red
QPalette p3(ui_.status->palette());
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/string_plugin.cpp
Expand Up @@ -64,7 +64,7 @@ namespace mapviz_plugins
ui_.setupUi(config_widget_);
// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/textured_marker_plugin.cpp
Expand Up @@ -71,7 +71,7 @@ TexturedMarkerPlugin::TexturedMarkerPlugin()

// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/tf_frame_plugin.cpp
Expand Up @@ -59,7 +59,7 @@ namespace mapviz_plugins

// Set background white
QPalette p(config_widget_->palette());
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
config_widget_->setPalette(p);

// Set status text red
Expand Down
4 changes: 2 additions & 2 deletions mapviz_plugins/ui/coordinate_picker_config.ui
Expand Up @@ -66,8 +66,8 @@
<property name="readOnly">
<bool>true</bool>
</property>
<property name="tabStopWidth">
<number>4</number>
<property name="tabStopDistance">
<double>4.000000000000000</double>
</property>
<property name="textInteractionFlags">
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
Expand Down
2 changes: 1 addition & 1 deletion multires_image/include/multires_image/multires_view_node.h
Expand Up @@ -55,7 +55,7 @@ namespace multires_image
Q_OBJECT

public:
MultiresViewNode(int argc, char **argv, QWidget *parent = 0, Qt::WindowFlags flags = 0);
MultiresViewNode(int argc, char **argv, QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags());
~MultiresViewNode() override = default;

virtual void showEvent(QShowEvent* event) override;
Expand Down
2 changes: 1 addition & 1 deletion multires_image/src/QGLMap.cpp
Expand Up @@ -116,7 +116,7 @@ void QGLMap::SetTiles(TileSet* tiles)

void QGLMap::wheelEvent(QWheelEvent* e)
{
float numDegrees = static_cast<float>(e->delta()) / -8.0f;
float numDegrees = static_cast<float>(e->angleDelta().y()) / -8.0f;

m_scale *= pow(1.1, numDegrees / 10.0);

Expand Down