Skip to content

Commit

Permalink
Merge branch 'ros2:rolling' into patch-11
Browse files Browse the repository at this point in the history
  • Loading branch information
mosfet80 authored Oct 12, 2024
2 parents 12e0350 + 2a34490 commit dbc5fb3
Show file tree
Hide file tree
Showing 35 changed files with 245 additions and 66 deletions.
9 changes: 9 additions & 0 deletions rviz2/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
Changelog for package rviz2
^^^^^^^^^^^^^^^^^^^^^^^^^^^

14.3.1 (2024-10-11)
-------------------

14.3.0 (2024-10-03)
-------------------

14.2.6 (2024-08-28)
-------------------

14.2.5 (2024-07-29)
-------------------
* Detect wayland and make sure X rendering is used. (`#1253 <https://github.com/ros2/rviz/issues/1253>`_)
Expand Down
2 changes: 1 addition & 1 deletion rviz2/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>rviz2</name>
<version>14.2.5</version>
<version>14.3.1</version>
<description>
3D visualization tool for ROS.
</description>
Expand Down
9 changes: 9 additions & 0 deletions rviz_assimp_vendor/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
Changelog for package rviz_assimp_vendor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

14.3.1 (2024-10-11)
-------------------

14.3.0 (2024-10-03)
-------------------

14.2.6 (2024-08-28)
-------------------

14.2.5 (2024-07-29)
-------------------
* Revert "Update ASSIMP_VENDOR CMakeLists.txt (`#1226 <https://github.com/ros2/rviz/issues/1226>`_)" (`#1249 <https://github.com/ros2/rviz/issues/1249>`_)
Expand Down
2 changes: 1 addition & 1 deletion rviz_assimp_vendor/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>rviz_assimp_vendor</name>
<version>14.2.5</version>
<version>14.3.1</version>
<description>
Wrapper around assimp, providing nothing but a dependency on assimp, on some systems.
On others, it provides a fixed CMake module or even an ExternalProject build of assimp.
Expand Down
14 changes: 14 additions & 0 deletions rviz_common/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
Changelog for package rviz_common
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

14.3.1 (2024-10-11)
-------------------
* Handle time source exception (`#1285 <https://github.com/ros2/rviz/issues/1285>`_)
* Contributors: Matthew Foran

14.3.0 (2024-10-03)
-------------------

14.2.6 (2024-08-28)
-------------------
* Fully handle `Tool::processKeyEvent` return value (`#1270 <https://github.com/ros2/rviz/issues/1270>`_)
* Handle `Tool::Finished` returned by `processKeyEvent` (`#1257 <https://github.com/ros2/rviz/issues/1257>`_)
* Contributors: Patrick Roncagliolo

14.2.5 (2024-07-29)
-------------------
* Added more time to copyright on Windwos (`#1252 <https://github.com/ros2/rviz/issues/1252>`_)
Expand Down
27 changes: 21 additions & 6 deletions rviz_common/include/rviz_common/message_filter_display.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

#include <tf2_ros/message_filter.h>
#include <memory>
#include <string>

#include <message_filters/subscriber.hpp>

Expand Down Expand Up @@ -207,19 +208,33 @@ class MessageFilterDisplay : public _RosTopicDisplay
auto msg = std::static_pointer_cast<const MessageType>(type_erased_msg);

