Skip to content

Commit ef3d06e

Browse files
committed
Adding support for micro 4.0.2
1 parent d8ff9e9 commit ef3d06e

File tree

7 files changed

+264
-70
lines changed

7 files changed

+264
-70
lines changed

generate_xlsx_report.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#################################################################
1010

1111
import argparse
12+
from io import BytesIO
1213
import junitparser
1314
import lxml
1415
import pathlib
@@ -168,8 +169,11 @@ def __init__(self, input: pathlib.Path):
168169
@staticmethod
169170
def xml_parser(file):
170171
"""Function to parse the XML file"""
172+
# Remove null bytes from the file
173+
with open(file, "rb") as f:
174+
data = f.read().replace(b"\x00", b"")
171175
parser = lxml.etree.XMLParser(huge_tree=True)
172-
return lxml.etree.parse(file, parser)
176+
return lxml.etree.parse(BytesIO(data), parser)
173177

174178
def update_value_aggregated_data_dict(self,
175179
dictionary: dict,

interoperability_report.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def run_subscriber_shape_main(
170170
log_message(f'Subscriber {subscriber_index}: Waiting for data', verbosity)
171171
index = child_sub.expect(
172172
[
173-
'\[[0-9]+\]', # index = 0
173+
r'\[[0-9]+\]', # index = 0
174174
'on_requested_incompatible_qos()', # index = 1
175175
'on_requested_deadline_missed()', # index = 2
176176
pexpect.TIMEOUT, # index = 3
@@ -330,7 +330,7 @@ def run_publisher_shape_main(
330330
if '-w ' in parameters or parameters.endswith('-w'):
331331
# Step 5: Check whether the writer sends the samples
332332
index = child_pub.expect([
333-
'\[[0-9]+\]', # index = 0
333+
r'\[[0-9]+\]', # index = 0
334334
'on_offered_deadline_missed()', # index = 1
335335
pexpect.TIMEOUT, # index = 2
336336
pexpect.EOF # index == 3
@@ -348,12 +348,12 @@ def run_publisher_shape_main(
348348
for x in range(0, MAX_SAMPLES_SAVED, 1):
349349
# At this point, at least one sample has been printed
350350
# Therefore, that sample is added to samples_sent.
351-
pub_string = re.search('[0-9]+ [0-9]+ \[[0-9]+\]',
351+
pub_string = re.search(r'[0-9]+ [0-9]+ \[[0-9]+\]',
352352
child_pub.before + child_pub.after)
353353
last_sample = pub_string.group(0)
354354
samples_sent.put(last_sample)
355355
index = child_pub.expect([
356-
'\[[0-9]+\]', # index = 0
356+
r'\[[0-9]+\]', # index = 0
357357
'on_offered_deadline_missed()', # index = 1
358358
pexpect.TIMEOUT # index = 2
359359
],

srcCxx/makefile_rti_connext_micro_linux

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,19 @@ ifeq ($(DEBUG),1)
4343
COMPILER_FLAGS += -g -O0
4444
LINKER_FLAGS += -g
4545
LIBS = -L$(RTIMEHOME)/lib/$(RTIMEARCH) \
46-
-lrti_me_cppzd -lrti_me_discdpdezd -lrti_mezd -lrti_me_rhsmzd -lrti_me_whsmzd $(SYSLIBS)
46+
-lrti_me_cppzd -lrti_me_netiosdmzd \
47+
-lrti_me_discdpdez -lrti_me_ddsfilterzd -lrti_me_rhsmzd \
48+
-lrti_me_whsmzd -lrti_mezd -lrti_me_ddsxtypeszd $(SYSLIBS)
4749
else
4850
# This option strips the executable symbols
4951
LINKER_FLAGS += -s
5052
LIBS = -L$(RTIMEHOME)/lib/$(RTIMEARCH) \
51-
-lrti_me_cppz -lrti_me_discdpdez -lrti_mez -lrti_me_rhsmz -lrti_me_whsmz $(SYSLIBS)
53+
-lrti_me_cppz -lrti_me_netiosdmz \
54+
-lrti_me_discdpdez -lrti_me_ddsfilterz -lrti_me_rhsmz \
55+
-lrti_me_whsmz -lrti_mez -lrti_me_ddsxtypesz $(SYSLIBS)
5256
endif
5357

54-
DEFINES = -DRTI_UNIX -DRTI_LINUX -DRTI_CONNEXT_MICRO
58+
DEFINES = -DRTI_UNIX -DRTI_LINUX -DRTI_CONNEXT_MICRO -DOSAPI_CC_DEF_H=osapi/osapi_cc_gcc.h
5559

5660
INCLUDES = -I. -I$(RTIMEHOME)/include -I$(RTIMEHOME)/include/rti_me
5761

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
######################################################################
2+
# To compile, type:
3+
# make -f makefile_rti_connext_dds_linux
4+
# To compile with the Debug option, use:
5+
# make -f makefile_rti_connext_dds_linux DEBUG=1
6+
#
7+
# This makefile assumes that your build environment is already correctly
8+
# configured. (For example, the correct version of your compiler and
9+
# linker should be on your PATH.)
10+
#
11+
# You should set the environemnt variable RTIMEHOME to point to where
12+
# RTI Connext Micro is installed.
13+
#
14+
######################################################################
15+
16+
# If undefined in the environment default RTIMEHOME to install dir
17+
ifndef RTIMEHOME
18+
$(error RTIMEHOME not defined)
19+
endif
20+
21+
COMPILER_FLAGS = -std=c++11
22+
LINKER_FLAGS =
23+
24+
split_path_name = $(subst /rti_, , $(RTIMEHOME))
25+
26+
version_name = $(lastword $(split_path_name))
27+
common_name = "_shape_main_macos"
28+
executable_name = $(version_name)$(common_name)
29+
30+
RTIMEARCH = arm64Darwin23clang15.0
31+
32+
ifndef COMPILER
33+
COMPILER = clang++
34+
endif
35+
36+
ifndef LINKER
37+
LINKER = clang++
38+
endif
39+
40+
#SYSLIBS =
41+
42+
ifeq ($(DEBUG),1)
43+
COMPILER_FLAGS += -g -O0
44+
LINKER_FLAGS += -g
45+
LIBS = -L$(RTIMEHOME)/lib/$(RTIMEARCH) \
46+
-lrti_me_cppzd -lrti_me_netiosdmzd \
47+
-lrti_me_discdpdez -lrti_me_ddsfilterzd -lrti_me_rhsmzd \
48+
-lrti_me_whsmzd -lrti_mezd -lrti_me_ddsxtypeszd $(SYSLIBS)
49+
else
50+
# This option strips the executable symbols
51+
#LINKER_FLAGS += -s
52+
LIBS = -L$(RTIMEHOME)/lib/$(RTIMEARCH) \
53+
-lrti_me_cppz -lrti_me_netiosdmz \
54+
-lrti_me_discdpdez -lrti_me_ddsfilterz -lrti_me_rhsmz \
55+
-lrti_me_whsmz -lrti_mez -lrti_me_ddsxtypesz $(SYSLIBS)
56+
endif
57+
58+
DEFINES = -DRTI_UNIX -DRTI_DARWIN -DRTI_CONNEXT_MICRO -DOSAPI_CC_DEF_H=osapi/osapi_cc_gcc.h
59+
60+
INCLUDES = -I. -I$(RTIMEHOME)/include -I$(RTIMEHOME)/include/rti_me
61+
62+
OBJDIR := objs/$(RTIMEARCH)_micro
63+
64+
CDRSOURCES := shape_micro.idl
65+
AUTOGENSOURCES := shape_microSupport.cxx shape_microPlugin.cxx shape_micro.cxx
66+
67+
EXEC := $(executable_name)
68+
AUTOGENOBJS := $(addprefix $(OBJDIR)/, $(AUTOGENSOURCES:%.cxx=%.o))
69+
70+
$(OBJDIR)/$(EXEC) : $(AUTOGENSOURCES) $(AUTOGENOBJS) $(OBJDIR)/shape_main.o
71+
$(LINKER) $(LINKER_FLAGS) -o $@ $(OBJDIR)/shape_main.o $(AUTOGENOBJS) $(LIBS)
72+
73+
$(OBJDIR)/%.o : %.cxx
74+
$(COMPILER) $(COMPILER_FLAGS) -o $@ $(DEFINES) $(INCLUDES) -c $<
75+
76+
shape_main.cxx : shape_configurator_rti_connext_dds.h
77+
78+
# Generate type-specific sources
79+
$(AUTOGENSOURCES) : $(CDRSOURCES)
80+
$(RTIMEHOME)/rtiddsgen/scripts/rtiddsgen $(CDRSOURCES) -replace -micro -language C++
81+
82+
$(AUTOGENOBJS): | objs/$(RTIMEARCH)_micro
83+
84+
objs/$(RTIMEARCH)_micro:
85+
echo "Making directory objs/$(RTIMEARCH)_micro";
86+
mkdir -p objs/$(RTIMEARCH)_micro

srcCxx/shape_configurator_rti_connext_micro.h

Lines changed: 86 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#include "shape_micro.h"
22
#include "shape_microSupport.h"
33

4-
#ifndef rti_me_cpp_hxx
5-
#include "rti_me_cpp.hxx"
6-
#endif
4+
#include "rti_me_cpp.hxx"
5+
#include "dds_cpp/dds_cpp_netio.hxx"
6+
7+
#include <map>
8+
#include <cstring>
79

810
#define CONFIGURE_PARTICIPANT_FACTORY config_micro();
911
#define LISTENER_STATUS_MASK_ALL (DDS_STATUS_MASK_ALL)
@@ -16,6 +18,23 @@
1618
#define XCDR2_DATA_REPRESENTATION DDS_XCDR2_DATA_REPRESENTATION
1719
#endif
1820

21+
#ifndef PresentationQosPolicyAccessScopeKind
22+
#define PresentationQosPolicyAccessScopeKind DDS_PresentationQosPolicyAccessScopeKind
23+
#endif
24+
25+
#ifndef INSTANCE_PRESENTATION_QOS
26+
#define INSTANCE_PRESENTATION_QOS DDS_INSTANCE_PRESENTATION_QOS
27+
#endif
28+
29+
#ifndef TOPIC_PRESENTATION_QOS
30+
#define TOPIC_PRESENTATION_QOS DDS_TOPIC_PRESENTATION_QOS
31+
#endif
32+
33+
#ifndef GROUP_PRESENTATION_QOS
34+
#define GROUP_PRESENTATION_QOS DDS_GROUP_PRESENTATION_QOS
35+
#endif
36+
37+
1938
#define DataRepresentationId_t DDS_DataRepresentationId_t
2039
#define DataRepresentationIdSeq DDS_DataRepresentationIdSeq
2140

@@ -106,7 +125,13 @@ static void config_micro()
106125
return;
107126
}
108127

109-
udp_property->allow_interface[0] = DDS_String_dup("lo");
128+
#if defined(RTI_LINUX)
129+
udp_property->allow_interface[0] = DDS_String_dup("lo");
130+
printf("Configured UDP to allow interface lo\n");
131+
#elif defined(RTI_DARWIN)
132+
udp_property->allow_interface[0] = DDS_String_dup("lo0");
133+
printf("Configured UDP to allow interface lo0\n");
134+
#endif
110135
//udp_property->allow_interface[1] = DDS_String_dup("eth0");
111136

112137
if (!registry->register_component(
@@ -119,22 +144,73 @@ static void config_micro()
119144
return;
120145
}
121146

122-
DPDE::DiscoveryPluginProperty discovery_plugin_properties;
147+
DPDE::DiscoveryPluginProperty *discovery_plugin_properties = new DPDE::DiscoveryPluginProperty();
123148

124149
/* Configure properties */
125-
discovery_plugin_properties.participant_liveliness_assert_period.sec = 5;
126-
discovery_plugin_properties.participant_liveliness_assert_period.nanosec = 0;
127-
discovery_plugin_properties.participant_liveliness_lease_duration.sec = 30;
128-
discovery_plugin_properties.participant_liveliness_lease_duration.nanosec = 0;
150+
discovery_plugin_properties->participant_liveliness_assert_period.sec = 5;
151+
discovery_plugin_properties->participant_liveliness_assert_period.nanosec = 0;
152+
discovery_plugin_properties->participant_liveliness_lease_duration.sec = 30;
153+
discovery_plugin_properties->participant_liveliness_lease_duration.nanosec = 0;
129154

130155

131156
if (!registry->register_component(
132157
"dpde",
133158
DPDEDiscoveryFactory::get_interface(),
134-
&discovery_plugin_properties._parent,
159+
&discovery_plugin_properties->_parent,
135160
NULL))
136161
{
137162
printf("ERROR: unable to register dpde\n");
138163
return;
139164
}
140165
}
166+
167+
static bool configure_dp_qos(DDS::DomainParticipantQos &dp_qos)
168+
{
169+
if (!dp_qos.discovery.discovery.name.set_name("dpde"))
170+
{
171+
printf("ERROR: unable to set discovery plugin name\n");
172+
return false;
173+
}
174+
175+
dp_qos.discovery.initial_peers.maximum(1);
176+
dp_qos.discovery.initial_peers.length(1);
177+
dp_qos.discovery.initial_peers[0] = DDS_String_dup("127.0.0.1");
178+
/* if there are more remote or local endpoints, you need to increase these limits */
179+
dp_qos.resource_limits.max_destination_ports = 32;
180+
dp_qos.resource_limits.max_receive_ports = 32;
181+
dp_qos.resource_limits.local_topic_allocation = 2;
182+
dp_qos.resource_limits.local_type_allocation = 2;
183+
//TODO we need to increase this
184+
dp_qos.resource_limits.local_reader_allocation = 2;
185+
dp_qos.resource_limits.local_writer_allocation = 2;
186+
dp_qos.resource_limits.remote_participant_allocation = 8;
187+
dp_qos.resource_limits.remote_reader_allocation = 8;
188+
dp_qos.resource_limits.remote_writer_allocation = 8;
189+
return true;
190+
}
191+
192+
uint64_t DDS_UInt8Seq_get_length(DDS_OctetSeq * seq)
193+
{
194+
return seq->length();
195+
}
196+
197+
void DDS_UInt8Seq_ensure_length(DDS_OctetSeq * seq, uint64_t length, uint64_t max)
198+
{
199+
seq->ensure_length(length, max);
200+
}
201+
202+
unsigned char* DDS_UInt8Seq_get_reference(DDS_OctetSeq * seq, uint64_t index)
203+
{
204+
return DDS_OctetSeq_get_reference(seq, index);
205+
}
206+
207+
const unsigned char* DDS_UInt8Seq_get_reference(const DDS_OctetSeq * seq, uint64_t index)
208+
{
209+
return DDS_OctetSeq_get_reference(seq, index);
210+
}
211+
212+
struct InstanceHandle_t_less_op {
213+
bool operator()(const DDS::InstanceHandle_t& a, const DDS::InstanceHandle_t& b) const {
214+
return std::memcmp(a.octet, b.octet, 16);
215+
}
216+
};

0 commit comments

Comments
 (0)