Compare commits

...
18 Commits
Author SHA1 Message Date
Pablo Garrido fe9ca51823 4.0.4 2024-01-29 16:21:06 +01:00
Pablo Garrido 90410c6de0 Changelog 2024-01-29 16:20:48 +01:00
Pablo Garrido cd321caabe Fix thread include (#216)
* Fix thread include

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>

* Update CI

* Revert "Fix thread include"

This reverts commit 1427fb6246.

* fix

* Fix

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>

---------

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>
2024-01-29 16:19:46 +01:00
acuadros95 8fdc5060c7 4.0.3 2023-06-06 09:37:44 +00:00
acuadros95 3df90c089d Changelog
Signed-off-by: acuadros95 <acuadros1995@gmail.com>
2023-06-06 09:37:29 +00:00
Antonio Cuadros 0dd684b7a6 Iron release (#192)
* Iron release

Signed-off-by: acuadros95 <acuadros1995@gmail.com>

* Upgrade action-ros-ci

Signed-off-by: acuadros95 <acuadros1995@gmail.com>

---------

Signed-off-by: acuadros95 <acuadros1995@gmail.com>
2023-06-06 11:36:16 +02:00
Antonio Cuadros 964b0aec1a Add empty type key hash to GraphCache (#189)
Signed-off-by: acuadros95 <acuadros1995@gmail.com>
2023-06-06 11:11:24 +02:00
Pablo Garrido 03946126dd 4.0.2 2022-09-28 15:58:41 +02:00
Pablo Garrido 0142528a73 Changelog 2022-09-28 15:58:35 +02:00
mergify[bot]andPablo Garrido 53ff7d409d Fix Datawriter destruction (#169) (#170)
Signed-off-by: Pablo Garrido <pablogs9@gmail.com>

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>
(cherry picked from commit 4f686e8dc1)

Co-authored-by: Pablo Garrido <pablogs9@gmail.com>
2022-08-23 13:08:35 +02:00
mergify[bot]andcmraaron 9e9167b0d7 Synchronise predicate (#160) (#165)
* ensure synchronised access to our predicate

Signed-off-by: Aaron <aaron.lipinski@cm-robotics.com>

* release lock before signalling

Signed-off-by: Aaron <aaron.lipinski@cm-robotics.com>

Signed-off-by: Aaron <aaron.lipinski@cm-robotics.com>
(cherry picked from commit d4be840332)

Co-authored-by: cmraaron <102722879+cmraaron@users.noreply.github.com>
2022-08-19 09:27:21 +02:00
Pablo Garrido 93aa9e6a73 4.0.1 2022-06-13 07:45:38 +02:00
Pablo Garrido e62154a1cf Changelog
Signed-off-by: Pablo Garrido <pablogs9@gmail.com>
2022-06-13 07:45:07 +02:00
mergify[bot]andPablo Garrido 495733690c Fix memory leak in graph manager (#147) (#148)
Signed-off-by: Pablo Garrido <pablogs9@gmail.com>
(cherry picked from commit c89776e1fd)

Co-authored-by: Pablo Garrido <pablogs9@gmail.com>
2022-06-08 14:21:11 +02:00
Pablo Garrido 179ae80b94 4.0.0 2022-05-25 09:10:03 +02:00
Pablo Garrido 5ad09cec70 Update changelog 2022-05-25 09:09:56 +02:00
Pablo Garrido dfd6966cd1 Update CI (#138)
* Update CI

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>

* Fix yml

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>

* Update

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>

* Ensure fastrtps rmw

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>

* Modify approach

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>
2022-05-23 09:08:43 +02:00
mergify[bot]andAntonio Cuadros d91c98ab6e Add snap issue to README (#131) (#132)
(cherry picked from commit 0d4fcf8547)

Co-authored-by: Antonio Cuadros <49162117+Acuadros95@users.noreply.github.com>
2022-04-19 14:57:19 +02:00
6 changed files with 90 additions and 45 deletions
+28 -29
View File
@@ -3,36 +3,35 @@ name: CI micro-ROS Agent
on: on:
pull_request: pull_request:
branches: branches:
- '**' - 'iron'
schedule:
- cron: '33 6 * * *'
jobs: jobs:
microros_agent_ci: microros_agent_ci:
runs-on: ubuntu-20.04 runs-on: ${{ matrix.os }}
container: microros/base:rolling strategy:
fail-fast: false
steps: matrix:
- uses: actions/checkout@v2 os: [ ubuntu-latest ]
with: ros_distribution: [ iron ]
path: urosagent include:
- docker_image: ubuntu:jammy
- name: Download dependencies ros_distribution: iron
run: | container:
apt update image: ubuntu:jammy
cd /uros_ws steps:
. /opt/ros/$ROS_DISTRO/setup.sh - uses: actions/checkout@v3
. install/local_setup.sh - uses: ros-tooling/setup-ros@0.7.1
rosdep update --rosdistro=$ROS_DISTRO with:
ros2 run micro_ros_setup create_agent_ws.sh use-ros2-testing: false
required-ros-distributions: ${{ matrix.ros_distribution }}
- name: Patch branch - name : Download and install dependencies
run: | run: |
rm -rf /uros_ws/src/uros/micro-ROS-Agent/* apt-get install ros-${{ matrix.ros_distribution }}-micro-ros-msgs
cp -R urosagent/* /uros_ws/src/uros/micro-ROS-Agent/ apt-get install ros-${{ matrix.ros_distribution }}-rmw-fastrtps-cpp
- uses : ros-tooling/action-ros-ci@0.3.6
- name: Build with:
run: | package-name: "micro_ros_agent"
cd /uros_ws target-ros2-distro: ${{ matrix.ros_distribution }}
. /opt/ros/$ROS_DISTRO/setup.sh
. install/local_setup.sh
ros2 run micro_ros_setup build_agent.sh
+1
View File
@@ -55,3 +55,4 @@ see the file [3rd-party-licenses.txt](3rd-party-licenses.txt).
Please notice the following issues/limitations: Please notice the following issues/limitations:
* There is an unknown issue when dealing with serial ports shared with the micro-ROS agent running inside a Docker. Sometimes it works with a remarkable packet loss. * There is an unknown issue when dealing with serial ports shared with the micro-ROS agent running inside a Docker. Sometimes it works with a remarkable packet loss.
* There is an known issues with serial port communication on micro-ros-agent snap version. It is recommended to use the dockerized version or build it from source.
+29
View File
@@ -2,6 +2,35 @@
Changelog for package micro-ros_agent Changelog for package micro-ros_agent
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4.0.4 (2024-01-29)
------------------
* Fix thread include (`#216 <https://github.com/micro-ROS/micro-ROS-Agent/issues/216>`_)
* Fix thread include
* Update CI
* Revert "Fix thread include"
This reverts commit 1427fb6246c46a0b5851a017ddc886abd80d895b.
* fix
* Fix
---------
* Contributors: Pablo Garrido
4.0.3 (2023-06-06)
------------------
* Add empty type key hash to GraphCache (`#189 <https://github.com/micro-ROS/micro-ROS-Agent/issues/189>`_)
* Contributors: Antonio Cuadros
4.0.2 (2022-09-28)
------------------
* Fix Datawriter destruction (`#169 <https://github.com/micro-ROS/micro-ROS-Agent/issues/169>`_) (`#170 <https://github.com/micro-ROS/micro-ROS-Agent/issues/170>`_)
* Synchronise predicate (`#160 <https://github.com/micro-ROS/micro-ROS-Agent/issues/160>`_) (`#165 <https://github.com/micro-ROS/micro-ROS-Agent/issues/165>`_)
4.0.1 (2022-06-13)
------------------
* Fix memory leak in graph manager (`#147 <https://github.com/micro-ROS/micro-ROS-Agent/issues/147>`_) (`#148 <https://github.com/micro-ROS/micro-ROS-Agent/issues/148>`_)
4.0.0 (2022-05-25)
------------------
3.0.1 (2022-03-25) 3.0.1 (2022-03-25)
------------------ ------------------
* Add services to graph manager (`#127 <https://github.com/micro-ROS/micro-ROS-Agent/issues/127>`_) (`#129 <https://github.com/micro-ROS/micro-ROS-Agent/issues/129>`_) * Add services to graph manager (`#127 <https://github.com/micro-ROS/micro-ROS-Agent/issues/127>`_) (`#129 <https://github.com/micro-ROS/micro-ROS-Agent/issues/129>`_)
@@ -65,6 +65,7 @@
#include <string> #include <string>
#include <memory> #include <memory>
#include <map> #include <map>
#include <thread>
namespace uros { namespace uros {
namespace agent { namespace agent {
@@ -111,6 +112,12 @@ public:
const eprosima::fastdds::dds::DomainParticipant* participant, const eprosima::fastdds::dds::DomainParticipant* participant,
bool from_microros = true); bool from_microros = true);
/**
* @brief Getter for the graph cache.
* @return Reference to inner graph cache
*/
rmw_dds_common::GraphCache& get_graph_cache() { return graphCache_; }
/** /**
* @brief Adds a DDS datawriter to the graph tree. * @brief Adds a DDS datawriter to the graph tree.
* @param datawriter_guid rtps::GUID_t of the datawriter to be added. * @param datawriter_guid rtps::GUID_t of the datawriter to be added.
@@ -299,7 +306,7 @@ private:
// Store a auxiliary publishers and datawriter for each participant created in micro-ROS // Store a auxiliary publishers and datawriter for each participant created in micro-ROS
std::map< std::map<
const eprosima::fastdds::dds::DomainParticipant*, const eprosima::fastdds::dds::DomainParticipant*,
std::unique_ptr<eprosima::fastdds::dds::DataWriter> eprosima::fastdds::dds::DataWriter*
> micro_ros_graph_datawriters_; > micro_ros_graph_datawriters_;
}; };
+1 -1
View File
@@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> <?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3"> <package format="3">
<name>micro_ros_agent</name> <name>micro_ros_agent</name>
<version>3.0.1</version> <version>4.0.4</version>
<description>micro-ROS Agent package</description> <description>micro-ROS Agent package</description>
<maintainer email="pablogarrido@eprosima.com">Pablo Garrido</maintainer> <maintainer email="pablogarrido@eprosima.com">Pablo Garrido</maintainer>
<maintainer email="antoniocuadros@eprosima.com">Antonio Cuadros</maintainer> <maintainer email="antoniocuadros@eprosima.com">Antonio Cuadros</maintainer>
@@ -126,8 +126,10 @@ GraphManager::GraphManager(eprosima::fastdds::dds::DomainId_t domain_id)
// Set graph cache on change callback function // Set graph cache on change callback function
graphCache_.set_on_change_callback([this]() graphCache_.set_on_change_callback([this]()
{ {
std::unique_lock<std::mutex> lock(this->mtx_); {
this->graph_changed_ = true; std::unique_lock<std::mutex> lock(this->mtx_);
this->graph_changed_ = true;
}
this->cv_.notify_one(); this->cv_.notify_one();
}); });
@@ -144,6 +146,7 @@ inline void GraphManager::publish_microros_graph()
{ {
return this->graph_changed_; return this->graph_changed_;
}); });
graph_changed_ = false;
} }
if (display_on_change_) 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 << "Updated uros Graph: graph changed" << std::endl;
std::cout << graphCache_ << std::endl; std::cout << graphCache_ << std::endl;
} }
graph_changed_ = false;
micro_ros_msgs::msg::Graph graph_message; micro_ros_msgs::msg::Graph graph_message;
@@ -320,11 +322,10 @@ void GraphManager::add_participant(
if (it == micro_ros_graph_datawriters_.end()) if (it == micro_ros_graph_datawriters_.end())
{ {
// Create datawriter // Create datawriter
std::unique_ptr<eprosima::fastdds::dds::DataWriter> datawriter; eprosima::fastdds::dds::DataWriter * datawriter = publisher_->create_datawriter(ros_discovery_topic_.get(), datawriter_qos_);
datawriter.reset(publisher_->create_datawriter(ros_discovery_topic_.get(), datawriter_qos_));
it = micro_ros_graph_datawriters_.insert( 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<void *>(&info)); it->second->write(static_cast<void *>(&info));
@@ -344,8 +345,9 @@ void GraphManager::remove_participant(
rmw_dds_common::convert_gid_to_msg(&gid, &info.gid); rmw_dds_common::convert_gid_to_msg(&gid, &info.gid);
auto it = micro_ros_graph_datawriters_.find(participant); auto it = micro_ros_graph_datawriters_.find(participant);
it->second->write(static_cast<void *>(&info)); it->second->write(static_cast<void *>(&info));
publisher_->delete_datawriter(it->second);
micro_ros_graph_datawriters_.erase(participant);
} }
micro_ros_graph_datawriters_.erase(participant);
} }
void GraphManager::add_datawriter( void GraphManager::add_datawriter(
@@ -372,8 +374,8 @@ void GraphManager::add_datawriter(
"rmw_fastrtps_cpp", participant_guid); "rmw_fastrtps_cpp", participant_guid);
const rmw_qos_profile_t qos_profile = fastdds_qos_to_rmw_qos(writer_qos); const rmw_qos_profile_t qos_profile = fastdds_qos_to_rmw_qos(writer_qos);
graphCache_.add_entity(datawriter_gid, topic_name, graphCache_.add_entity(datawriter_gid, topic_name, type_name,
type_name, participant_gid, qos_profile, false); rosidl_get_zero_initialized_type_hash(), participant_gid, qos_profile, false);
} }
void GraphManager::remove_datawriter( void GraphManager::remove_datawriter(
@@ -409,8 +411,13 @@ void GraphManager::add_datareader(
"rmw_fastrtps_cpp", participant_guid); "rmw_fastrtps_cpp", participant_guid);
const rmw_qos_profile_t qos_profile = fastdds_qos_to_rmw_qos(reader_qos); const rmw_qos_profile_t qos_profile = fastdds_qos_to_rmw_qos(reader_qos);
graphCache_.add_entity(datareader_gid, topic_name, // TODO(acuadros95): Use typesupport to calculate type hash on micro-ROS and save and get it from reader_qos.user_data.
type_name, participant_gid, qos_profile, true); // Related PRs:
// https://github.com/ros2/rmw_dds_common/pull/70
// https://github.com/ros2/rmw_fastrtps/pull/671
// https://github.com/ros2/rmw_fastrtps/pull/680
graphCache_.add_entity(datareader_gid, topic_name, type_name,
rosidl_get_zero_initialized_type_hash(), participant_gid, qos_profile, true);
} }
void GraphManager::remove_datareader( void GraphManager::remove_datareader(
@@ -597,7 +604,7 @@ GraphManager::ParticipantListener::ParticipantListener(
} }
void GraphManager::ParticipantListener::on_participant_discovery( void GraphManager::ParticipantListener::on_participant_discovery(
eprosima::fastdds::dds::DomainParticipant* participant, eprosima::fastdds::dds::DomainParticipant* /* participant */,
eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info)
{ {
switch (info.status) switch (info.status)
@@ -614,13 +621,15 @@ void GraphManager::ParticipantListener::on_participant_discovery(
const std::string enclave = const std::string enclave =
std::string(name_found->second.begin(), name_found->second.end()); std::string(name_found->second.begin(), name_found->second.end());
graphManager_from_->add_participant(participant, false, enclave); const rmw_gid_t gid = rmw_fastrtps_shared_cpp::create_rmw_gid("rmw_fastrtps_cpp", info.info.m_guid);
graphManager_from_->get_graph_cache().add_participant(gid, enclave);
break; break;
} }
case eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::REMOVED_PARTICIPANT: case eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::REMOVED_PARTICIPANT:
case eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DROPPED_PARTICIPANT: case eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DROPPED_PARTICIPANT:
{ {
graphManager_from_->remove_participant(participant, false); const rmw_gid_t gid = rmw_fastrtps_shared_cpp::create_rmw_gid("rmw_fastrtps_cpp", info.info.m_guid);
graphManager_from_->get_graph_cache().remove_participant(gid);
break; break;
} }
default: default: