Skip to content

Commit c855085

Browse files
committed
Update
Signed-off-by: Pablo Garrido <pablogs9@gmail.com>
1 parent 098a446 commit c855085

19 files changed

Lines changed: 140 additions & 455 deletions

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ All the configurable parameters are:
4040
| RMW_UXRCE_MAX_SUBSCRIPTIONS | This value sets the maximum number of topic subscriptions for an application. | 4 |
4141
| RMW_UXRCE_MAX_SERVICES | This value sets the maximum number of service servers for an application. | 4 |
4242
| RMW_UXRCE_MAX_CLIENTS | This value sets the maximum number of service clients for an application. | 4 |
43-
| RMW_UXRCE_MAX_TOPICS | This value sets the maximum number of topics for an application. </br> If set to -1 RMW_UXRCE_MAX_TOPICS = RMW_UXRCE_MAX_PUBLISHERS + </br> RMW_UXRCE_MAX_SUBSCRIPTIONS + RMW_UXRCE_MAX_NODES. | -1 |
4443
| RMW_UXRCE_MAX_WAIT_SETS | This value sets the maximum number of wait sets for an application. | 4 |
4544
| RMW_UXRCE_MAX_GUARD_CONDITION | This value sets the maximum number of guard conditions for an application. | 4 |
4645
| RMW_UXRCE_NODE_NAME_MAX_LENGTH | This value sets the maximum number of characters for a node name. | 60 |

rmw_microxrcedds_c/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ set(RMW_UXRCE_MAX_SERVICES "4" CACHE STRING "This value sets the maximum number
5555
set(RMW_UXRCE_MAX_CLIENTS "4" CACHE STRING "This value sets the maximum number of clients for an application.")
5656
set(RMW_UXRCE_MAX_WAIT_SETS "4" CACHE STRING "This value sets the maximum number of wait sets for an application.")
5757
set(RMW_UXRCE_MAX_GUARD_CONDITION "4" CACHE STRING "This value sets the maximum number of guard conditions for an application.")
58-
set(RMW_UXRCE_MAX_TOPICS "-1" CACHE STRING
59-
"This value sets the maximum number of topics for an application.
60-
If set to -1 RMW_UXRCE_MAX_TOPICS = RMW_UXRCE_MAX_PUBLISHERS + RMW_UXRCE_MAX_SUBSCRIPTIONS + RMW_UXRCE_MAX_NODES.")
6158
option(RMW_UXRCE_ALLOW_DYNAMIC_ALLOCATIONS "Enables increasing static pools with dynamic allocation when needed." OFF)
6259
set(RMW_UXRCE_NODE_NAME_MAX_LENGTH "60" CACHE STRING "This value sets the maximum number of characters for a node name.")
6360
set(RMW_UXRCE_TOPIC_NAME_MAX_LENGTH "60" CACHE STRING "This value sets the maximum number of characters for a topic name.")
@@ -168,7 +165,6 @@ set(SRCS
168165
src/rmw_guard_condition.c
169166
src/rmw_init.c
170167
src/rmw_logging.c
171-
src/rmw_microxrcedds_topic.c
172168
src/rmw_node.c
173169
src/rmw_node_info_and_types.c
174170
src/rmw_node_names.c

rmw_microxrcedds_c/src/callbacks.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ void on_topic(
8080
"Not available static buffer memory node in on_topic callback",
8181
.node = custom_subscription->owner_node->node_name,
8282
.node_namespace = custom_subscription->owner_node->node_namespace,
83-
.topic_name = custom_subscription->topic->topic_name, .ucdr = ub,
83+
.topic_name = custom_subscription->topic.topic_name, .ucdr = ub,
8484
.size = length,
85-
.type_support.message_callbacks = custom_subscription->topic->type_support_callbacks);
85+
.type_support.message_callbacks = custom_subscription->topic.type_support_callbacks.msg);
8686
return;
8787
}
8888

@@ -139,9 +139,9 @@ void on_request(
139139
"Not available static buffer memory node in on_request callback",
140140
.node = custom_service->owner_node->node_name,
141141
.node_namespace = custom_service->owner_node->node_namespace,
142-
.topic_name = custom_service->service_name, .ucdr = ub,
142+
.topic_name = custom_service->topic.topic_name, .ucdr = ub,
143143
.size = length,
144-
.type_support.service_callbacks = custom_service->type_support_callbacks);
144+
.type_support.service_callbacks = custom_service->topic.type_support_callbacks.srv);
145145
return;
146146
}
147147

