Error with ROS 2 after Executing Husarnet DDS: RMW Implementation Identifier Issue


System : Windows 11, ROS2 Humble


I’m encountering an issue with ROS 2 on Windows after executing a Husarnet DDS utility. Here’s the problem:

Error Message:

[ERROR] [1718883596.275589900] [rcl]: Error getting RMW implementation identifier / RMW implementation not installed (expected identifier of 'rmw_fastrtps_cpp'), with error message 'failed to load shared library 'rmw_fastrtps_cpp.dll' due to LoadLibrary error: 126, at C:\ci\ws\src\ros2\rcutils\src\shared_library.c:159, at C:\ci\ws\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:67', exiting with 1., at C:\ci\ws\src\ros2\rcl\rcl\src\rcl\rmw_implementation_identifier_check.c:145

Context: After running .\husarnet-dds-windows-amd64.exe singleshot, which sets up some DDS configurations, I attempted to use ROS 2, but I encountered the above error related to RMW implementation.

Troubleshooting Attempted:

  1. Environment Variables: I’ve checked and reset environment variables as recommended by ROS 2 documentation and other sources.
  2. Reinstallation: I’ve tried reinstalling ROS 2 to ensure all dependencies are correct and paths are set up properly.

Despite these efforts, I’m still seeing this error when trying to use ROS 2. It seems related to the rmw_fastrtps_cpp.dll library not being found or loaded correctly.

Question: Could anyone please provide insights into what might be causing this issue and how to resolve it? Is there a specific step I might be missing after configuring Husarnet DDS that could affect ROS 2’s setup?

Any help or guidance would be greatly appreciated. Thank you!

Here are the steps I followed to install. Some of these steps may be a bit wacky. You may also want to remove any environment variables you had manually set.

  1. To install husarnet on windows, please go here

  2. Now, you may join our DDS network using the following command in a Command Prompt window which was initialized as Administrator

     husarnet join <join code>

    You should now be able to ping any device on the network (If it is online).

  3. Next, open a new PowerShell Prompt window as an Administrator and run the following commands

     cd C:\
     mkdir husarnet-dds
     cd husarnet-dds
     Invoke-WebRequest -OutFile husarnet-dds.exe
  4. This step has issues so you may want to skip it. Simply run the next commands inside the C:\husarnet-dds folder (powershell and/or cmd directory should be C:\husarnet-dds). In order to be able to run the binary from any directory, place it in the directory present in your %PATH% environment variable

  5. Open a new Command Prompt window which is also initialized as Administrator and run the following commands

     setx /m RMW_IMPLEMENTATION rmw_fastrtps_cpp
     setx /m FASTRTPS_DEFAULT_PROFILES_FILE C:\husarnet-dds\husarnet-fastdds-simple.xml
  6. If you successfully added the directory in step 4 to your %PATH%, then you can run this next command from anywhere. Otherwise, please go to C:\husarnet-dds and execute the following command inside a Powershell initialized as Administrator

     .\husarnet-dds.exe singleshot

    You should see a statement saying

     DDS config saved here: "C:\husarnet-dds\husarnet-fastdds-simple.xml"
  7. Congratulations! You have now setup DDS on your system. Now let us get rid of explicitly executing the call command each time.

  8. On your system, go to My Documents>WindowsPowerShell directory. Here, create a file called Microsoft.PowerShell_profile.ps1 and using an editor add the following line inside the file

  9. Open a new PowerShell Prompt as an Administrator and run the following command

     Unblock-File C:\dev\ros2_humble\local_setup.ps1

Thank you for response.
But i still get the same issues even after following your steps.
I noticed that the output of this command : .\husarnet-dds.exe singleshot was DDS config saved here: "C:\Users\PC\AppData\Local\Temp/husarnet-dds/husarnet-fastdds.xml" so i moved the files to the good directory but i still have the same problem.