Skip to content

Commit 079c5c8

Browse files
committed
Resolve issues identified while investigating #21 (#22)
* Use C++ std WaitSets by default Signed-off-by: Andrea Sorbini <[email protected]> * Use Rolling in README's Quick Start Signed-off-by: Andrea Sorbini <[email protected]> * Improved implementation of client::is_service_available for Connext Pro Signed-off-by: Andrea Sorbini <[email protected]> * Only add request header to typecode with Basic req/rep profile Signed-off-by: Andrea Sorbini <[email protected]> * Remove commented/unused code Signed-off-by: Andrea Sorbini <[email protected]> * Avoid topic name validation in get_info functions Signed-off-by: Andrea Sorbini <[email protected]> * Reduce shutdown period to 10ms Signed-off-by: Andrea Sorbini <[email protected]> * Pass HistoryQosPolicy to graph cache * Reset error string after looking up type support Signed-off-by: Andrea Sorbini <[email protected]> * Remove DDS-based WaitSet implementation Signed-off-by: Andrea Sorbini <[email protected]>
1 parent dce0e8d commit 079c5c8

12 files changed

+479
-402
lines changed

rmw_connextdds_common/CMakeLists.txt

-11
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,6 @@ function(rtirmw_add_library)
8181
CACHE INTERNAL "")
8282
endif()
8383

84-
if(NOT "${RMW_CONNEXT_WAITSET_MODE}" STREQUAL "")
85-
string(TOUPPER "${RMW_CONNEXT_WAITSET_MODE}" rmw_connext_waitset_mode)
86-
if(rmw_connext_waitset_mode STREQUAL "STD")
87-
list(APPEND private_defines "RMW_CONNEXT_CPP_STD_WAITSETS=1")
88-
endif()
89-
set(RMW_CONNEXT_WAITSET_MODE "${RMW_CONNEXT_WAITSET_MODE}"
90-
CACHE INTERNAL "")
91-
endif()
92-
9384
target_compile_definitions(${_rti_build_NAME} PRIVATE ${private_defines})
9485

9586
# Causes the visibility macros to use dllexport rather than dllimport,
@@ -136,7 +127,6 @@ set(RMW_CONNEXT_COMMON_SOURCE_CPP
136127
src/common/rmw_graph.cpp
137128
src/common/rmw_event.cpp
138129
src/common/rmw_impl.cpp
139-
src/common/rmw_impl_waitset_dds.cpp
140130
src/common/rmw_impl_waitset_std.cpp
141131
src/common/rmw_info.cpp
142132
src/common/rmw_node.cpp
@@ -159,7 +149,6 @@ set(RMW_CONNEXT_COMMON_SOURCE_HPP
159149
include/rmw_connextdds/resource_limits.hpp
160150
include/rmw_connextdds/rmw_impl.hpp
161151
include/rmw_connextdds/rmw_api_impl.hpp
162-
include/rmw_connextdds/rmw_waitset_dds.hpp
163152
include/rmw_connextdds/rmw_waitset_std.hpp
164153
include/rmw_connextdds/scope_exit.hpp
165154
include/rmw_connextdds/static_config.hpp

rmw_connextdds_common/include/rmw_connextdds/dds_api_ndds.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,8 @@ typedef RMW_Connext_Uint8ArrayPtrSeq RMW_Connext_UntypedSampleSeq;
4141
// the guid with 0's.
4242
#define DDS_SampleIdentity_UNKNOWN DDS_SAMPLEIDENTITY_DEFAULT
4343

44+
// Convenience function to compare the first 12 bytes of the handle
45+
#define DDS_InstanceHandle_compare_prefix(ih_a_, ih_b_) \
46+
memcmp((ih_a_)->keyHash.value, (ih_b_)->keyHash.value, 12)
47+
4448
#endif // RMW_CONNEXTDDS__DDS_API_NDDS_HPP_

rmw_connextdds_common/include/rmw_connextdds/dds_api_rtime.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,8 @@ struct DDS_LifespanQosPolicy;
6666
// the guid with 0's.
6767
#define DDS_SampleIdentity_UNKNOWN DDS_SAMPLE_IDENTITY_UNKNOWN
6868

69+
// Convenience function to compare the first 12 bytes of the handle
70+
#define DDS_InstanceHandle_compare_prefix(ih_a_, ih_b_) \
71+
memcmp((ih_a_)->octet, (ih_b_)->octet, 12)
72+
6973
#endif // RMW_CONNEXTDDS__DDS_API_RTIME_HPP_

rmw_connextdds_common/include/rmw_connextdds/rmw_impl.hpp

+6-9
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ class RMW_Connext_Subscriber;
117117
class RMW_Connext_Client;
118118
class RMW_Connext_Service;
119119

120-
#include "rmw_connextdds/rmw_waitset_dds.hpp"
121120
#include "rmw_connextdds/rmw_waitset_std.hpp"
122121

123122
/******************************************************************************
@@ -411,13 +410,13 @@ class RMW_Connext_Subscriber
411410
qos(rmw_qos_profile_t * const qos);
412411

413412
rmw_ret_t
414-
loan_messages();
413+
loan_messages(const bool update_condition = true);
415414

416415
rmw_ret_t
417416
return_messages();
418417

419418
rmw_ret_t
420-
loan_messages_if_needed()
419+
loan_messages_if_needed(const bool update_condition = true)
421420
{
422421
rmw_ret_t rc = RMW_RET_OK;
423422

@@ -432,16 +431,12 @@ class RMW_Connext_Subscriber
432431
}
433432
}
434433
/* loan messages from reader */
435-
rc = this->loan_messages();
434+
rc = this->loan_messages(update_condition);
436435
if (RMW_RET_OK != rc) {
437436
return rc;
438437
}
439438
}
440439

441-
if (this->internal) {
442-
return this->status_condition.trigger_loan_guard_condition(this->loan_len > 0);
443-
}
444-
445440
return RMW_RET_OK;
446441
}
447442

@@ -477,7 +472,9 @@ class RMW_Connext_Subscriber
477472
has_data()
478473
{
479474
std::lock_guard<std::mutex> lock(this->loan_mutex);
480-
if (RMW_RET_OK != this->loan_messages_if_needed()) {
475+
if (RMW_RET_OK !=
476+
this->loan_messages_if_needed(false /* update_condition */))
477+
{
481478
RMW_CONNEXT_LOG_ERROR("failed to check loaned messages")
482479
return false;
483480
}

0 commit comments

Comments
 (0)