IDL include a structure HelloWorld, HelloWorld includes a struct point, point includes a struct timestamp(such as HelloWorld.idl),in this way, fastddsspy will come to Segmentation fault. However, if IDL include a structure HelloWorld, HelloWorld includes a struct point, point don't include any struc (like HelloWorld_OK.idl), fastddsspy will run ok.
HelloWorld_OK.idl
struct point{
short x;};
struct HelloWorld{
point pos;
unsigned long index;};
HelloWorld.idl
struct timestamp{
short h;};
struct point{
timestamp ts;
short x;};
struct HelloWorld{
point pos;
unsigned long index;};
step1:
fastddsgen -typeobjcet HelloWorld.idl
step2:
DomainParticipantQos pqos;
pqos.wire_protocol().builtin.typelookup_config.use_server = true;
eprosima::fastdds::dds::DomainParticipant* participant_;
participant_ = DomainParticipantFactory::get_instance()->create_participant(0, pqos);
eprosima::fastdds::dds::TypeSupport type_;
type_(new HelloWorldPubSubType())
type_.register_type(participant_);
type_->auto_fill_type_object(false);
type_->auto_fill_type_information(true);
step3:
HelloWorld hello_;
hello_.index(0);
hello_.pos().ts().h(10);
hello_.pos().x(10);
writer_->write(&hello_);