Skip to content

Commit

Permalink
re-adding avoid_ros_namespace_conventions check for prefixing names
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitsalem committed Apr 3, 2018
1 parent 6d0c559 commit 3608349
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rmw_fastrtps_cpp/src/rmw_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,24 @@ rmw_create_client(
subscriberParam.topic.topicKind = NO_KEY;
subscriberParam.topic.topicDataType = response_type_name;
subscriberParam.historyMemoryPolicy = PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
if (!qos_policies->avoid_ros_namespace_conventions){
subscriberParam.topic.topicName = std::string(ros_service_response_prefix) + service_name;
}
else{
subscriberParam.topic.topicName = service_name;
}
subscriberParam.topic.topicName += "Reply";

publisherParam.topic.topicKind = NO_KEY;
publisherParam.topic.topicDataType = request_type_name;
publisherParam.qos.m_publishMode.kind = ASYNCHRONOUS_PUBLISH_MODE;
publisherParam.historyMemoryPolicy = PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
if (!qos_policies->avoid_ros_namespace_conventions){
publisherParam.topic.topicName = std::string(ros_service_requester_prefix) + service_name;
}
else{
publisherParam.topic.topicName = service_name;
}
publisherParam.topic.topicName += "Request";

RCUTILS_LOG_DEBUG_NAMED(
Expand Down
5 changes: 5 additions & 0 deletions rmw_fastrtps_cpp/src/rmw_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ rmw_create_publisher(
publisherParam.historyMemoryPolicy = PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
publisherParam.topic.topicKind = NO_KEY;
publisherParam.topic.topicDataType = type_name;
if (!qos_policies->avoid_ros_namespace_conventions){
publisherParam.topic.topicName = std::string(ros_topic_prefix) + topic_name;
}
else{
publisherParam.topic.topicName = topic_name;
}

#if HAVE_SECURITY
// see if our participant has a security property set
Expand Down
10 changes: 10 additions & 0 deletions rmw_fastrtps_cpp/src/rmw_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,24 @@ rmw_create_service(
subscriberParam.topic.topicKind = NO_KEY;
subscriberParam.historyMemoryPolicy = PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
subscriberParam.topic.topicDataType = request_type_name;
if (!qos_policies->avoid_ros_namespace_conventions){
subscriberParam.topic.topicName = std::string(ros_service_requester_prefix) + service_name;
}
else{
subscriberParam.topic.topicName = service_name;
}
subscriberParam.topic.topicName += "Request";

publisherParam.topic.topicKind = NO_KEY;
publisherParam.topic.topicDataType = response_type_name;
publisherParam.qos.m_publishMode.kind = ASYNCHRONOUS_PUBLISH_MODE;
publisherParam.historyMemoryPolicy = PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
if (!qos_policies->avoid_ros_namespace_conventions){
publisherParam.topic.topicName = std::string(ros_service_response_prefix) + service_name;
}
else{
publisherParam.topic.topicName = service_name;
}
publisherParam.topic.topicName += "Reply";

RCUTILS_LOG_DEBUG_NAMED(
Expand Down
5 changes: 5 additions & 0 deletions rmw_fastrtps_cpp/src/rmw_subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ rmw_create_subscription(
subscriberParam.historyMemoryPolicy = PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
subscriberParam.topic.topicKind = NO_KEY;
subscriberParam.topic.topicDataType = type_name;
if (!qos_policies->avoid_ros_namespace_conventions){
subscriberParam.topic.topicName = std::string(ros_topic_prefix) + topic_name;
}
else{
subscriberParam.topic.topicName = topic_name;
}

#if HAVE_SECURITY
// see if our subscriber has a security property set
Expand Down

0 comments on commit 3608349

Please sign in to comment.