@@ -200,9 +200,9 @@ void on_reply(
200200
"Not available static buffer memory node in on_reply callback",
201201
.node = custom_client->owner_node->node_name,
202202
.node_namespace = custom_client->owner_node->node_namespace,
203-
.topic_name = custom_client->service_name, .ucdr = ub,
203+
.topic_name = custom_client->topic.topic_name, .ucdr = ub,
204204
.size = length,
205-
.type_support.service_callbacks = custom_client->type_support_callbacks);
205+
.type_support.service_callbacks = custom_client->topic.type_support_callbacks.srv);
206206
return;
207207
}
208208

rmw_microxrcedds_c/src/config.h.in

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,9 @@
5757
#define RMW_UXRCE_MAX_SUBSCRIPTIONS @RMW_UXRCE_MAX_SUBSCRIPTIONS@
5858
#define RMW_UXRCE_MAX_SERVICES @RMW_UXRCE_MAX_SERVICES@
5959
#define RMW_UXRCE_MAX_CLIENTS @RMW_UXRCE_MAX_CLIENTS@
60-
#define RMW_UXRCE_MAX_TOPICS @RMW_UXRCE_MAX_TOPICS@
6160
#define RMW_UXRCE_MAX_WAIT_SETS @RMW_UXRCE_MAX_WAIT_SETS@
6261
#define RMW_UXRCE_MAX_GUARD_CONDITION @RMW_UXRCE_MAX_GUARD_CONDITION@
6362

64-
#if RMW_UXRCE_MAX_TOPICS == -1
65-
#define RMW_UXRCE_MAX_TOPICS_INTERNAL RMW_UXRCE_MAX_PUBLISHERS + RMW_UXRCE_MAX_SUBSCRIPTIONS
66-
#else
67-
#define RMW_UXRCE_MAX_TOPICS_INTERNAL RMW_UXRCE_MAX_TOPICS
68-
#endif
69-
7063
#define RMW_UXRCE_NODE_NAME_MAX_LENGTH @RMW_UXRCE_NODE_NAME_MAX_LENGTH@
7164
#define RMW_UXRCE_TOPIC_NAME_MAX_LENGTH @RMW_UXRCE_TOPIC_NAME_MAX_LENGTH@
7265
#define RMW_UXRCE_TYPE_NAME_MAX_LENGTH @RMW_UXRCE_TYPE_NAME_MAX_LENGTH@

rmw_microxrcedds_c/src/rmw_client.c

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
16-
#ifdef HAVE_C_TYPESUPPORT
17-
#include <rosidl_typesupport_microxrcedds_c/identifier.h>
18-
#endif /* ifdef HAVE_C_TYPESUPPORT */
19-
#ifdef HAVE_CPP_TYPESUPPORT
20-
#include <rosidl_typesupport_microxrcedds_cpp/identifier.h>
21-
#endif /* ifdef HAVE_CPP_TYPESUPPORT */
22-
2315
#include <rmw/rmw.h>
2416
#include <rmw/allocators.h>
2517

18+
#include <rosidl_typesupport_microxrcedds_c/identifier.h>
19+
#include <rosidl_typesupport_microxrcedds_c/service_type_support.h>
20+
2621
#include "./rmw_microros_internal/utils.h"
2722
#include "./rmw_microros_internal/error_handling_internal.h"
2823