++messages_received_;
rviz_common::properties::StatusProperty::Level topic_status_level =
rviz_common::properties::StatusProperty::Ok;
QString topic_str = QString::number(messages_received_) + " messages received";
// Append topic subscription frequency if we can lock rviz_ros_node_.
std::shared_ptr<ros_integration::RosNodeAbstractionIface> node_interface =
rviz_ros_node_.lock();
if (node_interface != nullptr) {
const double duration =
(node_interface->get_raw_node()->now() - subscription_start_time_).seconds();
const double subscription_frequency =
static_cast<double>(messages_received_) / duration;
topic_str += " at " + QString::number(subscription_frequency, 'f', 1) + " hz.";
try {
const double duration =
(node_interface->get_raw_node()->now() - subscription_start_time_).seconds();
const double subscription_frequency =
static_cast<double>(messages_received_) / duration;
topic_str += " at " + QString::number(subscription_frequency, 'f', 1) + " hz.";
} catch (const std::runtime_error & e) {
if (std::string(e.what()).find("can't subtract times with different time sources") !=
std::string::npos)
{
topic_status_level = rviz_common::properties::StatusProperty::Warn;
topic_str += ". ";
topic_str += e.what();
} else {
throw;
}
}
}
setStatus(
properties::StatusProperty::Ok,
topic_status_level,
"Topic",
topic_str);

Expand Down
26 changes: 20 additions & 6 deletions rviz_common/include/rviz_common/ros_topic_display.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,32 @@ class RosTopicDisplay : public _RosTopicDisplay

++messages_received_;
QString topic_str = QString::number(messages_received_) + " messages received";
rviz_common::properties::StatusProperty::Level topic_status_level =
rviz_common::properties::StatusProperty::Ok;
// Append topic subscription frequency if we can lock rviz_ros_node_.
std::shared_ptr<ros_integration::RosNodeAbstractionIface> node_interface =
rviz_ros_node_.lock();
if (node_interface != nullptr) {
const double duration =
(node_interface->get_raw_node()->now() - subscription_start_time_).seconds();
const double subscription_frequency =
static_cast<double>(messages_received_) / duration;
topic_str += " at " + QString::number(subscription_frequency, 'f', 1) + " hz.";
try {
const double duration =
(node_interface->get_raw_node()->now() - subscription_start_time_).seconds();
const double subscription_frequency =
static_cast<double>(messages_received_) / duration;
topic_str += " at " + QString::number(subscription_frequency, 'f', 1) + " hz.";
} catch (const std::runtime_error & e) {
if (std::string(e.what()).find("can't subtract times with different time sources") !=
std::string::npos)
{
topic_status_level = rviz_common::properties::StatusProperty::Warn;
topic_str += ". ";
topic_str += e.what();
} else {
throw;
}
}
}
setStatus(
properties::StatusProperty::Ok,
topic_status_level,
"Topic",
topic_str);

Expand Down
2 changes: 1 addition & 1 deletion rviz_common/include/rviz_common/tool_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class ToolManager : public QObject
QStringList getToolClasses();

/// Function to handle a key event.
void handleChar(QKeyEvent * event, RenderPanel * panel);
[[nodiscard]] int handleChar(QKeyEvent * event, RenderPanel * panel);

PluginlibFactory<Tool> * getFactory();

Expand Down
2 changes: 1 addition & 1 deletion rviz_common/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>rviz_common</name>
<version>14.2.5</version>
<version>14.3.1</version>
<description>
Common rviz API, used by rviz plugins and applications.
</description>
Expand Down
11 changes: 7 additions & 4 deletions rviz_common/src/rviz_common/tool_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ bool ToolManager::toKey(QString const & str, uint & key)
}
}

void ToolManager::handleChar(QKeyEvent * event, RenderPanel * panel)
int ToolManager::handleChar(QKeyEvent * event, RenderPanel * panel)
{
// if the incoming key is ESC fallback to the default tool
if (event->key() == Qt::Key_Escape) {
setCurrentTool(getDefaultTool());
return;
return 0;
}

// check if the incoming key triggers the activation of another tool
Expand All @@ -158,6 +158,7 @@ void ToolManager::handleChar(QKeyEvent * event, RenderPanel * panel)
tool = shortkey_to_tool_map_[event->key()];
}

