Skip to content

Commit 41389d3

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 a64051f commit 41389d3

12 files changed

+478
-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
/******************************************************************************
@@ -413,13 +412,13 @@ class RMW_Connext_Subscriber
413412
qos(rmw_qos_profile_t * const qos);
414413

415414
rmw_ret_t
416-
loan_messages();
415+
loan_messages(const bool update_condition = true);
417416

418417
rmw_ret_t
419418
return_messages();
420419

421420
rmw_ret_t
422-
loan_messages_if_needed()
421+
loan_messages_if_needed(const bool update_condition = true)
423422
{
424423
rmw_ret_t rc = RMW_RET_OK;
425424

@@ -434,16 +433,12 @@ class RMW_Connext_Subscriber
434433
}
435434
}
436435
/* loan messages from reader */
437-
rc = this->loan_messages();
436+
rc = this->loan_messages(update_condition);
438437
if (RMW_RET_OK != rc) {
439438
return rc;
440439
}
441440
}
442441

443-
if (this->internal) {
444-
return this->status_condition.trigger_loan_guard_condition(this->loan_len > 0);
445-
}
446-
447442
return RMW_RET_OK;
448443
}
449444

@@ -479,7 +474,9 @@ class RMW_Connext_Subscriber
479474
has_data()
480475
{
481476
std::lock_guard<std::mutex> lock(this->loan_mutex);
482-
if (RMW_RET_OK != this->loan_messages_if_needed()) {
477+
if (RMW_RET_OK !=
478+
this->loan_messages_if_needed(false /* update_condition */))
479+
{
483480
RMW_CONNEXT_LOG_ERROR("failed to check loaned messages")
484481
return false;
485482
}

0 commit comments

Comments
 (0)