@@ -56,8 +51,8 @@ rmw_create_client(
5651
rmw_client = &custom_client->rmw_client;
5752
rmw_client->data = NULL;
5853
rmw_client->implementation_identifier = rmw_get_implementation_identifier();
59-
rmw_client->service_name = custom_client->service_name;
60-
if ((strlen(service_name) + 1 ) > sizeof(custom_client->service_name)) {
54+
rmw_client->service_name = custom_client->topic.topic_name;
55+
if ((strlen(service_name) + 1 ) > sizeof(custom_client->topic.topic_name)) {
6156
RMW_UROS_TRACE_MESSAGE("failed to allocate string")
6257
goto fail;
6358
}
@@ -68,26 +63,18 @@ rmw_create_client(
6863
custom_client->session_timeout = RMW_UXRCE_PUBLISH_RELIABLE_TIMEOUT;
6964
custom_client->qos = *qos_policies;
7065

71-
const rosidl_service_type_support_t * type_support_xrce = NULL;
72-
#ifdef ROSIDL_TYPESUPPORT_MICROXRCEDDS_C__IDENTIFIER_VALUE
73-
type_support_xrce = get_service_typesupport_handle(
66+
const rosidl_service_type_support_t * type_support_xrce = get_service_typesupport_handle(
7467
type_support, ROSIDL_TYPESUPPORT_MICROXRCEDDS_C__IDENTIFIER_VALUE);
75-
#endif /* ifdef ROSIDL_TYPESUPPORT_MICROXRCEDDS_C__IDENTIFIER_VALUE */
76-
#ifdef ROSIDL_TYPESUPPORT_MICROXRCEDDS_CPP__IDENTIFIER_VALUE
77-
if (NULL == type_support_xrce) {
78-
type_support_xrce = get_service_typesupport_handle(
79-
type_support, ROSIDL_TYPESUPPORT_MICROXRCEDDS_CPP__IDENTIFIER_VALUE);
80-
}
81-
#endif /* ifdef ROSIDL_TYPESUPPORT_MICROXRCEDDS_CPP__IDENTIFIER_VALUE */
68+
8269
if (NULL == type_support_xrce) {
8370
RMW_UROS_TRACE_MESSAGE("Undefined type support")
8471
goto fail;
8572
}
8673

87-
custom_client->type_support_callbacks =
74+
custom_client->topic.type_support_callbacks.srv =
8875
(const service_type_support_callbacks_t *)type_support_xrce->data;
8976

90-
if (custom_client->type_support_callbacks == NULL) {
77+
if (custom_client->topic.type_support_callbacks.srv == NULL) {
9178
RMW_UROS_TRACE_MESSAGE("type support data is NULL")
9279
goto fail;
9380
}
@@ -121,7 +108,7 @@ rmw_create_client(
121108
static char req_type_name[RMW_UXRCE_TYPE_NAME_MAX_LENGTH];
122109
static char res_type_name[RMW_UXRCE_TYPE_NAME_MAX_LENGTH];
123110
generate_service_types(
124-
custom_client->type_support_callbacks, req_type_name, res_type_name,
111+
custom_client->topic.type_support_callbacks.srv, req_type_name, res_type_name,
125112
RMW_UXRCE_TYPE_NAME_MAX_LENGTH);
126113

127114
static char req_topic_name[RMW_UXRCE_TOPIC_NAME_MAX_LENGTH];

rmw_microxrcedds_c/src/rmw_microros_internal/rmw_microxrcedds_topic.h

Lines changed: 0 additions & 44 deletions
This file was deleted.

rmw_microxrcedds_c/src/rmw_microros_internal/types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ typedef struct rmw_uxrce_topic_t
119119
{
120120
uxrObjectId topic_id;
121121

122+
struct rmw_uxrce_node_t * owner_node;
123+
122124
union {
123125
const message_type_support_callbacks_t * msg;
124126
const service_type_support_callbacks_t * srv;
@@ -325,8 +327,6 @@ void rmw_uxrce_fini_client_memory(
325327
rmw_client_t * client);
326328
void rmw_uxrce_fini_service_memory(
327329
rmw_service_t * service);
328-
void rmw_uxrce_fini_topic_memory(
329-
rmw_uxrce_topic_t * topic);
330330

331331
// Memory pools functions
332332

rmw_microxrcedds_c/src/rmw_microxrcedds_topic.c

Lines changed: 0 additions & 182 deletions
This file was deleted.

0 commit comments

Comments
 (0)