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

Fast DDS Subscriber "Failed init_port" #2099

Closed
wrgtri opened this issue Jul 28, 2021 · 3 comments
Closed

Fast DDS Subscriber "Failed init_port" #2099

wrgtri opened this issue Jul 28, 2021 · 3 comments

Comments

@wrgtri
Copy link

wrgtri commented Jul 28, 2021

Expected Behavior

Running

DomainParticipantQos pqos;
participant_ = DomainParticipantFactory::get_instance()->create_participant(0, pqos);

should run without errors.

Current Behavior

When participant_ = DomainParticipantFactory::get_instance()->create_participant(0, pqos); is called (specifically create_participant(), the following error is produced

2021-07-28 12:49:37.829 [RTPS_TRANSPORT_SHM Error] Failed init_port fastrtps_port7412: open_and_lock_file failed -> Function open_port_internal
2021-07-28 12:49:37.831 [RTPS_TRANSPORT_SHM Error] Failed init_port fastrtps_port7413: open_and_lock_file failed -> Function open_port_internal

Additional context

I have set up an outside application to receive Fast DDS messages from ROS2. I have been able to test that I can receive ros2 topic messages in a simple outside fast dds subscriber (generated using fastddsgen -example CMake MyMsg.idl).

Now I am trying to incorporate the Fast DDS subscriber code into another application. However, the above error is produced in the MyMsgSubscriber.cxx (created using fastddsgen command above), in MyMsgSubsriber::init(), line participant_ = DomainParticipantFactory::get_instance()->create_participant(0, pqos);. Why is this error occurring? Thank you

System information

  • Fast-DDS version: 2.3.0
  • OS: Ubuntu 20.04
  • ROS2: Foxy
@MiguelCompany
Copy link
Member

Hi @wrgtri

Could you check if running fastdds shm clean solves your issue?

@wrgtri
Copy link
Author

wrgtri commented Jul 29, 2021

Could you check if running fastdds shm clean solves your issue?

Hi @MiguelCompany
Unfortunately that did not work. I ran that command and got

0 ports in use
0 segments in use
2 zombie ports cleaned
1 zombie segments cleaned

But when I rerun the ros2 publisher and then the fastdds subscriber, I get the same error again in whichever terminal (publisher or subscriber) was run second.

@wrgtri
Copy link
Author

wrgtri commented Aug 2, 2021

Error was caused by having two installations of FastDDS, one that came with ROS2 and another that I installed. My programs were then calling alternate versions, so they were "stepping on each other's toes." Solution was to uninstall the extra one and have both use the FastDDS that comes with ROS2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants