mirror of
https://github.com/micro-ROS/micro-ROS-Agent.git
synced 2026-09-06 18:05:17 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2d5e6699e | ||
|
|
5c23d99726 | ||
|
|
2857b2e620 | ||
|
|
cb0e5e4ec9 | ||
|
|
096d54a5e9 | ||
|
|
70f9cf7ddb | ||
|
|
ccc177d276 | ||
|
|
648081f77f | ||
|
|
b317a906dc | ||
|
|
200f750a76 | ||
|
|
4dd8ffe63b | ||
|
|
375bf3e674 | ||
|
|
1325442eb5 | ||
|
|
b17a6ef959 | ||
|
|
fd5d6adc00 | ||
|
|
1904c562ef | ||
|
|
726692af04 | ||
|
|
2326a201bc | ||
|
|
5b566f7b4f | ||
|
|
0af992145e | ||
|
|
f9e6daf6bf | ||
|
|
e356e14e84 | ||
|
|
37885214e1 | ||
|
|
820bcdb5f6 | ||
|
|
fd5bc39536 | ||
|
|
fe1b3ade97 | ||
|
|
7f3f560bc7 | ||
|
|
80916d4949 | ||
|
|
d1e851ba4e | ||
|
|
6047f7135d | ||
|
|
9d3fbc63a0 |
+11
-10
@@ -3,27 +3,27 @@ name: CI micro-ROS Agent
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- 'rolling'
|
- 'foxy'
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '33 6 * * *'
|
- cron: '33 6 * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
microros_agent_ci:
|
microros_agent_ci:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-20.04
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-20.04 ]
|
||||||
ros_distribution: [ rolling ]
|
ros_distribution: [ foxy ]
|
||||||
include:
|
include:
|
||||||
- docker_image: ubuntu:24.04
|
- docker_image: ubuntu:20.04
|
||||||
ros_distribution: rolling
|
ros_distribution: foxy
|
||||||
container:
|
container:
|
||||||
image: ${{ matrix.docker_image }}
|
image: ubuntu:20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v2
|
||||||
- uses: ros-tooling/setup-ros@0.7.13
|
- uses: ros-tooling/setup-ros@0.3.2
|
||||||
with:
|
with:
|
||||||
use-ros2-testing: false
|
use-ros2-testing: false
|
||||||
required-ros-distributions: ${{ matrix.ros_distribution }}
|
required-ros-distributions: ${{ matrix.ros_distribution }}
|
||||||
@@ -31,7 +31,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
apt-get install ros-${{ matrix.ros_distribution }}-micro-ros-msgs
|
apt-get install ros-${{ matrix.ros_distribution }}-micro-ros-msgs
|
||||||
apt-get install ros-${{ matrix.ros_distribution }}-rmw-fastrtps-cpp
|
apt-get install ros-${{ matrix.ros_distribution }}-rmw-fastrtps-cpp
|
||||||
- uses : ros-tooling/action-ros-ci@0.4.3
|
- uses : ros-tooling/action-ros-ci@0.2.5
|
||||||
with:
|
with:
|
||||||
package-name: "micro_ros_agent"
|
package-name: "micro_ros_agent"
|
||||||
target-ros2-distro: ${{ matrix.ros_distribution }}
|
target-ros2-distro: ${{ matrix.ros_distribution }}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
name: snap
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
branches:
|
||||||
|
- foxy
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- foxy
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
snap-file: ${{ steps.build-snap.outputs.snap }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: snapcore/action-build@v1
|
||||||
|
id: build-snap
|
||||||
|
with:
|
||||||
|
snapcraft-args: '--enable-experimental-extensions'
|
||||||
|
|
||||||
|
# Make sure the snap is installable
|
||||||
|
- run: |
|
||||||
|
sudo snap install --dangerous ${{ steps.build-snap.outputs.snap }}
|
||||||
|
|
||||||
|
# @todo Do some testing with the snap
|
||||||
|
- run: |
|
||||||
|
micro-ros-agent udp4
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: micro-ros-agent-snap
|
||||||
|
path: ${{ steps.build-snap.outputs.snap }}
|
||||||
|
|
||||||
|
publish:
|
||||||
|
if: github.ref == 'refs/heads/foxy' || startsWith(github.ref, 'refs/tags/')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: micro-ros-agent-snap
|
||||||
|
path: .
|
||||||
|
- uses: snapcore/action-publish@v1
|
||||||
|
with:
|
||||||
|
store_login: ${{ secrets.STORE_LOGIN }}
|
||||||
|
snap: ${{needs.build.outputs.snap-file}}
|
||||||
|
release: ${{ startsWith(github.ref, 'refs/tags/') && 'candidate' || 'edge'}}
|
||||||
@@ -55,4 +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.
|
|
||||||
|
|||||||
@@ -2,44 +2,28 @@
|
|||||||
Changelog for package micro-ros_agent
|
Changelog for package micro-ros_agent
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
6.0.0 (2024-05-31)
|
1.5.4 (2022-09-28)
|
||||||
------------------
|
------------------
|
||||||
* Bump Micro XRCE-DDS Agent (`#226 <https://github.com/micro-ROS/micro-ROS-Agent/issues/226>`_)
|
* Fix Datawriter destruction (`#169 <https://github.com/micro-ROS/micro-ROS-Agent/issues/169>`_) (`#171 <https://github.com/micro-ROS/micro-ROS-Agent/issues/171>`_)
|
||||||
|
* Synchronise predicate (`#160 <https://github.com/micro-ROS/micro-ROS-Agent/issues/160>`_) (`#167 <https://github.com/micro-ROS/micro-ROS-Agent/issues/167>`_)
|
||||||
|
|
||||||
5.0.1 (2024-01-29)
|
1.5.3 (2022-06-13)
|
||||||
------------------
|
------------------
|
||||||
* Fix thread include (`#216 <https://github.com/micro-ROS/micro-ROS-Agent/issues/216>`_) (`#218 <https://github.com/micro-ROS/micro-ROS-Agent/issues/218>`_)
|
* Fix memory leak in graph manager (`#147 <https://github.com/micro-ROS/micro-ROS-Agent/issues/147>`_) (`#149 <https://github.com/micro-ROS/micro-ROS-Agent/issues/149>`_)
|
||||||
|
|
||||||
5.0.0 (2023-06-06)
|
1.5.2 (2022-05-25)
|
||||||
------------------
|
|
||||||
* 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)
|
1.5.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 (backport `#127 <https://github.com/micro-ROS/micro-ROS-Agent/issues/127>`_) (`#128 <https://github.com/micro-ROS/micro-ROS-Agent/issues/128>`_)
|
||||||
* Add used missing includes (`#116 <https://github.com/micro-ROS/micro-ROS-Agent/issues/116>`_) (`#124 <https://github.com/micro-ROS/micro-ROS-Agent/issues/124>`_)
|
* Add used missing includes (`#116 <https://github.com/micro-ROS/micro-ROS-Agent/issues/116>`_)
|
||||||
* Add system logger flag (`#118 <https://github.com/micro-ROS/micro-ROS-Agent/issues/118>`_) (`#119 <https://github.com/micro-ROS/micro-ROS-Agent/issues/119>`_)
|
* Add system logger flag (`#118 <https://github.com/micro-ROS/micro-ROS-Agent/issues/118>`_) (`#120 <https://github.com/micro-ROS/micro-ROS-Agent/issues/120>`_)
|
||||||
* Add condition variable include (`#113 <https://github.com/micro-ROS/micro-ROS-Agent/issues/113>`_) (`#114 <https://github.com/micro-ROS/micro-ROS-Agent/issues/114>`_)
|
* Add condition variable include (`#113 <https://github.com/micro-ROS/micro-ROS-Agent/issues/113>`_) (`#115 <https://github.com/micro-ROS/micro-ROS-Agent/issues/115>`_)
|
||||||
* pass system name to xrceagent (`#110 <https://github.com/micro-ROS/micro-ROS-Agent/issues/110>`_) (`#112 <https://github.com/micro-ROS/micro-ROS-Agent/issues/112>`_)
|
* pass system name to xrceagent (`#110 <https://github.com/micro-ROS/micro-ROS-Agent/issues/110>`_) (`#111 <https://github.com/micro-ROS/micro-ROS-Agent/issues/111>`_)
|
||||||
* Fix memory leak in FastDDS datawriter (`#107 <https://github.com/micro-ROS/micro-ROS-Agent/issues/107>`_) (`#109 <https://github.com/micro-ROS/micro-ROS-Agent/issues/109>`_)
|
* Fix memory leak in FastDDS datawriter (`#107 <https://github.com/micro-ROS/micro-ROS-Agent/issues/107>`_) (`#108 <https://github.com/micro-ROS/micro-ROS-Agent/issues/108>`_)
|
||||||
|
|
||||||
3.0.0 (2021-09-13)
|
1.5.0 (2021-09-13)
|
||||||
------------------
|
|
||||||
|
|
||||||
1.0.1 (2021-09-13)
|
|
||||||
------------------
|
------------------
|
||||||
* Remove XRCE dependency and add superbuild (`#97 <https://github.com/micro-ROS/micro-ROS-Agent/issues/97>`_)
|
* Remove XRCE dependency and add superbuild (`#97 <https://github.com/micro-ROS/micro-ROS-Agent/issues/97>`_)
|
||||||
* Fixed launch file by using a list for arguments. Ensures order of items is kept. (`#93 <https://github.com/micro-ROS/micro-ROS-Agent/issues/93>`_) (`#94 <https://github.com/micro-ROS/micro-ROS-Agent/issues/94>`_)
|
* Fixed launch file by using a list for arguments. Ensures order of items is kept. (`#93 <https://github.com/micro-ROS/micro-ROS-Agent/issues/93>`_) (`#94 <https://github.com/micro-ROS/micro-ROS-Agent/issues/94>`_)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.11)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
option(UROSAGENT_GENERATE_PROFILE
|
option(UROSAGENT_GENERATE_PROFILE
|
||||||
"Generates agent.refs according to the .msgs provided in the .repos" OFF
|
"Generates agent.refs according to the .msgs provided in the .repos" OFF
|
||||||
@@ -34,7 +34,8 @@ find_package(ament_cmake REQUIRED)
|
|||||||
find_package(microxrcedds_agent REQUIRED)
|
find_package(microxrcedds_agent REQUIRED)
|
||||||
find_package(rosidl_cmake REQUIRED)
|
find_package(rosidl_cmake REQUIRED)
|
||||||
find_package(fastcdr REQUIRED)
|
find_package(fastcdr REQUIRED)
|
||||||
find_package(fastdds REQUIRED)
|
find_package(fastrtps REQUIRED)
|
||||||
|
find_package(fastrtps_cmake_module REQUIRED)
|
||||||
find_package(rmw_dds_common REQUIRED)
|
find_package(rmw_dds_common REQUIRED)
|
||||||
find_package(rmw REQUIRED)
|
find_package(rmw REQUIRED)
|
||||||
find_package(rcutils REQUIRED)
|
find_package(rcutils REQUIRED)
|
||||||
@@ -62,21 +63,22 @@ target_include_directories(${PROJECT_NAME}
|
|||||||
include
|
include
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME}
|
ament_target_dependencies(${PROJECT_NAME}
|
||||||
${micro_ros_msgs_TARGETS}
|
rosidl_typesupport_fastrtps_cpp
|
||||||
${rmw_dds_common_TARGETS}
|
rosidl_runtime_cpp
|
||||||
rmw::rmw
|
rosidl_typesupport_cpp
|
||||||
rmw_dds_common::rmw_dds_common_library
|
fastcdr
|
||||||
rmw_fastrtps_shared_cpp::rmw_fastrtps_shared_cpp
|
fastrtps
|
||||||
rosidl_runtime_cpp::rosidl_runtime_cpp
|
rmw_dds_common
|
||||||
rosidl_typesupport_cpp::rosidl_typesupport_cpp
|
rmw
|
||||||
rosidl_typesupport_fastrtps_cpp::rosidl_typesupport_fastrtps_cpp
|
rmw_fastrtps_shared_cpp
|
||||||
|
micro_ros_msgs
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME}
|
target_link_libraries(${PROJECT_NAME}
|
||||||
microxrcedds_agent
|
microxrcedds_agent
|
||||||
fastcdr
|
fastcdr
|
||||||
fastdds
|
fastrtps
|
||||||
$<$<BOOL:$<PLATFORM_ID:Linux>>:rt>
|
$<$<BOOL:$<PLATFORM_ID:Linux>>:rt>
|
||||||
$<$<BOOL:$<PLATFORM_ID:Linux>>:dl>
|
$<$<BOOL:$<PLATFORM_ID:Linux>>:dl>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -19,14 +19,14 @@ unset(_deps)
|
|||||||
enable_language(C)
|
enable_language(C)
|
||||||
enable_language(CXX)
|
enable_language(CXX)
|
||||||
|
|
||||||
unset(microxrcedds_agent_DIR CACHE)
|
unset(xrceagent_DIR CACHE)
|
||||||
find_package(microxrcedds_agent 3.0.2 QUIET)
|
find_package(xrceagent 2 EXACT QUIET)
|
||||||
if(NOT microxrcedds_agent_FOUND)
|
if(NOT xrceagent_FOUND)
|
||||||
ExternalProject_Add(microxrcedds_agent
|
ExternalProject_Add(xrceagent
|
||||||
GIT_REPOSITORY
|
GIT_REPOSITORY
|
||||||
https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
|
https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
|
||||||
GIT_TAG
|
GIT_TAG
|
||||||
v3.0.2
|
ros2
|
||||||
PREFIX
|
PREFIX
|
||||||
${PROJECT_BINARY_DIR}/agent
|
${PROJECT_BINARY_DIR}/agent
|
||||||
INSTALL_DIR
|
INSTALL_DIR
|
||||||
@@ -51,7 +51,6 @@ if(NOT microxrcedds_agent_FOUND)
|
|||||||
-DUAGENT_BUILD_EXECUTABLE:BOOL=OFF
|
-DUAGENT_BUILD_EXECUTABLE:BOOL=OFF
|
||||||
-DUAGENT_ISOLATED_INSTALL:BOOL=OFF
|
-DUAGENT_ISOLATED_INSTALL:BOOL=OFF
|
||||||
)
|
)
|
||||||
list(APPEND _deps microxrcedds_agent)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Main project.
|
# Main project.
|
||||||
@@ -65,5 +64,5 @@ ExternalProject_Add(micro_ros_agent
|
|||||||
INSTALL_COMMAND
|
INSTALL_COMMAND
|
||||||
""
|
""
|
||||||
DEPENDS
|
DEPENDS
|
||||||
${_deps}
|
xrceagent
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -15,25 +15,28 @@
|
|||||||
#ifndef _UROS_AGENT_GRAPH_MANAGER_HPP
|
#ifndef _UROS_AGENT_GRAPH_MANAGER_HPP
|
||||||
#define _UROS_AGENT_GRAPH_MANAGER_HPP
|
#define _UROS_AGENT_GRAPH_MANAGER_HPP
|
||||||
|
|
||||||
#include "fastdds/dds/topic/TopicDataType.hpp"
|
#include "fastrtps/Domain.h"
|
||||||
#include "fastdds/rtps/attributes/RTPSParticipantAttributes.hpp"
|
#include <fastrtps/TopicDataType.h>
|
||||||
#include "fastdds/rtps/participant/RTPSParticipant.hpp"
|
#include "fastrtps/attributes/ParticipantAttributes.h"
|
||||||
#include "fastdds/rtps/participant/RTPSParticipantListener.hpp"
|
#include "fastrtps/participant/Participant.h"
|
||||||
#include "fastdds/rtps/RTPSDomain.hpp"
|
#include "fastrtps/participant/ParticipantListener.h"
|
||||||
|
#include "fastrtps/attributes/PublisherAttributes.h"
|
||||||
|
#include "fastrtps/publisher/Publisher.h"
|
||||||
|
#include <fastrtps/publisher/PublisherListener.h>
|
||||||
|
#include <fastrtps/rtps/common/MatchingInfo.h>
|
||||||
|
|
||||||
#include <fastdds/dds/domain/DomainParticipant.hpp>
|
#include <fastdds/dds/domain/DomainParticipant.hpp>
|
||||||
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
|
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
|
||||||
#include <fastdds/dds/domain/DomainParticipantListener.hpp>
|
#include <fastdds/dds/domain/DomainParticipantListener.hpp>
|
||||||
#include <fastdds/dds/domain/qos/DomainParticipantQos.hpp>
|
#include <fastdds/dds/domain/qos/DomainParticipantQos.hpp>
|
||||||
#include <fastdds/dds/publisher/DataWriter.hpp>
|
#include <fastdds/dds/publisher/DataWriter.hpp>
|
||||||
#include <fastdds/dds/publisher/Publisher.hpp>
|
|
||||||
#include <fastdds/dds/publisher/PublisherListener.hpp>
|
|
||||||
#include <fastdds/dds/publisher/qos/DataWriterQos.hpp>
|
#include <fastdds/dds/publisher/qos/DataWriterQos.hpp>
|
||||||
|
#include <fastdds/dds/publisher/Publisher.hpp>
|
||||||
#include <fastdds/dds/subscriber/DataReader.hpp>
|
#include <fastdds/dds/subscriber/DataReader.hpp>
|
||||||
#include <fastdds/dds/subscriber/DataReaderListener.hpp>
|
|
||||||
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
|
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
|
||||||
#include <fastdds/dds/subscriber/SampleInfo.hpp>
|
#include <fastdds/dds/subscriber/SampleInfo.hpp>
|
||||||
#include <fastdds/dds/subscriber/Subscriber.hpp>
|
#include <fastdds/dds/subscriber/Subscriber.hpp>
|
||||||
#include <fastdds/rtps/common/MatchingInfo.hpp>
|
#include <fastdds/dds/subscriber/DataReaderListener.hpp>
|
||||||
|
|
||||||
#include "rmw/types.h"
|
#include "rmw/types.h"
|
||||||
#include "rmw/names_and_types.h"
|
#include "rmw/names_and_types.h"
|
||||||
@@ -62,7 +65,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <thread>
|
|
||||||
|
|
||||||
namespace uros {
|
namespace uros {
|
||||||
namespace agent {
|
namespace agent {
|
||||||
@@ -122,7 +124,7 @@ public:
|
|||||||
* @param datawriter Pointer to the datawriter to be added.
|
* @param datawriter Pointer to the datawriter to be added.
|
||||||
*/
|
*/
|
||||||
void add_datawriter(
|
void add_datawriter(
|
||||||
const eprosima::fastdds::rtps::GUID_t& datawriter_guid,
|
const eprosima::fastrtps::rtps::GUID_t& datawriter_guid,
|
||||||
const eprosima::fastdds::dds::DomainParticipant* participant,
|
const eprosima::fastdds::dds::DomainParticipant* participant,
|
||||||
const eprosima::fastdds::dds::DataWriter* datawriter);
|
const eprosima::fastdds::dds::DataWriter* datawriter);
|
||||||
|
|
||||||
@@ -135,18 +137,33 @@ public:
|
|||||||
* @param writer_qos QOS of the datawriter to be included into the graph tree.
|
* @param writer_qos QOS of the datawriter to be included into the graph tree.
|
||||||
*/
|
*/
|
||||||
void add_datawriter(
|
void add_datawriter(
|
||||||
const eprosima::fastdds::rtps::GUID_t& datawriter_guid,
|
const eprosima::fastrtps::rtps::GUID_t& datawriter_guid,
|
||||||
const std::string& topic_name,
|
const std::string& topic_name,
|
||||||
const std::string& type_name,
|
const std::string& type_name,
|
||||||
const eprosima::fastdds::rtps::GUID_t& participant_guid,
|
const eprosima::fastrtps::rtps::GUID_t& participant_guid,
|
||||||
const eprosima::fastdds::dds::DataWriterQos& writer_qos);
|
const eprosima::fastdds::dds::DataWriterQos& writer_qos);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a DDS datawriter to the graph tree.
|
||||||
|
* @param datawriter_guid rtps::GUID_t of the datawriter to be added.
|
||||||
|
* @param topic_name Name of the topic to which the datawriter sends information to.
|
||||||
|
* @param type_name Type name of the sent topic.
|
||||||
|
* @param participant_guid rtps::GUID_t of the participant which owns this datawriter.
|
||||||
|
* @param writer_qos QOS of the datawriter to be included into the graph tree.
|
||||||
|
*/
|
||||||
|
void add_datawriter(
|
||||||
|
const eprosima::fastrtps::rtps::GUID_t& datawriter_guid,
|
||||||
|
const std::string& topic_name,
|
||||||
|
const std::string& type_name,
|
||||||
|
const eprosima::fastrtps::rtps::GUID_t& participant_guid,
|
||||||
|
const eprosima::fastdds::dds::WriterQos& writer_qos);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Removes a DDS datawriter from the graph tree.
|
* @brief Removes a DDS datawriter from the graph tree.
|
||||||
* @param datawriter_guid rtps::GUID_t of the datawriter to be removed.
|
* @param datawriter_guid rtps::GUID_t of the datawriter to be removed.
|
||||||
*/
|
*/
|
||||||
void remove_datawriter(
|
void remove_datawriter(
|
||||||
const eprosima::fastdds::rtps::GUID_t& datawriter_guid);
|
const eprosima::fastrtps::rtps::GUID_t& datawriter_guid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Adds a DDS datareader to the graph tree.
|
* @brief Adds a DDS datareader to the graph tree.
|
||||||
@@ -155,7 +172,7 @@ public:
|
|||||||
* @param datareader Pointer to the datareader to be added.
|
* @param datareader Pointer to the datareader to be added.
|
||||||
*/
|
*/
|
||||||
void add_datareader(
|
void add_datareader(
|
||||||
const eprosima::fastdds::rtps::GUID_t& datareader_guid,
|
const eprosima::fastrtps::rtps::GUID_t& datareader_guid,
|
||||||
const eprosima::fastdds::dds::DomainParticipant* participant,
|
const eprosima::fastdds::dds::DomainParticipant* participant,
|
||||||
const eprosima::fastdds::dds::DataReader* datareader);
|
const eprosima::fastdds::dds::DataReader* datareader);
|
||||||
|
|
||||||
@@ -165,21 +182,36 @@ public:
|
|||||||
* @param topic_name Name of the topic to which the datareader sends information to.
|
* @param topic_name Name of the topic to which the datareader sends information to.
|
||||||
* @param type_name Type name of the sent topic.
|
* @param type_name Type name of the sent topic.
|
||||||
* @param participant_guid rtps::GUID_t of the participant which owns this datareader.
|
* @param participant_guid rtps::GUID_t of the participant which owns this datareader.
|
||||||
* @param reader_qos QOS of the datareader to be included into the graph tree.
|
* @param writer_qos QOS of the datareader to be included into the graph tree.
|
||||||
*/
|
*/
|
||||||
void add_datareader(
|
void add_datareader(
|
||||||
const eprosima::fastdds::rtps::GUID_t& datareader_guid,
|
const eprosima::fastrtps::rtps::GUID_t& datareader_guid,
|
||||||
const std::string& topic_name,
|
const std::string& topic_name,
|
||||||
const std::string& type_name,
|
const std::string& type_name,
|
||||||
const eprosima::fastdds::rtps::GUID_t& participant_guid,
|
const eprosima::fastrtps::rtps::GUID_t& participant_guid,
|
||||||
const eprosima::fastdds::dds::DataReaderQos& reader_qos);
|
const eprosima::fastdds::dds::DataReaderQos& reader_qos);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a DDS datareader to the graph tree.
|
||||||
|
* @param datareader_guid rtps::GUID_t of the datareader to be added.
|
||||||
|
* @param topic_name Name of the topic to which the datareader sends information to.
|
||||||
|
* @param type_name Type name of the sent topic.
|
||||||
|
* @param participant_guid rtps::GUID_t of the participant which owns this datareader.
|
||||||
|
* @param writer_qos QOS of the datareader to be included into the graph tree.
|
||||||
|
*/
|
||||||
|
void add_datareader(
|
||||||
|
const eprosima::fastrtps::rtps::GUID_t& datareader_guid,
|
||||||
|
const std::string& topic_name,
|
||||||
|
const std::string& type_name,
|
||||||
|
const eprosima::fastrtps::rtps::GUID_t& participant_guid,
|
||||||
|
const eprosima::fastdds::dds::ReaderQos& reader_qos);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Removes a DDS datareader from the graph tree.
|
* @brief Removes a DDS datareader from the graph tree.
|
||||||
* @param datareader_guid rtps::GUID_t of the datareader to be removed.
|
* @param datareader_guid rtps::GUID_t of the datareader to be removed.
|
||||||
*/
|
*/
|
||||||
void remove_datareader(
|
void remove_datareader(
|
||||||
const eprosima::fastdds::rtps::GUID_t& datareader_guid);
|
const eprosima::fastrtps::rtps::GUID_t& datareader_guid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Associates a certain DDS entity with a provided participant.
|
* @brief Associates a certain DDS entity with a provided participant.
|
||||||
@@ -188,7 +220,7 @@ public:
|
|||||||
* @param entity_kind Kind of the DDS entity.
|
* @param entity_kind Kind of the DDS entity.
|
||||||
*/
|
*/
|
||||||
void associate_entity(
|
void associate_entity(
|
||||||
const eprosima::fastdds::rtps::GUID_t& entity_guid,
|
const eprosima::fastrtps::rtps::GUID_t& entity_guid,
|
||||||
const eprosima::fastdds::dds::DomainParticipant* participant,
|
const eprosima::fastdds::dds::DomainParticipant* participant,
|
||||||
const dds::xrce::ObjectKind& entity_kind);
|
const dds::xrce::ObjectKind& entity_kind);
|
||||||
|
|
||||||
@@ -209,28 +241,21 @@ private:
|
|||||||
GraphManager* graph_manager);
|
GraphManager* graph_manager);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
template <typename DiscoveryStatus, typename Info>
|
template <typename Info>
|
||||||
void process_discovery_info(
|
void process_discovery_info(
|
||||||
DiscoveryStatus reason,
|
|
||||||
const Info& proxyData);
|
const Info& proxyData);
|
||||||
|
|
||||||
void on_participant_discovery(
|
void on_participant_discovery(
|
||||||
eprosima::fastdds::dds::DomainParticipant* participant,
|
eprosima::fastdds::dds::DomainParticipant* participant,
|
||||||
eprosima::fastdds::rtps::ParticipantDiscoveryStatus reason,
|
eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) override;
|
||||||
const eprosima::fastdds::dds::ParticipantBuiltinTopicData& info,
|
|
||||||
bool& should_be_ignored) override;
|
|
||||||
|
|
||||||
void on_data_reader_discovery(
|
void on_subscriber_discovery(
|
||||||
eprosima::fastdds::dds::DomainParticipant* participant,
|
eprosima::fastdds::dds::DomainParticipant* /*participant*/,
|
||||||
eprosima::fastdds::rtps::ReaderDiscoveryStatus reason,
|
eprosima::fastrtps::rtps::ReaderDiscoveryInfo&& info) override;
|
||||||
const eprosima::fastdds::dds::SubscriptionBuiltinTopicData& info,
|
|
||||||
bool& should_be_ignored) override;
|
|
||||||
|
|
||||||
void on_data_writer_discovery(
|
void on_publisher_discovery(
|
||||||
eprosima::fastdds::dds::DomainParticipant* participant,
|
eprosima::fastdds::dds::DomainParticipant* /*participant*/,
|
||||||
eprosima::fastdds::rtps::WriterDiscoveryStatus reason,
|
eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info) override;
|
||||||
const eprosima::fastdds::dds::PublicationBuiltinTopicData& info,
|
|
||||||
bool& should_be_ignored) override;
|
|
||||||
|
|
||||||
GraphManager* graphManager_from_;
|
GraphManager* graphManager_from_;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,16 +15,18 @@
|
|||||||
#ifndef UROS_AGENT_GRAPH_PARTICIPANTS_TYPESUPPORT_HPP_
|
#ifndef UROS_AGENT_GRAPH_PARTICIPANTS_TYPESUPPORT_HPP_
|
||||||
#define UROS_AGENT_GRAPH_PARTICIPANTS_TYPESUPPORT_HPP_
|
#define UROS_AGENT_GRAPH_PARTICIPANTS_TYPESUPPORT_HPP_
|
||||||
|
|
||||||
#include "fastdds/dds/publisher/Publisher.hpp"
|
#include "fastrtps/Domain.h"
|
||||||
#include "fastdds/dds/topic/TopicDataType.hpp"
|
#include <fastrtps/TopicDataType.h>
|
||||||
#include "fastdds/rtps/attributes/RTPSParticipantAttributes.hpp"
|
#include "fastrtps/attributes/ParticipantAttributes.h"
|
||||||
#include "fastdds/rtps/participant/RTPSParticipant.hpp"
|
#include "fastrtps/participant/Participant.h"
|
||||||
#include "fastdds/rtps/participant/RTPSParticipantListener.hpp"
|
#include "fastrtps/participant/ParticipantListener.h"
|
||||||
#include "fastdds/rtps/RTPSDomain.hpp"
|
#include "fastrtps/attributes/PublisherAttributes.h"
|
||||||
|
#include "fastrtps/publisher/Publisher.h"
|
||||||
|
#include <fastrtps/publisher/PublisherListener.h>
|
||||||
|
#include <fastrtps/rtps/common/MatchingInfo.h>
|
||||||
|
|
||||||
#include <fastdds/dds/domain/DomainParticipant.hpp>
|
#include <fastdds/dds/domain/DomainParticipant.hpp>
|
||||||
#include <fastdds/dds/domain/qos/DomainParticipantQos.hpp>
|
#include <fastdds/dds/domain/qos/DomainParticipantQos.hpp>
|
||||||
#include <fastdds/dds/publisher/PublisherListener.hpp>
|
|
||||||
#include <fastdds/rtps/common/MatchingInfo.hpp>
|
|
||||||
|
|
||||||
#include "rmw/types.h"
|
#include "rmw/types.h"
|
||||||
#include "rmw/impl/cpp/key_value.hpp"
|
#include "rmw/impl/cpp/key_value.hpp"
|
||||||
@@ -57,31 +59,24 @@ public:
|
|||||||
ParticipantEntitiesInfoTypeSupport();
|
ParticipantEntitiesInfoTypeSupport();
|
||||||
|
|
||||||
virtual bool serialize(
|
virtual bool serialize(
|
||||||
const void* const data,
|
void* data,
|
||||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
eprosima::fastrtps::rtps::SerializedPayload_t* payload) override;
|
||||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
|
||||||
|
|
||||||
virtual bool deserialize(
|
virtual bool deserialize(
|
||||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
eprosima::fastrtps::rtps::SerializedPayload_t* payload,
|
||||||
void* data) override;
|
void* data) override;
|
||||||
|
|
||||||
virtual uint32_t calculate_serialized_size(
|
virtual std::function<uint32_t()> getSerializedSizeProvider(
|
||||||
const void* const data,
|
void* data) override;
|
||||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
|
||||||
|
|
||||||
virtual void* create_data() override;
|
virtual void* createData() override;
|
||||||
|
|
||||||
virtual void delete_data(void* data) override;
|
virtual void deleteData(void* data) override;
|
||||||
|
|
||||||
virtual bool compute_key(
|
virtual bool getKey(
|
||||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
void* data,
|
||||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
eprosima::fastrtps::rtps::InstanceHandle_t* handle,
|
||||||
bool force_md5 = false) override;
|
bool force_md5) override;
|
||||||
|
|
||||||
virtual bool compute_key(
|
|
||||||
const void* const data,
|
|
||||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
|
||||||
bool force_md5 = false) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@@ -100,31 +95,24 @@ public:
|
|||||||
MicrorosGraphInfoTypeSupport();
|
MicrorosGraphInfoTypeSupport();
|
||||||
|
|
||||||
virtual bool serialize(
|
virtual bool serialize(
|
||||||
const void* const data,
|
void* data,
|
||||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
eprosima::fastrtps::rtps::SerializedPayload_t* payload) override;
|
||||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
|
||||||
|
|
||||||
virtual bool deserialize(
|
virtual bool deserialize(
|
||||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
eprosima::fastrtps::rtps::SerializedPayload_t* payload,
|
||||||
void* data) override;
|
void* data) override;
|
||||||
|
|
||||||
virtual uint32_t calculate_serialized_size(
|
virtual std::function<uint32_t()> getSerializedSizeProvider(
|
||||||
const void* const data,
|
void* data) override;
|
||||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
|
||||||
|
|
||||||
virtual void* create_data() override;
|
virtual void* createData() override;
|
||||||
|
|
||||||
virtual void delete_data(void* data) override;
|
virtual void deleteData(void* data) override;
|
||||||
|
|
||||||
virtual bool compute_key(
|
virtual bool getKey(
|
||||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
void* data,
|
||||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
eprosima::fastrtps::rtps::InstanceHandle_t* handle,
|
||||||
bool force_md5 = false) override;
|
bool force_md5) override;
|
||||||
|
|
||||||
virtual bool compute_key(
|
|
||||||
const void* const data,
|
|
||||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
|
||||||
bool force_md5 = false) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
<?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>6.0.0</version>
|
<version>1.5.4</version>
|
||||||
<description>micro-ROS Agent package</description>
|
<description>micro-ROS Agent package</description>
|
||||||
<maintainer email="eugeniocollado@eprosima.com">Eugenio Collado</maintainer>
|
<maintainer email="pablogarrido@eprosima.com">Pablo Garrido</maintainer>
|
||||||
<maintainer email="davidlaseca@eprosima.com">David Laseca</maintainer>
|
<maintainer email="antoniocuadros@eprosima.com">Antonio Cuadros</maintainer>
|
||||||
<license>Apache License 2.0</license>
|
<license>Apache License 2.0</license>
|
||||||
|
|
||||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||||
@@ -20,7 +20,6 @@
|
|||||||
<depend>rmw_fastrtps_shared_cpp</depend>
|
<depend>rmw_fastrtps_shared_cpp</depend>
|
||||||
<depend>rmw_dds_common</depend>
|
<depend>rmw_dds_common</depend>
|
||||||
<depend>micro_ros_msgs</depend>
|
<depend>micro_ros_msgs</depend>
|
||||||
<depend>microxrcedds_agent</depend>
|
|
||||||
|
|
||||||
<test_depend>rosidl_typesupport_fastrtps_cpp</test_depend>
|
<test_depend>rosidl_typesupport_fastrtps_cpp</test_depend>
|
||||||
<test_depend>ament_cmake_gtest</test_depend>
|
<test_depend>ament_cmake_gtest</test_depend>
|
||||||
|
|||||||
@@ -79,9 +79,14 @@ bool Agent::create(
|
|||||||
{
|
{
|
||||||
auto graph_manager_ = find_or_create_graph_manager(participant->get_domain_id());
|
auto graph_manager_ = find_or_create_graph_manager(participant->get_domain_id());
|
||||||
|
|
||||||
graph_manager_->add_datawriter(datawriter->guid(), participant, datawriter);
|
// TODO(jamoralp): Workaround for Fast-DDS bug #9977. Remove when fixed
|
||||||
|
const eprosima::fastrtps::rtps::InstanceHandle_t instance_handle =
|
||||||
|
datawriter->get_instance_handle();
|
||||||
|
const eprosima::fastrtps::rtps::GUID_t datawriter_guid =
|
||||||
|
iHandle2GUID(instance_handle);
|
||||||
|
graph_manager_->add_datawriter(datawriter_guid, participant, datawriter);
|
||||||
graph_manager_->associate_entity(
|
graph_manager_->associate_entity(
|
||||||
datawriter->guid(), participant, dds::xrce::OBJK_DATAWRITER);
|
datawriter_guid, participant, dds::xrce::OBJK_DATAWRITER);
|
||||||
});
|
});
|
||||||
xrce_dds_agent_instance_.add_middleware_callback(
|
xrce_dds_agent_instance_.add_middleware_callback(
|
||||||
eprosima::uxr::Middleware::Kind::FASTDDS,
|
eprosima::uxr::Middleware::Kind::FASTDDS,
|
||||||
@@ -101,7 +106,12 @@ bool Agent::create(
|
|||||||
|
|
||||||
auto graph_manager_ = find_or_create_graph_manager(participant->get_domain_id());
|
auto graph_manager_ = find_or_create_graph_manager(participant->get_domain_id());
|
||||||
|
|
||||||
graph_manager_->remove_datawriter(datawriter->guid());
|
// TODO(jamoralp): Workaround for Fast-DDS bug #9977. Remove when fixed
|
||||||
|
const eprosima::fastrtps::rtps::InstanceHandle_t instance_handle =
|
||||||
|
datawriter->get_instance_handle();
|
||||||
|
const eprosima::fastrtps::rtps::GUID_t datawriter_guid =
|
||||||
|
eprosima::fastrtps::rtps::iHandle2GUID(instance_handle);
|
||||||
|
graph_manager_->remove_datawriter(datawriter_guid);
|
||||||
});
|
});
|
||||||
|
|
||||||
xrce_dds_agent_instance_.add_middleware_callback(
|
xrce_dds_agent_instance_.add_middleware_callback(
|
||||||
@@ -122,10 +132,10 @@ bool Agent::create(
|
|||||||
auto graph_manager_ = find_or_create_graph_manager(participant->get_domain_id());
|
auto graph_manager_ = find_or_create_graph_manager(participant->get_domain_id());
|
||||||
|
|
||||||
// TODO(jamoralp): Workaround for Fast-DDS bug #9977. Remove when fixed
|
// TODO(jamoralp): Workaround for Fast-DDS bug #9977. Remove when fixed
|
||||||
const eprosima::fastdds::rtps::InstanceHandle_t instance_handle =
|
const eprosima::fastrtps::rtps::InstanceHandle_t instance_handle =
|
||||||
datareader->get_instance_handle();
|
datareader->get_instance_handle();
|
||||||
const eprosima::fastdds::rtps::GUID_t datareader_guid =
|
const eprosima::fastrtps::rtps::GUID_t datareader_guid =
|
||||||
eprosima::fastdds::rtps::iHandle2GUID(instance_handle);
|
eprosima::fastrtps::rtps::iHandle2GUID(instance_handle);
|
||||||
graph_manager_->add_datareader(datareader_guid, participant, datareader);
|
graph_manager_->add_datareader(datareader_guid, participant, datareader);
|
||||||
graph_manager_->associate_entity(
|
graph_manager_->associate_entity(
|
||||||
datareader_guid, participant, dds::xrce::OBJK_DATAREADER);
|
datareader_guid, participant, dds::xrce::OBJK_DATAREADER);
|
||||||
@@ -148,10 +158,10 @@ bool Agent::create(
|
|||||||
auto graph_manager_ = find_or_create_graph_manager(participant->get_domain_id());
|
auto graph_manager_ = find_or_create_graph_manager(participant->get_domain_id());
|
||||||
|
|
||||||
// TODO(jamoralp): Workaround for Fast-DDS bug #9977. Remove when fixed
|
// TODO(jamoralp): Workaround for Fast-DDS bug #9977. Remove when fixed
|
||||||
const eprosima::fastdds::rtps::InstanceHandle_t instance_handle =
|
const eprosima::fastrtps::rtps::InstanceHandle_t instance_handle =
|
||||||
datareader->get_instance_handle();
|
datareader->get_instance_handle();
|
||||||
const eprosima::fastdds::rtps::GUID_t datareader_guid =
|
const eprosima::fastrtps::rtps::GUID_t datareader_guid =
|
||||||
eprosima::fastdds::rtps::iHandle2GUID(instance_handle);
|
eprosima::fastrtps::rtps::iHandle2GUID(instance_handle);
|
||||||
graph_manager_->remove_datareader(datareader_guid);
|
graph_manager_->remove_datareader(datareader_guid);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -174,15 +184,21 @@ bool Agent::create(
|
|||||||
{
|
{
|
||||||
auto graph_manager_ = find_or_create_graph_manager(participant->get_domain_id());
|
auto graph_manager_ = find_or_create_graph_manager(participant->get_domain_id());
|
||||||
|
|
||||||
graph_manager_->add_datawriter(datawriter->guid(), participant, datawriter);
|
// TODO(pablogs): Workaround for Fast-DDS bug #9977. Remove when fixed
|
||||||
|
const eprosima::fastrtps::rtps::InstanceHandle_t instance_handle_dw =
|
||||||
|
datawriter->get_instance_handle();
|
||||||
|
const eprosima::fastrtps::rtps::GUID_t datawriter_guid =
|
||||||
|
eprosima::fastrtps::rtps::iHandle2GUID(instance_handle_dw);
|
||||||
|
|
||||||
|
graph_manager_->add_datawriter(datawriter_guid, participant, datawriter);
|
||||||
graph_manager_->associate_entity(
|
graph_manager_->associate_entity(
|
||||||
datawriter->guid(), participant, dds::xrce::OBJK_DATAWRITER);
|
datawriter_guid, participant, dds::xrce::OBJK_DATAWRITER);
|
||||||
|
|
||||||
// TODO(pablogs): Workaround for Fast-DDS bug #9977. Remove when fixed
|
// TODO(pablogs): Workaround for Fast-DDS bug #9977. Remove when fixed
|
||||||
const eprosima::fastdds::rtps::InstanceHandle_t instance_handle =
|
const eprosima::fastrtps::rtps::InstanceHandle_t instance_handle_dr =
|
||||||
datareader->get_instance_handle();
|
datareader->get_instance_handle();
|
||||||
const eprosima::fastdds::rtps::GUID_t datareader_guid =
|
const eprosima::fastrtps::rtps::GUID_t datareader_guid =
|
||||||
eprosima::fastdds::rtps::iHandle2GUID(instance_handle);
|
eprosima::fastrtps::rtps::iHandle2GUID(instance_handle_dr);
|
||||||
graph_manager_->add_datareader(datareader_guid, participant, datareader);
|
graph_manager_->add_datareader(datareader_guid, participant, datareader);
|
||||||
graph_manager_->associate_entity(
|
graph_manager_->associate_entity(
|
||||||
datareader_guid, participant, dds::xrce::OBJK_DATAREADER);
|
datareader_guid, participant, dds::xrce::OBJK_DATAREADER);
|
||||||
@@ -206,13 +222,18 @@ bool Agent::create(
|
|||||||
{
|
{
|
||||||
auto graph_manager_ = find_or_create_graph_manager(participant->get_domain_id());
|
auto graph_manager_ = find_or_create_graph_manager(participant->get_domain_id());
|
||||||
|
|
||||||
graph_manager_->remove_datawriter(datawriter->guid());
|
// TODO(pablogs): Workaround for Fast-DDS bug #9977. Remove when fixed
|
||||||
|
const eprosima::fastrtps::rtps::InstanceHandle_t instance_handle_dw =
|
||||||
|
datawriter->get_instance_handle();
|
||||||
|
const eprosima::fastrtps::rtps::GUID_t datawriter_guid =
|
||||||
|
eprosima::fastrtps::rtps::iHandle2GUID(instance_handle_dw);
|
||||||
|
graph_manager_->remove_datawriter(datawriter_guid);
|
||||||
|
|
||||||
// TODO(pablogs): Workaround for Fast-DDS bug #9977. Remove when fixed
|
// TODO(pablogs): Workaround for Fast-DDS bug #9977. Remove when fixed
|
||||||
const eprosima::fastdds::rtps::InstanceHandle_t instance_handle =
|
const eprosima::fastrtps::rtps::InstanceHandle_t instance_handle_dr =
|
||||||
datareader->get_instance_handle();
|
datareader->get_instance_handle();
|
||||||
const eprosima::fastdds::rtps::GUID_t datareader_guid =
|
const eprosima::fastrtps::rtps::GUID_t datareader_guid =
|
||||||
eprosima::fastdds::rtps::iHandle2GUID(instance_handle);
|
eprosima::fastrtps::rtps::iHandle2GUID(instance_handle_dr);
|
||||||
graph_manager_->remove_datareader(datareader_guid);
|
graph_manager_->remove_datareader(datareader_guid);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -235,15 +256,20 @@ bool Agent::create(
|
|||||||
{
|
{
|
||||||
auto graph_manager_ = find_or_create_graph_manager(participant->get_domain_id());
|
auto graph_manager_ = find_or_create_graph_manager(participant->get_domain_id());
|
||||||
|
|
||||||
graph_manager_->add_datawriter(datawriter->guid(), participant, datawriter);
|
// TODO(pablogs): Workaround for Fast-DDS bug #9977. Remove when fixed
|
||||||
|
const eprosima::fastrtps::rtps::InstanceHandle_t instance_handle_dw =
|
||||||
|
datawriter->get_instance_handle();
|
||||||
|
const eprosima::fastrtps::rtps::GUID_t datawriter_guid =
|
||||||
|
eprosima::fastrtps::rtps::iHandle2GUID(instance_handle_dw);
|
||||||
|
graph_manager_->add_datawriter(datawriter_guid, participant, datawriter);
|
||||||
graph_manager_->associate_entity(
|
graph_manager_->associate_entity(
|
||||||
datawriter->guid(), participant, dds::xrce::OBJK_DATAWRITER);
|
datawriter_guid, participant, dds::xrce::OBJK_DATAWRITER);
|
||||||
|
|
||||||
// TODO(pablogs): Workaround for Fast-DDS bug #9977. Remove when fixed
|
// TODO(pablogs): Workaround for Fast-DDS bug #9977. Remove when fixed
|
||||||
const eprosima::fastdds::rtps::InstanceHandle_t instance_handle =
|
const eprosima::fastrtps::rtps::InstanceHandle_t instance_handle_dr =
|
||||||
datareader->get_instance_handle();
|
datareader->get_instance_handle();
|
||||||
const eprosima::fastdds::rtps::GUID_t datareader_guid =
|
const eprosima::fastrtps::rtps::GUID_t datareader_guid =
|
||||||
eprosima::fastdds::rtps::iHandle2GUID(instance_handle);
|
eprosima::fastrtps::rtps::iHandle2GUID(instance_handle_dr);
|
||||||
graph_manager_->add_datareader(datareader_guid, participant, datareader);
|
graph_manager_->add_datareader(datareader_guid, participant, datareader);
|
||||||
graph_manager_->associate_entity(
|
graph_manager_->associate_entity(
|
||||||
datareader_guid, participant, dds::xrce::OBJK_DATAREADER);
|
datareader_guid, participant, dds::xrce::OBJK_DATAREADER);
|
||||||
@@ -267,13 +293,18 @@ bool Agent::create(
|
|||||||
{
|
{
|
||||||
auto graph_manager_ = find_or_create_graph_manager(participant->get_domain_id());
|
auto graph_manager_ = find_or_create_graph_manager(participant->get_domain_id());
|
||||||
|
|
||||||
graph_manager_->remove_datawriter(datawriter->guid());
|
// TODO(pablogs): Workaround for Fast-DDS bug #9977. Remove when fixed
|
||||||
|
const eprosima::fastrtps::rtps::InstanceHandle_t instance_handle_dw =
|
||||||
|
datawriter->get_instance_handle();
|
||||||
|
const eprosima::fastrtps::rtps::GUID_t datawriter_guid =
|
||||||
|
eprosima::fastrtps::rtps::iHandle2GUID(instance_handle_dw);
|
||||||
|
graph_manager_->remove_datawriter(datawriter_guid);
|
||||||
|
|
||||||
// TODO(pablogs): Workaround for Fast-DDS bug #9977. Remove when fixed
|
// TODO(pablogs): Workaround for Fast-DDS bug #9977. Remove when fixed
|
||||||
const eprosima::fastdds::rtps::InstanceHandle_t instance_handle =
|
const eprosima::fastrtps::rtps::InstanceHandle_t instance_handle_dr =
|
||||||
datareader->get_instance_handle();
|
datareader->get_instance_handle();
|
||||||
const eprosima::fastdds::rtps::GUID_t datareader_guid =
|
const eprosima::fastrtps::rtps::GUID_t datareader_guid =
|
||||||
eprosima::fastdds::rtps::iHandle2GUID(instance_handle);
|
eprosima::fastrtps::rtps::iHandle2GUID(instance_handle_dr);
|
||||||
graph_manager_->remove_datareader(datareader_guid);
|
graph_manager_->remove_datareader(datareader_guid);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,6 @@
|
|||||||
#define _UROS_AGENT_GRAPH_MANAGER_CPP
|
#define _UROS_AGENT_GRAPH_MANAGER_CPP
|
||||||
|
|
||||||
#include <agent/graph_manager/graph_manager.hpp>
|
#include <agent/graph_manager/graph_manager.hpp>
|
||||||
#include <fastdds/dds/core/detail/DDSReturnCode.hpp>
|
|
||||||
#include <fastdds/rtps/participant/ParticipantDiscoveryInfo.hpp>
|
|
||||||
#include <fastdds/rtps/reader/ReaderDiscoveryStatus.hpp>
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -57,9 +54,9 @@ GraphManager::GraphManager(eprosima::fastdds::dds::DomainId_t domain_id)
|
|||||||
|
|
||||||
participant_qos.name(enclave);
|
participant_qos.name(enclave);
|
||||||
participant_qos.wire_protocol().builtin.readerHistoryMemoryPolicy =
|
participant_qos.wire_protocol().builtin.readerHistoryMemoryPolicy =
|
||||||
eprosima::fastdds::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
|
eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
|
||||||
participant_qos.wire_protocol().builtin.writerHistoryMemoryPolicy =
|
participant_qos.wire_protocol().builtin.writerHistoryMemoryPolicy =
|
||||||
eprosima::fastdds::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
|
eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
|
||||||
|
|
||||||
eprosima::fastdds::dds::StatusMask par_mask = eprosima::fastdds::dds::StatusMask::none();
|
eprosima::fastdds::dds::StatusMask par_mask = eprosima::fastdds::dds::StatusMask::none();
|
||||||
participant_.reset(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->
|
participant_.reset(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->
|
||||||
@@ -94,7 +91,7 @@ GraphManager::GraphManager(eprosima::fastdds::dds::DomainId_t domain_id)
|
|||||||
eprosima::fastdds::dds::HistoryQosPolicyKind::KEEP_LAST_HISTORY_QOS;
|
eprosima::fastdds::dds::HistoryQosPolicyKind::KEEP_LAST_HISTORY_QOS;
|
||||||
datawriter_qos_.history().depth = 1;
|
datawriter_qos_.history().depth = 1;
|
||||||
datawriter_qos_.endpoint().history_memory_policy =
|
datawriter_qos_.endpoint().history_memory_policy =
|
||||||
eprosima::fastdds::rtps::MemoryManagementPolicy::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
|
eprosima::fastrtps::rtps::MemoryManagementPolicy::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
|
||||||
datawriter_qos_.publish_mode().kind =
|
datawriter_qos_.publish_mode().kind =
|
||||||
eprosima::fastdds::dds::PublishModeQosPolicyKind::ASYNCHRONOUS_PUBLISH_MODE;
|
eprosima::fastdds::dds::PublishModeQosPolicyKind::ASYNCHRONOUS_PUBLISH_MODE;
|
||||||
datawriter_qos_.reliability().kind =
|
datawriter_qos_.reliability().kind =
|
||||||
@@ -116,7 +113,7 @@ GraphManager::GraphManager(eprosima::fastdds::dds::DomainId_t domain_id)
|
|||||||
eprosima::fastdds::dds::HistoryQosPolicyKind::KEEP_LAST_HISTORY_QOS;
|
eprosima::fastdds::dds::HistoryQosPolicyKind::KEEP_LAST_HISTORY_QOS;
|
||||||
datareader_qos.history().depth = 1;
|
datareader_qos.history().depth = 1;
|
||||||
datareader_qos.endpoint().history_memory_policy =
|
datareader_qos.endpoint().history_memory_policy =
|
||||||
eprosima::fastdds::rtps::MemoryManagementPolicy::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
|
eprosima::fastrtps::rtps::MemoryManagementPolicy::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
|
||||||
datareader_qos.reliability().kind =
|
datareader_qos.reliability().kind =
|
||||||
eprosima::fastdds::dds::ReliabilityQosPolicyKind::RELIABLE_RELIABILITY_QOS;
|
eprosima::fastdds::dds::ReliabilityQosPolicyKind::RELIABLE_RELIABILITY_QOS;
|
||||||
datareader_qos.durability().kind =
|
datareader_qos.durability().kind =
|
||||||
@@ -354,7 +351,7 @@ void GraphManager::remove_participant(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GraphManager::add_datawriter(
|
void GraphManager::add_datawriter(
|
||||||
const eprosima::fastdds::rtps::GUID_t& datawriter_guid,
|
const eprosima::fastrtps::rtps::GUID_t& datawriter_guid,
|
||||||
const eprosima::fastdds::dds::DomainParticipant* participant,
|
const eprosima::fastdds::dds::DomainParticipant* participant,
|
||||||
const eprosima::fastdds::dds::DataWriter* datawriter)
|
const eprosima::fastdds::dds::DataWriter* datawriter)
|
||||||
{
|
{
|
||||||
@@ -365,10 +362,10 @@ void GraphManager::add_datawriter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GraphManager::add_datawriter(
|
void GraphManager::add_datawriter(
|
||||||
const eprosima::fastdds::rtps::GUID_t& datawriter_guid,
|
const eprosima::fastrtps::rtps::GUID_t& datawriter_guid,
|
||||||
const std::string& topic_name,
|
const std::string& topic_name,
|
||||||
const std::string& type_name,
|
const std::string& type_name,
|
||||||
const eprosima::fastdds::rtps::GUID_t& participant_guid,
|
const eprosima::fastrtps::rtps::GUID_t& participant_guid,
|
||||||
const eprosima::fastdds::dds::DataWriterQos& writer_qos)
|
const eprosima::fastdds::dds::DataWriterQos& writer_qos)
|
||||||
{
|
{
|
||||||
const rmw_gid_t datawriter_gid = rmw_fastrtps_shared_cpp::create_rmw_gid(
|
const rmw_gid_t datawriter_gid = rmw_fastrtps_shared_cpp::create_rmw_gid(
|
||||||
@@ -377,12 +374,30 @@ 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, type_name,
|
graphCache_.add_entity(datawriter_gid, topic_name,
|
||||||
rosidl_get_zero_initialized_type_hash(), participant_gid, qos_profile, false);
|
type_name, participant_gid, qos_profile, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphManager::add_datawriter(
|
||||||
|
const eprosima::fastrtps::rtps::GUID_t& datawriter_guid,
|
||||||
|
const std::string& topic_name,
|
||||||
|
const std::string& type_name,
|
||||||
|
const eprosima::fastrtps::rtps::GUID_t& participant_guid,
|
||||||
|
const eprosima::fastdds::dds::WriterQos& writer_qos)
|
||||||
|
{
|
||||||
|
const rmw_gid_t datawriter_gid = rmw_fastrtps_shared_cpp::create_rmw_gid(
|
||||||
|
"rmw_fastrtps_cpp", datawriter_guid);
|
||||||
|
const rmw_gid_t participant_gid = rmw_fastrtps_shared_cpp::create_rmw_gid(
|
||||||
|
"rmw_fastrtps_cpp", participant_guid);
|
||||||
|
rmw_qos_profile_t qos_profile = rmw_qos_profile_unknown;
|
||||||
|
dds_qos_to_rmw_qos(writer_qos, &qos_profile);
|
||||||
|
|
||||||
|
graphCache_.add_entity(datawriter_gid, topic_name,
|
||||||
|
type_name, participant_gid, qos_profile, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphManager::remove_datawriter(
|
void GraphManager::remove_datawriter(
|
||||||
const eprosima::fastdds::rtps::GUID_t& datawriter_guid)
|
const eprosima::fastrtps::rtps::GUID_t& datawriter_guid)
|
||||||
{
|
{
|
||||||
const rmw_gid_t datawriter_gid = rmw_fastrtps_shared_cpp::create_rmw_gid(
|
const rmw_gid_t datawriter_gid = rmw_fastrtps_shared_cpp::create_rmw_gid(
|
||||||
"rmw_fastrtps_cpp", datawriter_guid);
|
"rmw_fastrtps_cpp", datawriter_guid);
|
||||||
@@ -391,7 +406,7 @@ void GraphManager::remove_datawriter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GraphManager::add_datareader(
|
void GraphManager::add_datareader(
|
||||||
const eprosima::fastdds::rtps::GUID_t& datareader_guid,
|
const eprosima::fastrtps::rtps::GUID_t& datareader_guid,
|
||||||
const eprosima::fastdds::dds::DomainParticipant* participant,
|
const eprosima::fastdds::dds::DomainParticipant* participant,
|
||||||
const eprosima::fastdds::dds::DataReader* datareader)
|
const eprosima::fastdds::dds::DataReader* datareader)
|
||||||
{
|
{
|
||||||
@@ -402,10 +417,10 @@ void GraphManager::add_datareader(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GraphManager::add_datareader(
|
void GraphManager::add_datareader(
|
||||||
const eprosima::fastdds::rtps::GUID_t& datareader_guid,
|
const eprosima::fastrtps::rtps::GUID_t& datareader_guid,
|
||||||
const std::string& topic_name,
|
const std::string& topic_name,
|
||||||
const std::string& type_name,
|
const std::string& type_name,
|
||||||
const eprosima::fastdds::rtps::GUID_t& participant_guid,
|
const eprosima::fastrtps::rtps::GUID_t& participant_guid,
|
||||||
const eprosima::fastdds::dds::DataReaderQos& reader_qos)
|
const eprosima::fastdds::dds::DataReaderQos& reader_qos)
|
||||||
{
|
{
|
||||||
const rmw_gid_t datareader_gid = rmw_fastrtps_shared_cpp::create_rmw_gid(
|
const rmw_gid_t datareader_gid = rmw_fastrtps_shared_cpp::create_rmw_gid(
|
||||||
@@ -414,17 +429,30 @@ 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);
|
||||||
|
|
||||||
// TODO(acuadros95): Use typesupport to calculate type hash on micro-ROS and save and get it from reader_qos.user_data.
|
graphCache_.add_entity(datareader_gid, topic_name,
|
||||||
// Related PRs:
|
type_name, participant_gid, qos_profile, true);
|
||||||
// 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
|
void GraphManager::add_datareader(
|
||||||
graphCache_.add_entity(datareader_gid, topic_name, type_name,
|
const eprosima::fastrtps::rtps::GUID_t& datareader_guid,
|
||||||
rosidl_get_zero_initialized_type_hash(), participant_gid, qos_profile, true);
|
const std::string& topic_name,
|
||||||
|
const std::string& type_name,
|
||||||
|
const eprosima::fastrtps::rtps::GUID_t& participant_guid,
|
||||||
|
const eprosima::fastdds::dds::ReaderQos& reader_qos)
|
||||||
|
{
|
||||||
|
const rmw_gid_t datareader_gid = rmw_fastrtps_shared_cpp::create_rmw_gid(
|
||||||
|
"rmw_fastrtps_cpp", datareader_guid);
|
||||||
|
const rmw_gid_t participant_gid = rmw_fastrtps_shared_cpp::create_rmw_gid(
|
||||||
|
"rmw_fastrtps_cpp", participant_guid);
|
||||||
|
rmw_qos_profile_t qos_profile = rmw_qos_profile_unknown;
|
||||||
|
dds_qos_to_rmw_qos(reader_qos, &qos_profile);
|
||||||
|
|
||||||
|
graphCache_.add_entity(datareader_gid, topic_name,
|
||||||
|
type_name, participant_gid, qos_profile, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphManager::remove_datareader(
|
void GraphManager::remove_datareader(
|
||||||
const eprosima::fastdds::rtps::GUID_t& datareader_guid)
|
const eprosima::fastrtps::rtps::GUID_t& datareader_guid)
|
||||||
{
|
{
|
||||||
const rmw_gid_t datareader_gid = rmw_fastrtps_shared_cpp::create_rmw_gid(
|
const rmw_gid_t datareader_gid = rmw_fastrtps_shared_cpp::create_rmw_gid(
|
||||||
"rmw_fastrtps_cpp", datareader_guid);
|
"rmw_fastrtps_cpp", datareader_guid);
|
||||||
@@ -433,7 +461,7 @@ void GraphManager::remove_datareader(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GraphManager::associate_entity(
|
void GraphManager::associate_entity(
|
||||||
const eprosima::fastdds::rtps::GUID_t& entity_guid,
|
const eprosima::fastrtps::rtps::GUID_t& entity_guid,
|
||||||
const eprosima::fastdds::dds::DomainParticipant* participant,
|
const eprosima::fastdds::dds::DomainParticipant* participant,
|
||||||
const dds::xrce::ObjectKind& entity_kind)
|
const dds::xrce::ObjectKind& entity_kind)
|
||||||
{
|
{
|
||||||
@@ -553,9 +581,9 @@ void GraphManager::update_node_entities_info()
|
|||||||
rmw_dds_common::msg::ParticipantEntitiesInfo entities_info;
|
rmw_dds_common::msg::ParticipantEntitiesInfo entities_info;
|
||||||
eprosima::fastdds::dds::SampleInfo sample_info;
|
eprosima::fastdds::dds::SampleInfo sample_info;
|
||||||
if (ros_discovery_datareader_->take_next_sample(&entities_info, &sample_info) ==
|
if (ros_discovery_datareader_->take_next_sample(&entities_info, &sample_info) ==
|
||||||
eprosima::fastdds::dds::RETCODE_OK)
|
eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK)
|
||||||
{
|
{
|
||||||
if (sample_info.instance_state == eprosima::fastdds::dds::InstanceStateKind::ALIVE_INSTANCE_STATE)
|
if (sample_info.instance_state == eprosima::fastdds::dds::InstanceStateKind::ALIVE)
|
||||||
{
|
{
|
||||||
graphCache_.update_participant_entities(entities_info);
|
graphCache_.update_participant_entities(entities_info);
|
||||||
}
|
}
|
||||||
@@ -607,19 +635,14 @@ 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::fastdds::rtps::ParticipantDiscoveryStatus reason,
|
eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info)
|
||||||
const eprosima::fastdds::dds::ParticipantBuiltinTopicData& info,
|
|
||||||
bool& should_be_ignored)
|
|
||||||
{
|
{
|
||||||
static_cast<void>(participant);
|
switch (info.status)
|
||||||
static_cast<void>(should_be_ignored);
|
|
||||||
|
|
||||||
switch (reason)
|
|
||||||
{
|
{
|
||||||
case eprosima::fastdds::rtps::ParticipantDiscoveryStatus::DISCOVERED_PARTICIPANT:
|
case eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT:
|
||||||
{
|
{
|
||||||
auto map = rmw::impl::cpp::parse_key_value(info.user_data);
|
auto map = rmw::impl::cpp::parse_key_value(info.info.m_userData);
|
||||||
auto name_found = map.find("enclave");
|
auto name_found = map.find("enclave");
|
||||||
|
|
||||||
if (map.end() == name_found)
|
if (map.end() == name_found)
|
||||||
@@ -629,14 +652,14 @@ 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());
|
||||||
|
|
||||||
const rmw_gid_t gid = rmw_fastrtps_shared_cpp::create_rmw_gid("rmw_fastrtps_cpp", info.guid);
|
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);
|
graphManager_from_->get_graph_cache().add_participant(gid, enclave);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eprosima::fastdds::rtps::ParticipantDiscoveryStatus::REMOVED_PARTICIPANT:
|
case eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::REMOVED_PARTICIPANT:
|
||||||
case eprosima::fastdds::rtps::ParticipantDiscoveryStatus::DROPPED_PARTICIPANT:
|
case eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DROPPED_PARTICIPANT:
|
||||||
{
|
{
|
||||||
const rmw_gid_t gid = rmw_fastrtps_shared_cpp::create_rmw_gid("rmw_fastrtps_cpp", info.guid);
|
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);
|
graphManager_from_->get_graph_cache().remove_participant(gid);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -647,134 +670,72 @@ void GraphManager::ParticipantListener::on_participant_discovery(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static eprosima::fastdds::dds::DataWriterQos writer_qos_conversion(
|
|
||||||
const eprosima::fastdds::dds::PublicationBuiltinTopicData& writer_info)
|
|
||||||
{
|
|
||||||
eprosima::fastdds::dds::DataWriterQos datawriter_qos;
|
|
||||||
eprosima::fastdds::dds::RTPSReliableWriterQos reliable_writer_qos;
|
|
||||||
reliable_writer_qos.disable_positive_acks = writer_info.disable_positive_acks;
|
|
||||||
|
|
||||||
datawriter_qos.durability(writer_info.durability);
|
|
||||||
datawriter_qos.durability_service(writer_info.durability_service);
|
|
||||||
datawriter_qos.deadline(writer_info.deadline);
|
|
||||||
datawriter_qos.latency_budget(writer_info.latency_budget);
|
|
||||||
datawriter_qos.liveliness(writer_info.liveliness);
|
|
||||||
datawriter_qos.reliability(writer_info.reliability);
|
|
||||||
datawriter_qos.lifespan(writer_info.lifespan);
|
|
||||||
datawriter_qos.user_data(writer_info.user_data);
|
|
||||||
datawriter_qos.ownership(writer_info.ownership);
|
|
||||||
datawriter_qos.ownership_strength(writer_info.ownership_strength);
|
|
||||||
datawriter_qos.destination_order(writer_info.destination_order);
|
|
||||||
datawriter_qos.reliable_writer_qos(reliable_writer_qos);
|
|
||||||
datawriter_qos.representation(writer_info.representation);
|
|
||||||
datawriter_qos.data_sharing(writer_info.data_sharing);
|
|
||||||
|
|
||||||
return datawriter_qos;
|
|
||||||
}
|
|
||||||
|
|
||||||
static eprosima::fastdds::dds::DataReaderQos reader_qos_conversion(
|
|
||||||
const eprosima::fastdds::rtps::SubscriptionBuiltinTopicData& reader_info)
|
|
||||||
{
|
|
||||||
eprosima::fastdds::dds::DataReaderQos datareader_qos;
|
|
||||||
eprosima::fastdds::dds::RTPSReliableReaderQos reliable_reader_qos;
|
|
||||||
reliable_reader_qos.disable_positive_acks = reader_info.disable_positive_acks;
|
|
||||||
|
|
||||||
datareader_qos.durability(reader_info.durability);
|
|
||||||
datareader_qos.deadline(reader_info.deadline);
|
|
||||||
datareader_qos.latency_budget(reader_info.latency_budget);
|
|
||||||
datareader_qos.lifespan(reader_info.lifespan);
|
|
||||||
datareader_qos.liveliness(reader_info.liveliness);
|
|
||||||
datareader_qos.reliability(reader_info.reliability);
|
|
||||||
datareader_qos.ownership(reader_info.ownership);
|
|
||||||
datareader_qos.destination_order(reader_info.destination_order);
|
|
||||||
datareader_qos.user_data(reader_info.user_data);
|
|
||||||
datareader_qos.time_based_filter(reader_info.time_based_filter);
|
|
||||||
datareader_qos.type_consistency(reader_info.type_consistency);
|
|
||||||
datareader_qos.reliable_reader_qos(reliable_reader_qos);
|
|
||||||
datareader_qos.representation(reader_info.representation);
|
|
||||||
datareader_qos.data_sharing(reader_info.data_sharing);
|
|
||||||
|
|
||||||
return datareader_qos;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void GraphManager::ParticipantListener::process_discovery_info<eprosima::fastdds::rtps::ReaderDiscoveryStatus, eprosima::fastdds::rtps::SubscriptionBuiltinTopicData>(
|
void GraphManager::ParticipantListener::process_discovery_info<eprosima::fastrtps::rtps::ReaderDiscoveryInfo>(
|
||||||
eprosima::fastdds::rtps::ReaderDiscoveryStatus reason,
|
const eprosima::fastrtps::rtps::ReaderDiscoveryInfo& reader_info)
|
||||||
const eprosima::fastdds::rtps::SubscriptionBuiltinTopicData& reader_info)
|
|
||||||
{
|
{
|
||||||
switch (reason)
|
switch (reader_info.status)
|
||||||
{
|
{
|
||||||
case eprosima::fastdds::rtps::ReaderDiscoveryStatus::CHANGED_QOS_READER:
|
case eprosima::fastrtps::rtps::ReaderDiscoveryInfo::CHANGED_QOS_READER:
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case eprosima::fastdds::rtps::ReaderDiscoveryStatus::DISCOVERED_READER:
|
case eprosima::fastrtps::rtps::ReaderDiscoveryInfo::DISCOVERED_READER:
|
||||||
{
|
{
|
||||||
const std::string topic_name = reader_info.topic_name.to_string();
|
const std::string topic_name = reader_info.info.topicName().to_string();
|
||||||
const std::string type_name = reader_info.type_name.to_string();
|
const std::string type_name = reader_info.info.typeName().to_string();
|
||||||
|
|
||||||
graphManager_from_->add_datareader(reader_info.guid, topic_name, type_name,
|
graphManager_from_->add_datareader(reader_info.info.guid(), topic_name, type_name,
|
||||||
reader_info.participant_guid, reader_qos_conversion(reader_info));
|
iHandle2GUID(reader_info.info.RTPSParticipantKey()), reader_info.info.m_qos);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
graphManager_from_->remove_datareader(reader_info.guid);
|
graphManager_from_->remove_datareader(reader_info.info.guid());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void GraphManager::ParticipantListener::process_discovery_info<eprosima::fastdds::rtps::WriterDiscoveryStatus, eprosima::fastdds::rtps::PublicationBuiltinTopicData>(
|
void GraphManager::ParticipantListener::process_discovery_info<eprosima::fastrtps::rtps::WriterDiscoveryInfo>(
|
||||||
eprosima::fastdds::rtps::WriterDiscoveryStatus reason,
|
const eprosima::fastrtps::rtps::WriterDiscoveryInfo& writer_info)
|
||||||
const eprosima::fastdds::rtps::PublicationBuiltinTopicData& writer_info)
|
|
||||||
{
|
{
|
||||||
switch (reason)
|
switch (writer_info.status)
|
||||||
{
|
{
|
||||||
case eprosima::fastdds::rtps::WriterDiscoveryStatus::CHANGED_QOS_WRITER:
|
case eprosima::fastrtps::rtps::WriterDiscoveryInfo::CHANGED_QOS_WRITER:
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case eprosima::fastdds::rtps::WriterDiscoveryStatus::DISCOVERED_WRITER:
|
case eprosima::fastrtps::rtps::WriterDiscoveryInfo::DISCOVERED_WRITER:
|
||||||
{
|
{
|
||||||
const std::string topic_name = writer_info.topic_name.to_string();
|
const std::string topic_name = writer_info.info.topicName().to_string();
|
||||||
const std::string type_name = writer_info.type_name.to_string();
|
const std::string type_name = writer_info.info.typeName().to_string();
|
||||||
|
|
||||||
graphManager_from_->add_datawriter(writer_info.guid, topic_name, type_name,
|
graphManager_from_->add_datawriter(writer_info.info.guid(), topic_name, type_name,
|
||||||
writer_info.participant_guid, writer_qos_conversion(writer_info));
|
iHandle2GUID(writer_info.info.RTPSParticipantKey()), writer_info.info.m_qos);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
graphManager_from_->remove_datawriter(writer_info.guid);
|
graphManager_from_->remove_datawriter(writer_info.info.guid());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphManager::ParticipantListener::on_data_reader_discovery(
|
void GraphManager::ParticipantListener::on_subscriber_discovery(
|
||||||
eprosima::fastdds::dds::DomainParticipant* participant,
|
eprosima::fastdds::dds::DomainParticipant* /*participant*/,
|
||||||
eprosima::fastdds::rtps::ReaderDiscoveryStatus reason,
|
eprosima::fastrtps::rtps::ReaderDiscoveryInfo&& info)
|
||||||
const eprosima::fastdds::dds::SubscriptionBuiltinTopicData& info,
|
|
||||||
bool& should_be_ignored)
|
|
||||||
{
|
{
|
||||||
static_cast<void>(participant);
|
process_discovery_info<eprosima::fastrtps::rtps::ReaderDiscoveryInfo>(info);
|
||||||
static_cast<void>(should_be_ignored);
|
|
||||||
|
|
||||||
process_discovery_info<eprosima::fastdds::rtps::ReaderDiscoveryStatus, eprosima::fastdds::rtps::SubscriptionBuiltinTopicData>(reason, info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphManager::ParticipantListener::on_data_writer_discovery(
|
void GraphManager::ParticipantListener::on_publisher_discovery(
|
||||||
eprosima::fastdds::dds::DomainParticipant* participant,
|
eprosima::fastdds::dds::DomainParticipant* /*participant*/,
|
||||||
eprosima::fastdds::rtps::WriterDiscoveryStatus reason,
|
eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info)
|
||||||
const eprosima::fastdds::dds::PublicationBuiltinTopicData& info,
|
|
||||||
bool& should_be_ignored)
|
|
||||||
{
|
{
|
||||||
static_cast<void>(participant);
|
process_discovery_info<eprosima::fastrtps::rtps::WriterDiscoveryInfo>(info);
|
||||||
static_cast<void>(should_be_ignored);
|
|
||||||
|
|
||||||
process_discovery_info<eprosima::fastdds::rtps::WriterDiscoveryStatus, eprosima::fastdds::rtps::PublicationBuiltinTopicData>(reason, info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GraphManager::DatareaderListener::DatareaderListener(
|
GraphManager::DatareaderListener::DatareaderListener(
|
||||||
|
|||||||
@@ -41,30 +41,27 @@ ParticipantEntitiesInfoTypeSupport::ParticipantEntitiesInfoTypeSupport()
|
|||||||
ss << message_namespace << "::";
|
ss << message_namespace << "::";
|
||||||
}
|
}
|
||||||
ss << "dds_::" << message_name << "_";
|
ss << "dds_::" << message_name << "_";
|
||||||
this->set_name(ss.str().c_str());
|
this->setName(ss.str().c_str());
|
||||||
|
|
||||||
char full_bounded;
|
bool full_bounded = true;
|
||||||
max_serialized_type_size = 4 + callbacks_->max_serialized_size(full_bounded);
|
m_typeSize = 4 + callbacks_->max_serialized_size(full_bounded);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParticipantEntitiesInfoTypeSupport::serialize(
|
bool ParticipantEntitiesInfoTypeSupport::serialize(
|
||||||
const void* const data,
|
void * data,
|
||||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
eprosima::fastrtps::rtps::SerializedPayload_t * payload)
|
||||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation)
|
|
||||||
{
|
{
|
||||||
static_cast<void>(data_representation);
|
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char *>(payload->data),
|
||||||
|
payload->max_size);
|
||||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char *>(payload.data),
|
|
||||||
payload.max_size);
|
|
||||||
eprosima::fastcdr::Cdr scdr(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
eprosima::fastcdr::Cdr scdr(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
||||||
eprosima::fastcdr::DDS_CDR);
|
eprosima::fastcdr::Cdr::DDS_CDR);
|
||||||
|
|
||||||
scdr.serialize_encapsulation();
|
scdr.serialize_encapsulation();
|
||||||
if (callbacks_->cdr_serialize(data, scdr))
|
if (callbacks_->cdr_serialize(data, scdr))
|
||||||
{
|
{
|
||||||
payload.encapsulation = (scdr.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS) ?
|
payload->encapsulation = (scdr.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS) ?
|
||||||
CDR_BE : CDR_LE;
|
CDR_BE : CDR_LE;
|
||||||
payload.length = static_cast<uint32_t>(scdr.get_serialized_data_length());
|
payload->length = static_cast<uint32_t>(scdr.getSerializedDataLength());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -74,58 +71,47 @@ bool ParticipantEntitiesInfoTypeSupport::serialize(
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ParticipantEntitiesInfoTypeSupport::deserialize(
|
bool ParticipantEntitiesInfoTypeSupport::deserialize(
|
||||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
eprosima::fastrtps::rtps::SerializedPayload_t * payload,
|
||||||
void * data)
|
void * data)
|
||||||
{
|
{
|
||||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char *>(payload.data),
|
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char *>(payload->data),
|
||||||
payload.length);
|
payload->length);
|
||||||
eprosima::fastcdr::Cdr dcdr(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
eprosima::fastcdr::Cdr dcdr(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
||||||
eprosima::fastcdr::DDS_CDR);
|
eprosima::fastcdr::Cdr::DDS_CDR);
|
||||||
|
|
||||||
dcdr.read_encapsulation();
|
dcdr.read_encapsulation();
|
||||||
return callbacks_->cdr_deserialize(dcdr, data);
|
return callbacks_->cdr_deserialize(dcdr, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t ParticipantEntitiesInfoTypeSupport::calculate_serialized_size(
|
std::function<uint32_t()> ParticipantEntitiesInfoTypeSupport::getSerializedSizeProvider(
|
||||||
const void* const data,
|
void * data)
|
||||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation)
|
{
|
||||||
|
return [data, this]() -> uint32_t
|
||||||
{
|
{
|
||||||
static_cast<void>(data_representation);
|
|
||||||
|
|
||||||
return static_cast<uint32_t>(4 + callbacks_->get_serialized_size(data));
|
return static_cast<uint32_t>(4 + callbacks_->get_serialized_size(data));
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void * ParticipantEntitiesInfoTypeSupport::create_data()
|
void * ParticipantEntitiesInfoTypeSupport::createData()
|
||||||
{
|
{
|
||||||
return static_cast<void *>(nullptr);
|
return static_cast<void *>(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ParticipantEntitiesInfoTypeSupport::delete_data(
|
void ParticipantEntitiesInfoTypeSupport::deleteData(
|
||||||
void * data)
|
void * data)
|
||||||
{
|
{
|
||||||
(void) data;
|
(void) data;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParticipantEntitiesInfoTypeSupport::compute_key(
|
bool ParticipantEntitiesInfoTypeSupport::getKey(
|
||||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
void * data,
|
||||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
eprosima::fastrtps::rtps::InstanceHandle_t * handle,
|
||||||
bool force_md5 /* = false */)
|
bool force_md5)
|
||||||
{
|
|
||||||
(void) payload;
|
|
||||||
(void) ihandle;
|
|
||||||
(void) force_md5;
|
|
||||||
return is_compute_key_provided;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ParticipantEntitiesInfoTypeSupport::compute_key(
|
|
||||||
const void * const data,
|
|
||||||
eprosima::fastdds::rtps::InstanceHandle_t& handle,
|
|
||||||
bool force_md5 /* = false */)
|
|
||||||
{
|
{
|
||||||
(void) data;
|
(void) data;
|
||||||
(void) handle;
|
(void) handle;
|
||||||
(void) force_md5;
|
(void) force_md5;
|
||||||
return is_compute_key_provided;
|
return m_isGetKeyDefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -147,30 +133,27 @@ MicrorosGraphInfoTypeSupport::MicrorosGraphInfoTypeSupport()
|
|||||||
ss << message_namespace << "::";
|
ss << message_namespace << "::";
|
||||||
}
|
}
|
||||||
ss << "dds_::" << message_name << "_";
|
ss << "dds_::" << message_name << "_";
|
||||||
this->set_name(ss.str().c_str());
|
this->setName(ss.str().c_str());
|
||||||
|
|
||||||
char full_bounded;
|
bool full_bounded = true;
|
||||||
max_serialized_type_size = 4 + callbacks_->max_serialized_size(full_bounded);
|
m_typeSize = 4 + callbacks_->max_serialized_size(full_bounded);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MicrorosGraphInfoTypeSupport::serialize(
|
bool MicrorosGraphInfoTypeSupport::serialize(
|
||||||
const void* const data,
|
void * data,
|
||||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
eprosima::fastrtps::rtps::SerializedPayload_t * payload)
|
||||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation)
|
|
||||||
{
|
{
|
||||||
static_cast<void>(data_representation);
|
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char *>(payload->data),
|
||||||
|
payload->max_size);
|
||||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char *>(payload.data),
|
|
||||||
payload.max_size);
|
|
||||||
eprosima::fastcdr::Cdr scdr(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
eprosima::fastcdr::Cdr scdr(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
||||||
eprosima::fastcdr::DDS_CDR);
|
eprosima::fastcdr::Cdr::DDS_CDR);
|
||||||
|
|
||||||
scdr.serialize_encapsulation();
|
scdr.serialize_encapsulation();
|
||||||
if (callbacks_->cdr_serialize(data, scdr))
|
if (callbacks_->cdr_serialize(data, scdr))
|
||||||
{
|
{
|
||||||
payload.encapsulation = (scdr.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS) ?
|
payload->encapsulation = (scdr.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS) ?
|
||||||
CDR_BE : CDR_LE;
|
CDR_BE : CDR_LE;
|
||||||
payload.length = static_cast<uint32_t>(scdr.get_serialized_data_length());
|
payload->length = static_cast<uint32_t>(scdr.getSerializedDataLength());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -180,58 +163,47 @@ bool MicrorosGraphInfoTypeSupport::serialize(
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool MicrorosGraphInfoTypeSupport::deserialize(
|
bool MicrorosGraphInfoTypeSupport::deserialize(
|
||||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
eprosima::fastrtps::rtps::SerializedPayload_t * payload,
|
||||||
void * data)
|
void * data)
|
||||||
{
|
{
|
||||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char *>(payload.data),
|
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char *>(payload->data),
|
||||||
payload.length);
|
payload->length);
|
||||||
eprosima::fastcdr::Cdr dcdr(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
eprosima::fastcdr::Cdr dcdr(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
||||||
eprosima::fastcdr::DDS_CDR);
|
eprosima::fastcdr::Cdr::DDS_CDR);
|
||||||
|
|
||||||
dcdr.read_encapsulation();
|
dcdr.read_encapsulation();
|
||||||
return callbacks_->cdr_deserialize(dcdr, data);
|
return callbacks_->cdr_deserialize(dcdr, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t MicrorosGraphInfoTypeSupport::calculate_serialized_size(
|
std::function<uint32_t()> MicrorosGraphInfoTypeSupport::getSerializedSizeProvider(
|
||||||
const void* const data,
|
void * data)
|
||||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation)
|
{
|
||||||
|
return [data, this]() -> uint32_t
|
||||||
{
|
{
|
||||||
static_cast<void>(data_representation);
|
|
||||||
|
|
||||||
return static_cast<uint32_t>(4 + callbacks_->get_serialized_size(data));
|
return static_cast<uint32_t>(4 + callbacks_->get_serialized_size(data));
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void * MicrorosGraphInfoTypeSupport::create_data()
|
void * MicrorosGraphInfoTypeSupport::createData()
|
||||||
{
|
{
|
||||||
return static_cast<void *>(nullptr);
|
return static_cast<void *>(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MicrorosGraphInfoTypeSupport::delete_data(
|
void MicrorosGraphInfoTypeSupport::deleteData(
|
||||||
void * data)
|
void * data)
|
||||||
{
|
{
|
||||||
(void) data;
|
(void) data;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MicrorosGraphInfoTypeSupport::compute_key(
|
bool MicrorosGraphInfoTypeSupport::getKey(
|
||||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
void * data,
|
||||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
eprosima::fastrtps::rtps::InstanceHandle_t * handle,
|
||||||
bool force_md5 /* = false */)
|
bool force_md5)
|
||||||
{
|
|
||||||
(void) payload;
|
|
||||||
(void) ihandle;
|
|
||||||
(void) force_md5;
|
|
||||||
return is_compute_key_provided;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MicrorosGraphInfoTypeSupport::compute_key(
|
|
||||||
const void* const data,
|
|
||||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
|
||||||
bool force_md5 /* = false */)
|
|
||||||
{
|
{
|
||||||
(void) data;
|
(void) data;
|
||||||
(void) ihandle;
|
(void) handle;
|
||||||
(void) force_md5;
|
(void) force_md5;
|
||||||
return is_compute_key_provided;
|
return m_isGetKeyDefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace graph_manager
|
} // namespace graph_manager
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles" >
|
||||||
|
<transport_descriptors>
|
||||||
|
<transport_descriptor>
|
||||||
|
<transport_id>CustomUdpTransport</transport_id>
|
||||||
|
<type>UDPv4</type>
|
||||||
|
</transport_descriptor>
|
||||||
|
</transport_descriptors>
|
||||||
|
|
||||||
|
<participant profile_name="participant_profile" is_default_profile="true">
|
||||||
|
<rtps>
|
||||||
|
<userTransports>
|
||||||
|
<transport_id>CustomUdpTransport</transport_id>
|
||||||
|
</userTransports>
|
||||||
|
|
||||||
|
<useBuiltinTransports>false</useBuiltinTransports>
|
||||||
|
</rtps>
|
||||||
|
</participant>
|
||||||
|
</profiles>
|
||||||
@@ -24,4 +24,4 @@ if [ -n "$p2p_port" ]; then
|
|||||||
set -- --p2p "$p2p_port" "$@"
|
set -- --p2p "$p2p_port" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$SNAP/lib/micro_ros_agent/micro_ros_agent" "$transport" "$@"
|
exec "$SNAP/opt/ros/snap/lib/micro_ros_agent/micro_ros_agent" "$transport" "$@"
|
||||||
|
|||||||
+21
-38
@@ -4,9 +4,7 @@ version: git
|
|||||||
summary: Bridge between Micro ROS client applications and ROS 2
|
summary: Bridge between Micro ROS client applications and ROS 2
|
||||||
description: |
|
description: |
|
||||||
Micro-ROS, whose default implementation is based on eProsima's
|
Micro-ROS, whose default implementation is based on eProsima's
|
||||||
Micro XRCE-DDS middleware, is composed of client applications
|
Micro XRCE-DDS middleware, is composed of client applications which interact with the ROS 2 world by means of an Agent. This agent keeps tracks of the entities created by means of
|
||||||
which interact with the ROS 2 world by means of an Agent.
|
|
||||||
This agent keeps tracks of the entities created by means of
|
|
||||||
requests performed on the microcontroller side, and uses them
|
requests performed on the microcontroller side, and uses them
|
||||||
to communicate with the ROS 2 dataspace.
|
to communicate with the ROS 2 dataspace.
|
||||||
|
|
||||||
@@ -71,16 +69,6 @@ description: |
|
|||||||
|
|
||||||
$ snap set micro-ros-agent device="device path"
|
$ snap set micro-ros-agent device="device path"
|
||||||
|
|
||||||
If connecting the micro-ROS Agent using an IP based connection mode,
|
|
||||||
that is, `udp4`, `udp6`, `tcp4` or `tcp6`, care must be taken to
|
|
||||||
connect first the `micro-ros-agent-shm-netplug` plug.
|
|
||||||
This is due to the fact that ROS 2 Foxy is using Fast-DDS as the
|
|
||||||
default DDS middleware, and Fast-DDS comes with *shared memory transport*.
|
|
||||||
Thus, this plugin must be enabled, in order to gain access to the
|
|
||||||
`/dev/shm` folder from the snap image, prior to running it:
|
|
||||||
|
|
||||||
$ sudo snap connect micro-ros-agent:micro-ros-agent-shm-netplug
|
|
||||||
|
|
||||||
When using the snap with a serial device, some steps need to be taken
|
When using the snap with a serial device, some steps need to be taken
|
||||||
in order to establish a successful connection:
|
in order to establish a successful connection:
|
||||||
|
|
||||||
@@ -121,21 +109,20 @@ architectures:
|
|||||||
- build-on: ppc64el
|
- build-on: ppc64el
|
||||||
|
|
||||||
parts:
|
parts:
|
||||||
|
|
||||||
uros-agent:
|
uros-agent:
|
||||||
plugin: colcon
|
plugin: colcon
|
||||||
source: .
|
source: .
|
||||||
override-build: |
|
colcon-cmake-args:
|
||||||
set +u
|
- -DMICROROSAGENT_SUPERBUILD=ON
|
||||||
git clone https://github.com/eProsima/Micro-XRCE-DDS-Agent.git -b $ROS_DISTRO
|
- --cmake-force-configure
|
||||||
git clone https://github.com/eProsima/Micro-CDR.git -b $ROS_DISTRO
|
override-pull: |
|
||||||
git clone https://github.com/micro-ROS/micro_ros_msgs.git -b $ROS_DISTRO
|
snapcraftctl pull
|
||||||
git clone https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git -b $ROS_DISTRO
|
|
||||||
git clone https://github.com/micro-ROS/rmw-microxrcedds.git -b $ROS_DISTRO
|
version="$(git describe --always --tags| sed -e 's/^v//;s/-/+git/;y/-/./')"
|
||||||
git clone https://github.com/micro-ROS/micro-ROS-Agent.git -b $ROS_DISTRO
|
[ -n "$(echo $version | grep "+git")" ] && grade=devel || grade=stable
|
||||||
. /opt/ros/$ROS_DISTRO/setup.sh
|
snapcraftctl set-version "$version"
|
||||||
colcon build --merge-install --install-base $SNAPCRAFT_PRIME --cmake-args "-DUAGENT_BUILD_EXECUTABLE=OFF -DUAGENT_USE_SYSTEM_FASTDDS=ON" --packages-up-to micro_ros_agent
|
snapcraftctl set-grade "$grade"
|
||||||
set -u
|
|
||||||
build-packages: [make, gcc, g++]
|
build-packages: [make, gcc, g++]
|
||||||
stage-packages: [ros-foxy-ros2launch]
|
stage-packages: [ros-foxy-ros2launch]
|
||||||
|
|
||||||
@@ -143,26 +130,22 @@ parts:
|
|||||||
plugin: dump
|
plugin: dump
|
||||||
source: snap/local/
|
source: snap/local/
|
||||||
organize:
|
organize:
|
||||||
'*': usr/bin/
|
'micro-ros-agent-daemon': usr/bin/
|
||||||
|
'fastdds_no_shared_memory.xml': usr/share/
|
||||||
plugs:
|
|
||||||
micro-ros-agent-shm-netplug:
|
|
||||||
interface: system-files
|
|
||||||
allow-auto-connection: true
|
|
||||||
write:
|
|
||||||
- /dev/shm
|
|
||||||
|
|
||||||
apps:
|
apps:
|
||||||
micro-ros-agent:
|
micro-ros-agent:
|
||||||
command: lib/micro_ros_agent/micro_ros_agent
|
command: opt/ros/snap/lib/micro_ros_agent/micro_ros_agent
|
||||||
environment:
|
environment:
|
||||||
LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:$SNAP/lib"
|
FASTRTPS_DEFAULT_PROFILES_FILE: ${SNAP}/usr/share/fastdds_no_shared_memory.xml
|
||||||
plugs: [network, network-bind, serial-port, micro-ros-agent-shm-netplug]
|
plugs: [network, network-bind, serial-port]
|
||||||
extensions: [ros2-foxy]
|
extensions: [ros2-foxy]
|
||||||
|
|
||||||
daemon:
|
daemon:
|
||||||
command: usr/bin/micro-ros-agent-daemon
|
command: usr/bin/micro-ros-agent-daemon
|
||||||
environment:
|
environment:
|
||||||
LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:$SNAP/lib"
|
FASTRTPS_DEFAULT_PROFILES_FILE: ${SNAP}/usr/share/fastdds_no_shared_memory.xml
|
||||||
daemon: simple
|
daemon: simple
|
||||||
plugs: [network, network-bind, serial-port, micro-ros-agent-shm-netplug]
|
plugs: [network, network-bind, serial-port]
|
||||||
|
extensions: [ros2-foxy]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user