diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b9b07a..21fbfe2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,8 +22,8 @@ jobs: container: image: ubuntu:jammy steps: - - uses: actions/checkout@v2 - - uses: ros-tooling/setup-ros@0.3.2 + - uses: actions/checkout@v4 + - uses: ros-tooling/setup-ros@0.7.13 with: use-ros2-testing: false required-ros-distributions: ${{ matrix.ros_distribution }} @@ -31,7 +31,7 @@ jobs: run: | apt-get install ros-${{ matrix.ros_distribution }}-micro-ros-msgs apt-get install ros-${{ matrix.ros_distribution }}-rmw-fastrtps-cpp - - uses : ros-tooling/action-ros-ci@0.2.5 + - uses : ros-tooling/action-ros-ci@0.4.3 with: package-name: "micro_ros_agent" target-ros2-distro: ${{ matrix.ros_distribution }} diff --git a/micro_ros_agent/CHANGELOG.rst b/micro_ros_agent/CHANGELOG.rst index 96b098a..05f301d 100644 --- a/micro_ros_agent/CHANGELOG.rst +++ b/micro_ros_agent/CHANGELOG.rst @@ -2,6 +2,18 @@ Changelog for package micro-ros_agent ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3.0.6 (2024-01-29) +------------------ +* Fix thread include (backport `#216 `_) (`#217 `_) + +3.0.5 (2023-06-06) +------------------ + +3.0.4 (2022-09-28) +------------------ +* Fix Datawriter destruction (`#169 `_) +* Synchronise predicate (`#160 `_) + 3.0.3 (2022-06-13) ------------------ * Fix memory leak in graph manager (`#147 `_) diff --git a/micro_ros_agent/cmake/SuperBuild.cmake b/micro_ros_agent/cmake/SuperBuild.cmake index bead827..46f4ed2 100644 --- a/micro_ros_agent/cmake/SuperBuild.cmake +++ b/micro_ros_agent/cmake/SuperBuild.cmake @@ -26,7 +26,7 @@ if(NOT xrceagent_FOUND) GIT_REPOSITORY https://github.com/eProsima/Micro-XRCE-DDS-Agent.git GIT_TAG - ros2 + v2.4.2 PREFIX ${PROJECT_BINARY_DIR}/agent INSTALL_DIR diff --git a/micro_ros_agent/include/agent/graph_manager/graph_manager.hpp b/micro_ros_agent/include/agent/graph_manager/graph_manager.hpp index c113a96..d9cf095 100644 --- a/micro_ros_agent/include/agent/graph_manager/graph_manager.hpp +++ b/micro_ros_agent/include/agent/graph_manager/graph_manager.hpp @@ -65,6 +65,7 @@ #include #include #include +#include namespace uros { namespace agent { @@ -305,7 +306,7 @@ class GraphManager // Store a auxiliary publishers and datawriter for each participant created in micro-ROS std::map< const eprosima::fastdds::dds::DomainParticipant*, - std::unique_ptr + eprosima::fastdds::dds::DataWriter* > micro_ros_graph_datawriters_; }; diff --git a/micro_ros_agent/package.xml b/micro_ros_agent/package.xml index 7b70937..23d6ec4 100644 --- a/micro_ros_agent/package.xml +++ b/micro_ros_agent/package.xml @@ -2,10 +2,10 @@ micro_ros_agent - 3.0.3 + 3.0.6 micro-ROS Agent package - Pablo Garrido - Antonio Cuadros + Eugenio Collado + Carlos Espinoza Apache License 2.0 ament_cmake diff --git a/micro_ros_agent/src/agent/graph_manager/graph_manager.cpp b/micro_ros_agent/src/agent/graph_manager/graph_manager.cpp index 69b8f93..5c9e9df 100644 --- a/micro_ros_agent/src/agent/graph_manager/graph_manager.cpp +++ b/micro_ros_agent/src/agent/graph_manager/graph_manager.cpp @@ -126,8 +126,10 @@ GraphManager::GraphManager(eprosima::fastdds::dds::DomainId_t domain_id) // Set graph cache on change callback function graphCache_.set_on_change_callback([this]() { - std::unique_lock lock(this->mtx_); - this->graph_changed_ = true; + { + std::unique_lock lock(this->mtx_); + this->graph_changed_ = true; + } this->cv_.notify_one(); }); @@ -144,6 +146,7 @@ inline void GraphManager::publish_microros_graph() { return this->graph_changed_; }); + graph_changed_ = false; } if (display_on_change_) @@ -151,7 +154,6 @@ inline void GraphManager::publish_microros_graph() std::cout << "Updated uros Graph: graph changed" << std::endl; std::cout << graphCache_ << std::endl; } - graph_changed_ = false; micro_ros_msgs::msg::Graph graph_message; @@ -320,11 +322,10 @@ void GraphManager::add_participant( if (it == micro_ros_graph_datawriters_.end()) { // Create datawriter - std::unique_ptr datawriter; - datawriter.reset(publisher_->create_datawriter(ros_discovery_topic_.get(), datawriter_qos_)); + eprosima::fastdds::dds::DataWriter * datawriter = publisher_->create_datawriter(ros_discovery_topic_.get(), datawriter_qos_); it = micro_ros_graph_datawriters_.insert( - std::make_pair(participant, std::move(datawriter))).first; + std::make_pair(participant, datawriter)).first; } it->second->write(static_cast(&info)); @@ -344,8 +345,9 @@ void GraphManager::remove_participant( rmw_dds_common::convert_gid_to_msg(&gid, &info.gid); auto it = micro_ros_graph_datawriters_.find(participant); it->second->write(static_cast(&info)); + publisher_->delete_datawriter(it->second); + micro_ros_graph_datawriters_.erase(participant); } - micro_ros_graph_datawriters_.erase(participant); } void GraphManager::add_datawriter(