Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to use DDS standard API #518

Merged
merged 60 commits into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
360fb1c
Revert "Unique network flows (#502)"
MiguelCompany Apr 5, 2021
7e86405
rebase first steps
Jan 28, 2021
3e14ccf
rebase second steps
Feb 3, 2021
d44ea5f
rebase third steps, compiling
Feb 3, 2021
780780d
uncrustify
Feb 4, 2021
bd69cbc
rmw fastrtps clean state
Feb 5, 2021
0da237b
fix bugs in client, participant and take
Feb 10, 2021
0ecc209
fix cpplint and uncrustify
Feb 10, 2021
f532601
construct Lonable Sequence to avoid heap allocations
Feb 10, 2021
d7cac45
uncrustify
Feb 10, 2021
abff9e4
Use valid_data instead of instance_state.
MiguelCompany Mar 4, 2021
13918dc
Fix build with security enabled.
MiguelCompany Mar 4, 2021
290836c
Solve link problems on Windows.
MiguelCompany Mar 4, 2021
50b5357
Restore old rmw_take_sequence code.
MiguelCompany Mar 5, 2021
80307e7
Fixed warning.
MiguelCompany Mar 5, 2021
429b981
Added more topic related methods to utils.
MiguelCompany Mar 5, 2021
932ce83
Mutex renamed.
MiguelCompany Mar 8, 2021
1ddb9d7
Publisher types changed.
MiguelCompany Mar 5, 2021
befb40d
Subscription types changed.
MiguelCompany Mar 5, 2021
fb5bb55
Cilent types changed.
MiguelCompany Mar 8, 2021
a634cd3
Service types changed.
MiguelCompany Mar 8, 2021
6beea1f
Removed create_topic_rmw
MiguelCompany Mar 9, 2021
179679b
Removed topics_list_
MiguelCompany Mar 9, 2021
972775f
Linters
MiguelCompany Mar 9, 2021
5d2b138
Addressed internal review comments
MiguelCompany Mar 11, 2021
db3a1ab
Addressed internal review comments
MiguelCompany Mar 15, 2021
41afcf3
Linters
MiguelCompany Mar 15, 2021
36c04d1
Addressed internal review comments
MiguelCompany Mar 16, 2021
f634b96
Addressed internal review comments
MiguelCompany Mar 16, 2021
9a0382c
Improvements on destroy_participant.
MiguelCompany Mar 18, 2021
5c75031
Correctly cleanup when deleting participant.
MiguelCompany Mar 18, 2021
9e7c92f
Linters
MiguelCompany Mar 18, 2021
a3bfff8
Fixed duration conversions on rtps_qos_to_rmw_qos
MiguelCompany Mar 18, 2021
4d9c19c
Added test for dds_qos_to_rmw_qos
MiguelCompany Mar 18, 2021
9cefd7e
Improvements on destroy_client
MiguelCompany Mar 18, 2021
6e1c82f
Improvements on destroy_service
MiguelCompany Mar 18, 2021
f6dd571
Linters
MiguelCompany Mar 18, 2021
732d814
Avoid API break on native getters.
MiguelCompany Mar 22, 2021
c2f6899
Removed old native getters API.
MiguelCompany Mar 31, 2021
7ad1f99
Use pointers on output arguments.
MiguelCompany Mar 31, 2021
c7a5149
Flip operands on equal comparisons.
MiguelCompany Mar 31, 2021
30a462b
Apply suggestions on destroy_service and destroy_client.
MiguelCompany Mar 31, 2021
0c988c7
Added topic holder utility.
MiguelCompany Mar 31, 2021
745e152
Apply suggestions on publisher creation.
MiguelCompany Mar 31, 2021
7898d5e
Apply suggestions on subscription creation.
MiguelCompany Mar 31, 2021
f1d4621
Apply suggestions on client creation.
MiguelCompany Mar 31, 2021
7ed04a1
Apply suggestions on service creation.
MiguelCompany Mar 31, 2021
940ac4a
Linters
MiguelCompany Mar 31, 2021
88d6ac0
Using auto where possible.
MiguelCompany Mar 31, 2021
f4e24ec
Documentation on utils.hpp
MiguelCompany Mar 31, 2021
87b2371
Linters
MiguelCompany Mar 31, 2021
6ac968a
Fixed some basic review comments.
MiguelCompany Apr 5, 2021
1e8f025
Removed redundant initialization of listeners.
MiguelCompany Apr 5, 2021
2f82295
Fixed doxygen
MiguelCompany Apr 5, 2021
5823fd3
Use snake_case variable names.
MiguelCompany Apr 5, 2021
7a2a52a
Reduced cleanup lambdas.
MiguelCompany Apr 5, 2021
28b3b0f
Apply suggestions on destroy_participant.
MiguelCompany Apr 5, 2021
fd6fe5d
Apply suggestions on destroy_publisher and destroy_subscription.
MiguelCompany Apr 5, 2021
e0b0b01
Unique network flows (#502)
MiguelCompany Apr 5, 2021
2f4e0cc
Fix segfault on cleanup lambda
MiguelCompany Apr 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Addressed internal review comments
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
  • Loading branch information
MiguelCompany committed Apr 5, 2021
commit 36c04d1682e13f1f0345ee50380b07d2001df68a
4 changes: 2 additions & 2 deletions rmw_fastrtps_cpp/src/rmw_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ rmw_create_client(
eprosima::fastdds::dds::DataReaderQos dataReaderQos = subscriber->get_default_datareader_qos();

// Try to load the profile named "client",
// if it does not exist it tryes with the response topic name
// if it does not exist it tries with the response topic name
// It does not need to check the return code, as if any of the profile does not exist,
// the QoS is already set correctly:
// If none exist is default, if only one exists is the one chosen,
Expand Down Expand Up @@ -392,7 +392,7 @@ rmw_create_client(
eprosima::fastdds::dds::DataWriterQos dataWriterQos = publisher->get_default_datawriter_qos();

// Try to load the profile named "client",
// if it does not exist it tryes with the request topic name
// if it does not exist it tries with the request topic name
// It does not need to check the return code, as if any of the profile does not exist,
// the QoS is already set correctly:
// If none exist is default, if only one exists is the one chosen,
Expand Down
4 changes: 2 additions & 2 deletions rmw_fastrtps_cpp/src/rmw_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ rmw_create_service(
eprosima::fastdds::dds::DataReaderQos dataReaderQos = subscriber->get_default_datareader_qos();

// Try to load the profile named "service",
// if it does not exist it tryes with the request topic name
// if it does not exist it tries with the request topic name
// It does not need to check the return code, as if any of the profile does not exist,
// the QoS is already set correctly:
// If none exist is default, if only one exists is the one chosen,
Expand Down Expand Up @@ -395,7 +395,7 @@ rmw_create_service(
eprosima::fastdds::dds::DataWriterQos dataWriterQos = publisher->get_default_datawriter_qos();

// Try to load the profile named "service",
// if it does not exist it tryes with the request topic name
// if it does not exist it tries with the request topic name
// It does not need to check the return code, as if any of the profile does not exist,
// the QoS is already set correctly:
// If none exist is default, if only one exists is the one chosen,
Expand Down
4 changes: 2 additions & 2 deletions rmw_fastrtps_cpp/src/subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ create_subscription(
}

/////
// Create the RMW Subscriber struct (info)
// Create the custom Subscriber struct (info)
CustomSubscriberInfo * info = nullptr;

info = new (std::nothrow) CustomSubscriberInfo();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MiguelCompany nit^2: collapse the last two lines in one.

Expand All @@ -169,7 +169,7 @@ create_subscription(
});

info->typesupport_identifier_ = type_support->typesupport_identifier;
info->type_support_impl_ = type_support->data;
info->type_support_impl_ = callbacks;

/////
// Create the Type Support struct
Expand Down
8 changes: 4 additions & 4 deletions rmw_fastrtps_dynamic_cpp/src/rmw_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ rmw_create_client(
});

if (ReturnCode_t::RETCODE_OK != response_fastdds_type.register_type(domainParticipant)) {
RMW_SET_ERROR_MSG("create_client() failed to register request type");
RMW_SET_ERROR_MSG("create_client() failed to register response type");
return nullptr;
}
info->response_type_support_ = response_fastdds_type;
Expand Down Expand Up @@ -370,15 +370,15 @@ rmw_create_client(
std::string topic_name_fallback = "client";

/////
// Create request DataReader
// Create response DataReader

// If FASTRTPS_DEFAULT_PROFILES_FILE defined, fill DataReader QoS with a subscriber profile
// located based on topic name defined by _create_topic_name(). If no profile is found, a search
// with profile_name "client" is attempted. Else, use the default Fast DDS QoS.
eprosima::fastdds::dds::DataReaderQos dataReaderQos = subscriber->get_default_datareader_qos();

// Try to load the profile named "client",
// if it does not exist it tryes with the request topic name
// if it does not exist it tries with the response topic name
// It does not need to check the return code, as if any of the profile does not exist,
// the QoS is already set correctly:
// If none exist is default, if only one exists is the one chosen,
Expand Down Expand Up @@ -419,7 +419,7 @@ rmw_create_client(
eprosima::fastdds::dds::DataWriterQos dataWriterQos = publisher->get_default_datawriter_qos();

// Try to load the profile named "client",
// if it does not exist it tryes with the request topic name
// if it does not exist it tries with the request topic name
// It does not need to check the return code, as if any of the profile does not exist,
// the QoS is already set correctly:
// If none exist is default, if only one exists is the one chosen,
Expand Down
6 changes: 3 additions & 3 deletions rmw_fastrtps_dynamic_cpp/src/rmw_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ rmw_create_service(
}

/////
// Create the RMW Service struct (info)
// Create the custom Service struct (info)
CustomServiceInfo * info = new (std::nothrow) CustomServiceInfo();
if (!info) {
RMW_SET_ERROR_MSG("create_service() failed to allocate custom info");
Expand Down Expand Up @@ -380,7 +380,7 @@ rmw_create_service(
eprosima::fastdds::dds::DataReaderQos dataReaderQos = subscriber->get_default_datareader_qos();

// Try to load the profile named "service",
// if it does not exist it tryes with the request topic name
// if it does not exist it tries with the request topic name
// It does not need to check the return code, as if any of the profile does not exist,
// the QoS is already set correctly:
// If none exist is default, if only one exists is the one chosen,
Expand Down Expand Up @@ -425,7 +425,7 @@ rmw_create_service(
eprosima::fastdds::dds::DataWriterQos dataWriterQos = publisher->get_default_datawriter_qos();

// Try to load the profile named "service",
// if it does not exist it tryes with the request topic name
// if it does not exist it tries with the request topic name
// It does not need to check the return code, as if any of the profile does not exist,
// the QoS is already set correctly:
// If none exist is default, if only one exists is the one chosen,
Expand Down
6 changes: 4 additions & 2 deletions rmw_fastrtps_dynamic_cpp/src/subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ create_subscription(
bool keyed,
bool create_subscription_listener)
{
RCUTILS_CAN_RETURN_WITH_ERROR_OF(nullptr);

/////
// Check input parameters
RMW_CHECK_ARGUMENT_FOR_NULL(participant_info, nullptr);
Expand Down Expand Up @@ -150,13 +152,13 @@ create_subscription(
fastdds_type))
{
RMW_SET_ERROR_MSG_WITH_FORMAT_STRING(
"create_publisher() called with existing topic name %s with incompatible type %s",
"create_subscription() called with existing topic name %s with incompatible type %s",
topic_name_mangled.c_str(), type_name.c_str());
return nullptr;
}

/////
// Create the RMW Subscriber struct (info)
// Create the custom Subscriber struct (info)
CustomSubscriberInfo * info = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MiguelCompany nit: consider declaring and initializing on the same line.


info = new (std::nothrow) CustomSubscriberInfo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@

#include "rcpputils/thread_safety_annotations.hpp"

#include "rmw_fastrtps_shared_cpp/TypeSupport.hpp"

class ClientListener;
class ClientPubListener;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include "rcpputils/thread_safety_annotations.hpp"
#include "rmw/rmw.h"

#include "rmw_fastrtps_shared_cpp/TypeSupport.hpp"
#include "rmw_fastrtps_shared_cpp/custom_event_info.hpp"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

#include "rcpputils/thread_safety_annotations.hpp"

#include "rmw_fastrtps_shared_cpp/TypeSupport.hpp"
#include "rmw_fastrtps_shared_cpp/guid_utils.hpp"

class ServiceListener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

#include "rmw/impl/cpp/macros.hpp"

#include "rmw_fastrtps_shared_cpp/TypeSupport.hpp"
#include "rmw_fastrtps_shared_cpp/custom_event_info.hpp"


Expand Down
2 changes: 0 additions & 2 deletions rmw_fastrtps_shared_cpp/src/rmw_take.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <vector>

#include "rmw/allocators.h"
#include "rmw/error_handling.h"
#include "rmw/serialized_message.h"
Expand Down