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 all commits
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
4 changes: 2 additions & 2 deletions rmw_fastrtps_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ find_package(rmw_fastrtps_shared_cpp REQUIRED)

find_package(fastrtps_cmake_module REQUIRED)
find_package(fastcdr REQUIRED CONFIG)
find_package(fastrtps REQUIRED CONFIG)
find_package(FastRTPS REQUIRED MODULE)
find_package(fastrtps 2.3 REQUIRED CONFIG)
find_package(FastRTPS 2.3 REQUIRED MODULE)

find_package(rmw REQUIRED)
find_package(rosidl_runtime_c REQUIRED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
#ifndef RMW_FASTRTPS_CPP__SERVICETYPESUPPORT_HPP_
#define RMW_FASTRTPS_CPP__SERVICETYPESUPPORT_HPP_

#include <fastcdr/FastBuffer.h>
#include <fastcdr/Cdr.h>
#include <cassert>

#include "fastcdr/FastBuffer.h"
#include "fastcdr/Cdr.h"

#include "rosidl_typesupport_fastrtps_cpp/message_type_support.h"
#include "rosidl_typesupport_fastrtps_cpp/service_type_support.h"

Expand Down
13 changes: 6 additions & 7 deletions rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/TypeSupport.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@
#ifndef RMW_FASTRTPS_CPP__TYPESUPPORT_HPP_
#define RMW_FASTRTPS_CPP__TYPESUPPORT_HPP_

#include <rosidl_runtime_c/string.h>
#include <rosidl_runtime_c/string_functions.h>

#include <fastrtps/TopicDataType.h>

#include <fastcdr/FastBuffer.h>
#include <fastcdr/Cdr.h>
#include <cassert>
#include <string>

#include "rosidl_runtime_c/string.h"
#include "rosidl_runtime_c/string_functions.h"

#include "fastcdr/Cdr.h"
#include "fastcdr/FastBuffer.h"

#include "rosidl_typesupport_fastrtps_cpp/message_type_support.h"

#include "rmw_fastrtps_shared_cpp/TypeSupport.hpp"
Expand Down
21 changes: 11 additions & 10 deletions rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/get_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,36 @@
#ifndef RMW_FASTRTPS_CPP__GET_CLIENT_HPP_
#define RMW_FASTRTPS_CPP__GET_CLIENT_HPP_

#include "fastrtps/publisher/Publisher.h"
#include "fastrtps/subscriber/Subscriber.h"
#include "fastdds/dds/publisher/DataWriter.hpp"
#include "fastdds/dds/subscriber/DataReader.hpp"

#include "rmw/rmw.h"
#include "rmw_fastrtps_cpp/visibility_control.h"

namespace rmw_fastrtps_cpp
{

/// Return a native FastRTPS publisher handle for the request.
/// Return a native Fast DDS DataWriter handle for the request.
/**
* The function returns `NULL` when either the client handle is `NULL` or
* when the client handle is from a different rmw implementation.
*
* \return native FastRTPS publisher handle if successful, otherwise `NULL`
* \return native Fast DDS DataWriter handle if successful, otherwise `NULL`
*/
RMW_FASTRTPS_CPP_PUBLIC
eprosima::fastrtps::Publisher *
get_request_publisher(rmw_client_t * client);
eprosima::fastdds::dds::DataWriter *
get_request_datawriter(rmw_client_t * client);

/// Return a native FastRTPS subscriber handle for the response.
/// Return a native Fast DDS DataReader handle for the response.
/**
* The function returns `NULL` when either the client handle is `NULL` or
* when the client handle is from a different rmw implementation.
*
* \return native FastRTPS subscriber handle if successful, otherwise `NULL`
* \return native Fast DDS DataReader handle if successful, otherwise `NULL`
*/
RMW_FASTRTPS_CPP_PUBLIC
eprosima::fastrtps::Subscriber *
get_response_subscriber(rmw_client_t * client);
eprosima::fastdds::dds::DataReader *
get_response_datareader(rmw_client_t * client);

} // namespace rmw_fastrtps_cpp

Expand Down
13 changes: 7 additions & 6 deletions rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/get_participant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,24 @@
#ifndef RMW_FASTRTPS_CPP__GET_PARTICIPANT_HPP_
#define RMW_FASTRTPS_CPP__GET_PARTICIPANT_HPP_

#include "fastrtps/participant/Participant.h"
#include "fastdds/dds/domain/DomainParticipant.hpp"

#include "rmw/rmw.h"
#include "rmw_fastrtps_cpp/visibility_control.h"

namespace rmw_fastrtps_cpp
{

/// Return a native FastRTPS participant handle.
/// Return a native Fast DDS DomainParticipant handle.
/**
* The function returns `NULL` when either the node handle is `NULL` or when the
* This function returns `NULL` when either the node handle is `NULL` or when the
* node handle is from a different rmw implementation.
*
* \return native FastRTPS participant handle if successful, otherwise `NULL`
* \return native Fast DDS DomainParticipant handle if successful, otherwise `NULL`
*/
RMW_FASTRTPS_CPP_PUBLIC
eprosima::fastrtps::Participant *
get_participant(rmw_node_t * node);
eprosima::fastdds::dds::DomainParticipant *
get_domain_participant(rmw_node_t * node);

} // namespace rmw_fastrtps_cpp

Expand Down
11 changes: 6 additions & 5 deletions rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/get_publisher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,24 @@
#ifndef RMW_FASTRTPS_CPP__GET_PUBLISHER_HPP_
#define RMW_FASTRTPS_CPP__GET_PUBLISHER_HPP_

#include "fastrtps/publisher/Publisher.h"
#include "fastdds/dds/publisher/DataWriter.hpp"

#include "rmw/rmw.h"
#include "rmw_fastrtps_cpp/visibility_control.h"

namespace rmw_fastrtps_cpp
{

/// Return a native FastRTPS publisher handle.
/// Return a native Fast DDS DataWriter handle.
/**
* The function returns `NULL` when either the publisher handle is `NULL` or
* when the publisher handle is from a different rmw implementation.
*
* \return native FastRTPS publisher handle if successful, otherwise `NULL`
* \return native Fast DDS DataWriter handle if successful, otherwise `NULL`
*/
RMW_FASTRTPS_CPP_PUBLIC
eprosima::fastrtps::Publisher *
get_publisher(rmw_publisher_t * publisher);
eprosima::fastdds::dds::DataWriter *
get_datawriter(rmw_publisher_t * publisher);

} // namespace rmw_fastrtps_cpp

Expand Down
21 changes: 11 additions & 10 deletions rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/get_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,36 @@
#ifndef RMW_FASTRTPS_CPP__GET_SERVICE_HPP_
#define RMW_FASTRTPS_CPP__GET_SERVICE_HPP_

#include "fastrtps/publisher/Publisher.h"
#include "fastrtps/subscriber/Subscriber.h"
#include "fastdds/dds/publisher/DataWriter.hpp"
#include "fastdds/dds/subscriber/DataReader.hpp"

#include "rmw/rmw.h"
#include "rmw_fastrtps_cpp/visibility_control.h"

namespace rmw_fastrtps_cpp
{

/// Return a native FastRTPS subscriber handle for the request.
/// Return a native Fast DDS DataReader handle for the request.
/**
* The function returns `NULL` when either the service handle is `NULL` or
* when the service handle is from a different rmw implementation.
*
* \return native FastRTPS subscriber handle if successful, otherwise `NULL`
* \return native Fast DDS DataReader handle if successful, otherwise `NULL`
*/
RMW_FASTRTPS_CPP_PUBLIC
eprosima::fastrtps::Subscriber *
get_request_subscriber(rmw_service_t * service);
eprosima::fastdds::dds::DataReader *
get_request_datareader(rmw_service_t * service);

/// Return a native FastRTPS publisher handle for the response.
/// Return a native Fast DDS DataWriter handle for the response.
/**
* The function returns `NULL` when either the service handle is `NULL` or
* when the service handle is from a different rmw implementation.
*
* \return native FastRTPS publisher handle if successful, otherwise `NULL`
* \return native Fast DDS DataWriter handle if successful, otherwise `NULL`
*/
RMW_FASTRTPS_CPP_PUBLIC
eprosima::fastrtps::Publisher *
get_response_publisher(rmw_service_t * service);
eprosima::fastdds::dds::DataWriter *
get_response_datawriter(rmw_service_t * service);

} // namespace rmw_fastrtps_cpp

Expand Down
11 changes: 6 additions & 5 deletions rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/get_subscriber.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,24 @@
#ifndef RMW_FASTRTPS_CPP__GET_SUBSCRIBER_HPP_
#define RMW_FASTRTPS_CPP__GET_SUBSCRIBER_HPP_

#include "fastrtps/subscriber/Subscriber.h"
#include "fastdds/dds/subscriber/DataReader.hpp"

#include "rmw/rmw.h"
#include "rmw_fastrtps_cpp/visibility_control.h"

namespace rmw_fastrtps_cpp
{

/// Return a native FastRTPS subscriber handle.
/// Return a native Fast DDS DataReader handle.
/**
* The function returns `NULL` when either the subscription handle is `NULL` or
* when the subscription handle is from a different rmw implementation.
*
* \return native FastRTPS subscriber handle if successful, otherwise `NULL`
* \return native Fast DDS DataReader handle if successful, otherwise `NULL`
*/
RMW_FASTRTPS_CPP_PUBLIC
eprosima::fastrtps::Subscriber *
get_subscriber(rmw_subscription_t * subscription);
eprosima::fastdds::dds::DataReader *
get_datareader(rmw_subscription_t * subscription);

} // namespace rmw_fastrtps_cpp

Expand Down
1 change: 0 additions & 1 deletion rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/publisher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ create_publisher(
const rmw_publisher_options_t * publisher_options,
bool keyed,
bool create_publisher_listener);

} // namespace rmw_fastrtps_cpp

