Skip to content

Commit 8bb6bee

Browse files
authored
Branch-out for fastdds 3.0.x (#69)
* branch-out for fastdds 3.0.x Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> * Refs #20378: Update dependencies, change name folders Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> * Refs #20378: Remove variable not used Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> * Refs #20378: Update on_participant_discovery override with new version Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> * Refs #20378: Apply suggestion Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> --------- Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
1 parent 4d7266e commit 8bb6bee

18 files changed

Lines changed: 41 additions & 82 deletions

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ endif()
155155

156156
find_package(fastcdr REQUIRED )
157157
# new DDS API is required
158-
find_package(fastrtps 2 REQUIRED)
158+
find_package(fastdds 3 REQUIRED)
159159
find_package(OpenSSL QUIET) # according to cmake docs on FindOpenSS is hinted define OPENSSL_ROOT_DIR
160160

161161
#some tests require python
@@ -275,11 +275,11 @@ endif()
275275
# called in the current directory scope or above.
276276
# We must populate this variables as project sources grow
277277

278-
# Set fast-RTPS source files
278+
# Set Fast DDS source files
279279

280280
# add fast headers to enable class view on visual studio IDE
281281
if (WIN32)
282-
get_target_property(FAST_INCLUDE_DIR fastrtps INTERFACE_INCLUDE_DIRECTORIES)
282+
get_target_property(FAST_INCLUDE_DIR fastdds INTERFACE_INCLUDE_DIRECTORIES)
283283
list(GET FAST_INCLUDE_DIR 0 FAST_INCLUDE_DIR)
284284
#get_filename_component(FAST_INCLUDE_DIR "${FAST_INCLUDE_DIR}" DIRECTORY )
285285

@@ -365,7 +365,7 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE
365365
#endif()
366366

367367
# we link dynamically to tinyxml2
368-
target_link_libraries(${PROJECT_NAME} PUBLIC fastrtps fastcdr
368+
target_link_libraries(${PROJECT_NAME} PUBLIC fastdds fastcdr
369369
${TINYXML2_LIBRARY}
370370
${OPENSSL_TARGET}
371371
)

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The **Discovery Server tool documentation** can be found
4545
## Installation Guide
4646

4747
In order to use the Discovery Server tool, it is necessary to have a compatible version of
48-
[eProsima Fast DDS](https://eprosima-fast-rtps.readthedocs.io/en/latest/) installed (over release 2.0.2).
48+
[eProsima Fast DDS](https://fast-dds.docs.eprosima.com/en/latest/) installed (over release 3.0.0).
4949
*Fast DDS* dependencies as tinyxml must be accessible, either because *Fast DDS* was build-installed defining
5050
`THIRDPARTY=ON|FORCE` or because those libraries have been specifically installed.
5151
The well known cross-platform tool [colcon](https://colcon.readthedocs.io/en/released/) was chosen to simplify the
@@ -188,10 +188,10 @@ the `discovery-server-ws/src` directory:
188188
189189
| PACKAGE | URL | BRANCH |
190190
|:-----------------------------------|:--------------------------------------------------------|:-----------:|
191-
| eProsima/Fast-CDR: | https://github.com/eProsima/Fast-CDR.git | master |
192-
| eProsima/Fast-RTPS: | https://github.com/eProsima/Fast-RTPS.git | master |
193-
| eProsima/Discovery-Server: | https://github.com/eProsima/Discovery-Server.git | master |
194-
| eProsima/foonathan_memory_vendor: | https://github.com/eProsima/foonathan_memory_vendor.git | master |
191+
| fastcdr: | https://github.com/eProsima/Fast-CDR.git | master |
192+
| fastdds: | https://github.com/eProsima/Fast-DDS.git | master |
193+
| discovery_server: | https://github.com/eProsima/Discovery-Server.git | master |
194+
| foonathan_memory_vendor: | https://github.com/eProsima/foonathan_memory_vendor.git | master |
195195
| leethomason/tinyxml2: | https://github.com/leethomason/tinyxml2.git | master |
196196
197197
---

colcon.pkg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"name": "discovery-server",
33
"type": "cmake",
4-
"build-dependencies": ["fastcdr", "fastrtps", "tinyxml2"]
4+
"build-dependencies": ["fastcdr", "fastdds", "tinyxml2"]
55
}

discovery-server.repos

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
repositories:
2-
eProsima/Fast-CDR:
2+
fastcdr:
33
type: git
44
url: https://github.com/eProsima/Fast-CDR.git
55
version: master
6-
eProsima/Fast-RTPS:
6+
fastdds:
77
type: git
8-
url: https://github.com/eProsima/Fast-RTPS.git
8+
url: https://github.com/eProsima/Fast-DDS.git
99
version: master
10-
eProsima/Discovery-Server:
10+
discovery_server:
1111
type: git
1212
url: https://github.com/eProsima/Discovery-Server.git
1313
version: master

examples/HelloWorldExampleDS/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND)
2121
find_package(fastcdr REQUIRED)
2222
endif()
2323

24-
if(NOT fastrtps_FOUND)
25-
find_package(fastrtps REQUIRED)
24+
if(NOT fastdds_FOUND)
25+
find_package(fastdds REQUIRED)
2626
endif()
2727

2828
# Set C++11
@@ -45,7 +45,7 @@ file(GLOB HELLOWORLD_EXAMPLE_HEADERS "*.h")
4545
add_executable(HelloWorldExampleDS ${HELLOWORLD_EXAMPLE_SOURCES_CXX} ${HELLOWORLD_EXAMPLE_SOURCES_CPP}
4646
${HELLOWORLD_EXAMPLE_HEADERS} ${ALL_FAST_HEADERS})
4747

48-
target_link_libraries(HelloWorldExampleDS fastrtps fastcdr)
48+
target_link_libraries(HelloWorldExampleDS fastdds fastcdr)
4949

5050
# Properties that change bin names depending on current config.
5151
# This is convenient because on installation all bins share folder

examples/HelloWorldExampleDS/HelloWorldPublisher.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ bool HelloWorldPublisher::init(
8282
std::default_random_engine gen(std::chrono::system_clock::now().time_since_epoch().count());
8383
std::uniform_int_distribution<int> rdn(57344, 65535);
8484
descriptor->add_listener_port(rdn(gen)); // IANA ephemeral port number
85-
descriptor->wait_for_tcp_negotiation = false;
8685
participant_qos.transport().user_transports.push_back(descriptor);
8786
}
8887
else

examples/HelloWorldExampleDS/HelloWorldServer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ bool HelloWorldServer::init(
8080
descriptor = std::make_shared<TCPv6TransportDescriptor>();
8181
}
8282

83-
descriptor->wait_for_tcp_negotiation = false;
8483
descriptor->add_listener_port(default_port);
8584
participant_qos.transport().use_builtin_transports = false;
8685
participant_qos.transport().user_transports.push_back(descriptor);

examples/HelloWorldExampleDS/HelloWorldSubscriber.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ bool HelloWorldSubscriber::init(
7878
std::default_random_engine gen(std::chrono::system_clock::now().time_since_epoch().count());
7979
std::uniform_int_distribution<int> rdn(49152, 57343);
8080
descriptor->add_listener_port(rdn(gen)); // IANA ephemeral port number
81-
descriptor->wait_for_tcp_negotiation = false;
8281
participant_qos.transport().user_transports.push_back(descriptor);
8382
}
8483
else

include/DiscoveryServerManager.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,7 @@ class DiscoveryServerManager
187187
DiscoveryServerManager(
188188
const std::string& xml_file_path,
189189
const bool shared_memory_off);
190-
#if FASTRTPS_VERSION_MAJOR >= 2 && FASTRTPS_VERSION_MINOR >= 2
191-
FASTDDS_DEPRECATED_UNTIL(3, "eprosima::discovery_server::DiscoveryServerManager(const std::set<std::string>& xml_snapshot_files,"
192-
"const std::string & output_file)",
193-
"Old Discovery Server v1 constructor to validate.")
194-
#endif // if FASTRTPS_VERSION_MAJOR >= 2 && FASTRTPS_VERSION_MINOR >= 2
195-
DiscoveryServerManager(
196-
const std::set<std::string>& xml_snapshot_files,
197-
const std::string& output_file);
190+
198191
~DiscoveryServerManager();
199192

200193
// testing database
@@ -290,7 +283,8 @@ class DiscoveryServerManager
290283
// callback discovery functions
291284
void on_participant_discovery(
292285
DomainParticipant* participant,
293-
ParticipantDiscoveryInfo&& info) override;
286+
ParticipantDiscoveryInfo&& info,
287+
bool& should_be_ignored) override;
294288

295289
void on_subscriber_discovery(
296290
DomainParticipant* participant,

include/IDs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static const std::string s_sAliveCount("alive_count");
7272
static const std::string s_sNotAliveCount("not_alive_count");
7373
static const std::string s_sDiscovered_timestamp("discovered_timestamp");
7474

75-
} // fastrtps
7675
} // discovery_server
76+
} // eprosima
7777

7878
#endif // _IDS_H_

0 commit comments

Comments
 (0)