int flags = 0;
if (tool) {
// if there is a incoming tool check if it matches the current tool
if (current_tool_ == tool) {
Expand All @@ -167,7 +168,7 @@ void ToolManager::handleChar(QKeyEvent * event, RenderPanel * panel)
// if no, check if the current tool accesses all key events
if (current_tool_->accessAllKeys()) {
// if yes, pass the key
current_tool_->processKeyEvent(event, panel);
flags = current_tool_->processKeyEvent(event, panel);
} else {
// if no, switch the tool
setCurrentTool(tool);
Expand All @@ -176,8 +177,10 @@ void ToolManager::handleChar(QKeyEvent * event, RenderPanel * panel)
} else {
// if the incoming key triggers no other tool,
// just hand down the key event
current_tool_->processKeyEvent(event, panel);
flags = current_tool_->processKeyEvent(event, panel);
}

return flags;
}

void ToolManager::setCurrentTool(Tool * tool)
Expand Down
11 changes: 10 additions & 1 deletion rviz_common/src/rviz_common/visualization_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,16 @@ void VisualizationManager::handleChar(QKeyEvent * event, RenderPanel * panel)
if (event->key() == Qt::Key_Escape) {
Q_EMIT escapePressed();
}
tool_manager_->handleChar(event, panel);

int flags = tool_manager_->handleChar(event, panel);

if (flags & Tool::Render) {
queueRender();
}

if (flags & Tool::Finished) {
tool_manager_->setCurrentTool(tool_manager_->getDefaultTool());
}
}

void VisualizationManager::notifyConfigChanged()
Expand Down
16 changes: 16 additions & 0 deletions rviz_default_plugins/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@
Changelog for package rviz_default_plugins
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

14.3.1 (2024-10-11)
-------------------
* Handle time source exception (`#1285 <https://github.com/ros2/rviz/issues/1285>`_)
* Contributors: Matthew Foran

14.3.0 (2024-10-03)
-------------------
* replace deprecated encodings 'yuv422' and 'yuv422_yuy2' (`#1276 <https://github.com/ros2/rviz/issues/1276>`_)
* Contributors: Christian Rauch

14.2.6 (2024-08-28)
-------------------
* Update urdf model.h deprecation (`#1266 <https://github.com/ros2/rviz/issues/1266>`_)
* Enabling manual space width for TextViewFacingMarker (`#1261 <https://github.com/ros2/rviz/issues/1261>`_)
* Contributors: Alejandro Hernández Cordero, Tom Moore

14.2.5 (2024-07-29)
-------------------
* Added more time to copyright on Windwos (`#1252 <https://github.com/ros2/rviz/issues/1252>`_)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#ifndef RVIZ_DEFAULT_PLUGINS__DISPLAYS__EFFORT__EFFORT_DISPLAY_HPP_
#define RVIZ_DEFAULT_PLUGINS__DISPLAYS__EFFORT__EFFORT_DISPLAY_HPP_

#include <urdf/model.h>

#include <deque>
#include <map>
Expand All @@ -48,6 +47,7 @@
#include <rviz_rendering/objects/effort_visual.hpp>
#include <sensor_msgs/msg/joint_state.hpp>
#include <std_msgs/msg/string.hpp>
#include <urdf/model.hpp>

#include "rviz_default_plugins/visibility_control.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#define RVIZ_DEFAULT_PLUGINS__DISPLAYS__IMAGE__IMAGE_TRANSPORT_DISPLAY_HPP_

#include <memory>
#include <string>

#include "get_transport_from_topic.hpp"
#include "image_transport/image_transport.hpp"
Expand Down Expand Up @@ -171,18 +172,32 @@ class ImageTransportDisplay : public rviz_common::_RosTopicDisplay