#endif // RMW_FASTRTPS_CPP__PUBLISHER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ create_subscription(
const rmw_subscription_options_t * subscription_options,
bool keyed,
bool create_subscription_listener);

} // namespace rmw_fastrtps_cpp

#endif // RMW_FASTRTPS_CPP__SUBSCRIPTION_HPP_
15 changes: 9 additions & 6 deletions rmw_fastrtps_cpp/src/get_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "fastdds/dds/publisher/DataWriter.hpp"
#include "fastdds/dds/subscriber/DataReader.hpp"

#include "rmw_fastrtps_cpp/get_client.hpp"

#include "rmw_fastrtps_shared_cpp/custom_client_info.hpp"
Expand All @@ -20,8 +23,8 @@
namespace rmw_fastrtps_cpp
{

eprosima::fastrtps::Publisher *
get_request_publisher(rmw_client_t * client)
eprosima::fastdds::dds::DataWriter *
get_request_datawriter(rmw_client_t * client)
{
if (!client) {
return nullptr;
Expand All @@ -30,11 +33,11 @@ get_request_publisher(rmw_client_t * client)
return nullptr;
}
auto impl = static_cast<CustomClientInfo *>(client->data);
return impl->request_publisher_;
return impl->request_writer_;
}

eprosima::fastrtps::Subscriber *
get_response_subscriber(rmw_client_t * client)
eprosima::fastdds::dds::DataReader *
get_response_datareader(rmw_client_t * client)
{
if (!client) {
return nullptr;
Expand All @@ -43,7 +46,7 @@ get_response_subscriber(rmw_client_t * client)
return nullptr;
}
auto impl = static_cast<CustomClientInfo *>(client->data);
return impl->response_subscriber_;
return impl->response_reader_;
}

} // namespace rmw_fastrtps_cpp
6 changes: 3 additions & 3 deletions rmw_fastrtps_cpp/src/get_participant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
namespace rmw_fastrtps_cpp
{

eprosima::fastrtps::Participant *
get_participant(rmw_node_t * node)
eprosima::fastdds::dds::DomainParticipant *
get_domain_participant(rmw_node_t * node)
{
if (!node) {
return nullptr;
Expand All @@ -32,7 +32,7 @@ get_participant(rmw_node_t * node)
return nullptr;
}
auto impl = static_cast<CustomParticipantInfo *>(node->context->impl->participant_info);
return impl->participant;
return impl->participant_;
}

} // namespace rmw_fastrtps_cpp
6 changes: 3 additions & 3 deletions rmw_fastrtps_cpp/src/get_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
namespace rmw_fastrtps_cpp
{

eprosima::fastrtps::Publisher *
get_publisher(rmw_publisher_t * publisher)
eprosima::fastdds::dds::DataWriter *
get_datawriter(rmw_publisher_t * publisher)
{
if (!publisher) {
return nullptr;
Expand All @@ -30,7 +30,7 @@ get_publisher(rmw_publisher_t * publisher)
return nullptr;
}
auto impl = static_cast<CustomPublisherInfo *>(publisher->data);
return impl->publisher_;
return impl->data_writer_;
}

} // namespace rmw_fastrtps_cpp
12 changes: 6 additions & 6 deletions rmw_fastrtps_cpp/src/get_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
namespace rmw_fastrtps_cpp
{

eprosima::fastrtps::Subscriber *
get_request_subscriber(rmw_service_t * service)
eprosima::fastdds::dds::DataReader *
get_request_datareader(rmw_service_t * service)
{
if (!service) {
return nullptr;
Expand All @@ -30,11 +30,11 @@ get_request_subscriber(rmw_service_t * service)
return nullptr;
}
auto impl = static_cast<CustomServiceInfo *>(service->data);
return impl->request_subscriber_;
return impl->request_reader_;
}

eprosima::fastrtps::Publisher *
get_response_publisher(rmw_service_t * service)
eprosima::fastdds::dds::DataWriter *
get_response_datawriter(rmw_service_t * service)
{
if (!service) {
return nullptr;
Expand All @@ -43,7 +43,7 @@ get_response_publisher(rmw_service_t * service)
return nullptr;
}
auto impl = static_cast<CustomServiceInfo *>(service->data);
return impl->response_publisher_;
return impl->response_writer_;
}

} // namespace rmw_fastrtps_cpp
6 changes: 3 additions & 3 deletions rmw_fastrtps_cpp/src/get_subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
namespace rmw_fastrtps_cpp
{

eprosima::fastrtps::Subscriber *
get_subscriber(rmw_subscription_t * subscription)
eprosima::fastdds::dds::DataReader *
get_datareader(rmw_subscription_t * subscription)
{
if (!subscription) {
return nullptr;
Expand All @@ -30,7 +30,7 @@ get_subscriber(rmw_subscription_t * subscription)
return nullptr;
}
auto impl = static_cast<CustomSubscriberInfo *>(subscription->data);
return impl->subscriber_;
return impl->data_reader_;
}

} // namespace rmw_fastrtps_cpp
2 changes: 1 addition & 1 deletion rmw_fastrtps_cpp/src/init_rmw_context_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ init_context_impl(rmw_context_t * context)
}

common_context->gid = rmw_fastrtps_shared_cpp::create_rmw_gid(
eprosima_fastrtps_identifier, participant_info->participant->getGuid());
eprosima_fastrtps_identifier, participant_info->participant_->guid());
common_context->pub = publisher.get();
common_context->sub = subscription.get();
common_context->graph_guard_condition = graph_guard_condition.get();
Expand Down
Loading