Skip to content

Commit 61c74fd

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 3004323 commit 61c74fd

12 files changed

+502
-385
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,
@@ -138,7 +129,6 @@ set(RMW_CONNEXT_COMMON_SOURCE_CPP
138129
src/common/rmw_graph.cpp
139130
src/common/rmw_event.cpp
140131
src/common/rmw_impl.cpp
141-
src/common/rmw_impl_waitset_dds.cpp
142132
src/common/rmw_impl_waitset_std.cpp
143133
src/common/rmw_info.cpp
144134
src/common/rmw_node.cpp
@@ -162,7 +152,6 @@ set(RMW_CONNEXT_COMMON_SOURCE_HPP
162152
include/rmw_connextdds/resource_limits.hpp
163153
include/rmw_connextdds/rmw_impl.hpp
164154
include/rmw_connextdds/rmw_api_impl.hpp
165-
include/rmw_connextdds/rmw_waitset_dds.hpp
166155
include/rmw_connextdds/rmw_waitset_std.hpp
167156
include/rmw_connextdds/scope_exit.hpp
168157
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
@@ -114,7 +114,6 @@ class RMW_Connext_Subscriber;
114114
class RMW_Connext_Client;
115115
class RMW_Connext_Service;
116116

117-
#include "rmw_connextdds/rmw_waitset_dds.hpp"
118117
#include "rmw_connextdds/rmw_waitset_std.hpp"
119118

120119
/******************************************************************************
@@ -410,13 +409,13 @@ class RMW_Connext_Subscriber
410409
qos(rmw_qos_profile_t * const qos);
411410

412411
rmw_ret_t
413-
loan_messages();
412+
loan_messages(const bool update_condition = true);
414413

415414
rmw_ret_t
416415
return_messages();
417416

418417
rmw_ret_t
419-
loan_messages_if_needed()
418+
loan_messages_if_needed(const bool update_condition = true)
420419
{
421420
rmw_ret_t rc = RMW_RET_OK;
422421

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

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

@@ -483,7 +478,9 @@ class RMW_Connext_Subscriber
483478
has_data()
484479
{
485480
std::lock_guard<std::mutex> lock(this->loan_mutex);
486-
if (RMW_RET_OK != this->loan_messages_if_needed()) {
481+
if (RMW_RET_OK !=
482+
this->loan_messages_if_needed(false /* update_condition */))
483+
{
487484
RMW_CONNEXT_LOG_ERROR("failed to check loaned messages")
488485
return false;
489486
}

0 commit comments

Comments
 (0)