++messages_received_;
QString topic_str = QString::number(messages_received_) + " messages received";
rviz_common::properties::StatusProperty::Level topic_status_level =
rviz_common::properties::StatusProperty::Ok;
// Append topic subscription frequency if we can lock rviz_ros_node_.
std::shared_ptr<rviz_common::ros_integration::RosNodeAbstractionIface> node_interface =
rviz_ros_node_.lock();
if (node_interface != nullptr) {
const double duration =
(node_interface->get_raw_node()->now() - subscription_start_time_).seconds();
const double subscription_frequency =
static_cast<double>(messages_received_) / duration;
topic_str += " at " + QString::number(subscription_frequency, 'f', 1) + " hz.";
try {
const double duration =
(node_interface->get_raw_node()->now() - subscription_start_time_).seconds();
const double subscription_frequency =
static_cast<double>(messages_received_) / duration;
topic_str += " at " + QString::number(subscription_frequency, 'f', 1) + " hz.";
} catch (const std::runtime_error & e) {
if (std::string(e.what()).find("can't subtract times with different time sources") !=
std::string::npos)
{
topic_status_level = rviz_common::properties::StatusProperty::Warn;
topic_str += ". ";
topic_str += e.what();
} else {
throw;
}
}
}
setStatus(
rviz_common::properties::StatusProperty::Ok,
topic_status_level,
"Topic",
topic_str);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ class ROSImageTexture : public ROSImageTextureIface
const T * data_ptr, size_t num_elements, T & min_value, T & max_value);
template<typename T>
ImageData convertTo8bit(const uint8_t * data_ptr, size_t data_size_in_bytes);
ImageData convertYUV422ToRGBData(const uint8_t * data_ptr, size_t data_size_in_bytes);
ImageData convertYUV422_YUY2ToRGBData(const uint8_t * data_ptr, size_t data_size_in_bytes);
ImageData convertUYVYToRGBData(const uint8_t * data_ptr, size_t data_size_in_bytes);
ImageData convertYUYVToRGBData(const uint8_t * data_ptr, size_t data_size_in_bytes);

ImageData setFormatAndNormalizeDataIfNecessary(
const std::string & encoding, const uint8_t * data_ptr, size_t data_size_in_bytes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#define RVIZ_DEFAULT_PLUGINS__DISPLAYS__POINTCLOUD__POINT_CLOUD_TRANSPORT_DISPLAY_HPP_

#include <memory>
#include <string>

#include "get_transport_from_topic.hpp"
#include "point_cloud_transport/point_cloud_transport.hpp"
Expand Down Expand Up @@ -168,18 +169,32 @@ class PointCloud2TransportDisplay : public rviz_common::_RosTopicDisplay

++messages_received_;
QString topic_str = QString::number(messages_received_) + " messages received";
rviz_common::properties::StatusProperty::Level topic_status_level =
rviz_common::properties::StatusProperty::Ok;
// Append topic subscription frequency if we can lock rviz_ros_node_.
std::shared_ptr<rviz_common::ros_integration::RosNodeAbstractionIface> node_interface =
rviz_ros_node_.lock();
if (node_interface != nullptr) {
const double duration =
(node_interface->get_raw_node()->now() - subscription_start_time_).seconds();
const double subscription_frequency =
static_cast<double>(messages_received_) / duration;
topic_str += " at " + QString::number(subscription_frequency, 'f', 1) + " hz.";
try {
const double duration =
(node_interface->get_raw_node()->now() - subscription_start_time_).seconds();
const double subscription_frequency =
static_cast<double>(messages_received_) / duration;
topic_str += " at " + QString::number(subscription_frequency, 'f', 1) + " hz.";
} catch (const std::runtime_error & e) {
if (std::string(e.what()).find("can't subtract times with different time sources") !=
std::string::npos)
{
topic_status_level = rviz_common::properties::StatusProperty::Warn;
topic_str += ". ";
topic_str += e.what();
} else {
throw;
}
}
}
setStatus(
rviz_common::properties::StatusProperty::Ok,
topic_status_level,
"Topic",
topic_str);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <OgreQuaternion.h>
#include <OgreAny.h>

#include "urdf/model.h" // can be replaced later by urdf_model/types.h
#include "urdf/model.hpp" // can be replaced later by urdf_model/types.h

#include "rviz_default_plugins/robot/link_updater.hpp"
#include "rviz_default_plugins/visibility_control.hpp"
Expand Down
Loading

0 comments on commit dbc5fb3

Please sign in to comment.