Skip to content

Commit

Permalink
Backport #22 to branch eloquent (#31)
Browse files Browse the repository at this point in the history
* 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]>

* Remove unavailable time helpers

Signed-off-by: Andrea Sorbini <[email protected]>

* Remove unsupported QoS event

Signed-off-by: Andrea Sorbini <[email protected]>
  • Loading branch information
asorbini authored Apr 14, 2021
1 parent a64051f commit 48a20f5
Show file tree
Hide file tree
Showing 12 changed files with 477 additions and 409 deletions.
11 changes: 0 additions & 11 deletions rmw_connextdds_common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,6 @@ function(rtirmw_add_library)
CACHE INTERNAL "")
endif()

if(NOT "${RMW_CONNEXT_WAITSET_MODE}" STREQUAL "")
string(TOUPPER "${RMW_CONNEXT_WAITSET_MODE}" rmw_connext_waitset_mode)
if(rmw_connext_waitset_mode STREQUAL "STD")
list(APPEND private_defines "RMW_CONNEXT_CPP_STD_WAITSETS=1")
endif()
set(RMW_CONNEXT_WAITSET_MODE "${RMW_CONNEXT_WAITSET_MODE}"
CACHE INTERNAL "")
endif()

target_compile_definitions(${_rti_build_NAME} PRIVATE ${private_defines})

# Causes the visibility macros to use dllexport rather than dllimport,
Expand Down Expand Up @@ -136,7 +127,6 @@ set(RMW_CONNEXT_COMMON_SOURCE_CPP
src/common/rmw_graph.cpp
src/common/rmw_event.cpp
src/common/rmw_impl.cpp
src/common/rmw_impl_waitset_dds.cpp
src/common/rmw_impl_waitset_std.cpp
src/common/rmw_info.cpp
src/common/rmw_node.cpp
Expand All @@ -159,7 +149,6 @@ set(RMW_CONNEXT_COMMON_SOURCE_HPP
include/rmw_connextdds/resource_limits.hpp
include/rmw_connextdds/rmw_impl.hpp
include/rmw_connextdds/rmw_api_impl.hpp
include/rmw_connextdds/rmw_waitset_dds.hpp
include/rmw_connextdds/rmw_waitset_std.hpp
include/rmw_connextdds/scope_exit.hpp
include/rmw_connextdds/static_config.hpp
Expand Down
4 changes: 4 additions & 0 deletions rmw_connextdds_common/include/rmw_connextdds/dds_api_ndds.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,8 @@ typedef RMW_Connext_Uint8ArrayPtrSeq RMW_Connext_UntypedSampleSeq;
// the guid with 0's.
#define DDS_SampleIdentity_UNKNOWN DDS_SAMPLEIDENTITY_DEFAULT

// Convenience function to compare the first 12 bytes of the handle
#define DDS_InstanceHandle_compare_prefix(ih_a_, ih_b_) \
memcmp((ih_a_)->keyHash.value, (ih_b_)->keyHash.value, 12)

#endif // RMW_CONNEXTDDS__DDS_API_NDDS_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,8 @@ struct DDS_LifespanQosPolicy;
// the guid with 0's.
#define DDS_SampleIdentity_UNKNOWN DDS_SAMPLE_IDENTITY_UNKNOWN

// Convenience function to compare the first 12 bytes of the handle
#define DDS_InstanceHandle_compare_prefix(ih_a_, ih_b_) \
memcmp((ih_a_)->octet, (ih_b_)->octet, 12)

#endif // RMW_CONNEXTDDS__DDS_API_RTIME_HPP_
15 changes: 6 additions & 9 deletions rmw_connextdds_common/include/rmw_connextdds/rmw_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ class RMW_Connext_Subscriber;
class RMW_Connext_Client;
class RMW_Connext_Service;

#include "rmw_connextdds/rmw_waitset_dds.hpp"
#include "rmw_connextdds/rmw_waitset_std.hpp"

/******************************************************************************
Expand Down Expand Up @@ -413,13 +412,13 @@ class RMW_Connext_Subscriber
qos(rmw_qos_profile_t * const qos);

rmw_ret_t
loan_messages();
loan_messages(const bool update_condition = true);

rmw_ret_t
return_messages();

rmw_ret_t
loan_messages_if_needed()
loan_messages_if_needed(const bool update_condition = true)
{
rmw_ret_t rc = RMW_RET_OK;

Expand All @@ -434,16 +433,12 @@ class RMW_Connext_Subscriber
}
}
/* loan messages from reader */
rc = this->loan_messages();
rc = this->loan_messages(update_condition);
if (RMW_RET_OK != rc) {
return rc;
}
}

if (this->internal) {
return this->status_condition.trigger_loan_guard_condition(this->loan_len > 0);
}

return RMW_RET_OK;
}

Expand Down Expand Up @@ -479,7 +474,9 @@ class RMW_Connext_Subscriber
has_data()
{
std::lock_guard<std::mutex> lock(this->loan_mutex);
if (RMW_RET_OK != this->loan_messages_if_needed()) {
if (RMW_RET_OK !=
this->loan_messages_if_needed(false /* update_condition */))
{
RMW_CONNEXT_LOG_ERROR("failed to check loaned messages")
return false;
}
Expand Down
Loading

0 comments on commit 48a20f5

Please sign in to comment.