BeamNG.tech and ROS2 integration on Windows?

Hello everyone,

My colleague and I are working on integrating BeamNG.tech with ROS2. We would like to know what the best configuration is to make this integration work. Specifically, which machine should run the simulator and which one should run ROS2?

Currently, we are running the simulator on Windows and have successfully installed ROS2 Humble Hawksbill on the same system. We are using PyCharm as our Python environment and have followed the guides provided on the GitHub repository.

However, when running the command rosdep install -i --from-path src --rosdistro humble -y in the PyCharm terminal, we receive the following error:

ERROR: the following packages/stacks could not have their rosdep keys resolved to system dependencies:
beamng_agent: Cannot locate rosdep definition for [beamngpy]
beamng_bringup: Unsupported OS [windows]
beamng_ros2: Unsupported OS [windows]
beamng_msgs: Unsupported OS [windows]
beamng_teleop_keyboard: Unsupported OS [windows]

This error seems to indicate that rosdep is not supported on Windows. Is this the case, or are we missing a step in the process?

We are new to working with ROS2, so any advice or guidance would be greatly appreciated!

Thank you!

Davide & Stefano

Dear Davide and Stefano,

Thank you for your inquiry regarding integrating BeamNG.tech with ROS2 on Windows. Below are three possible solutions to resolve the issue with rosdep not being supported on Windows:

1. Continue Using ROS2 on Windows

To maintain your current setup:

  • Skip rosdep: Manually install dependencies using pip (e.g., pip install beamngpy).
  • Build Packages Individually: Use colcon build to compile each ROS2 package after ensuring dependencies are installed.

While this approach keeps everything on Windows, it requires manual management of dependencies for each package.


2. Use WSL2 with BeamNG.tech on Windows

WSL2 (Windows Subsystem for Linux) allows running a Linux environment alongside Windows:

  • Install WSL2 and set up an Ubuntu distribution.
  • Install ROS2 in WSL2 following the Linux ROS2 installation guide.
  • Keep BeamNG.tech running on Windows and configure the WSL2 network for communication between ROS2 and BeamNG.tech.

This solution enables you to use Linux tools like rosdep without needing separate hardware while retaining the Windows-native performance of BeamNG.tech.


3. Use Native Linux with a ROS integration and Experimental BeamNG.tech

  • Run ROS2 on a native Linux machine where rosdep and other Linux-specific tools work seamlessly.
  • Use the experimental Linux build of BeamNG.tech for direct integration between Linux ROS2 and BeamNG.tech on Linux.

This approach provides the best long-term stability and compatibility for both ROS2 and BeamNG.tech.


Recommendation

  • If you need a quick solution, Solution 1 is sufficient.
  • For a balanced setup leveraging Linux tools, Solution 2 is recommended.

Please let me know if you need further details or assistance implementing any of these solutions!

Best regards,

2 Likes

Thanks a lot for the support!

Me (Davide) and Stefano have decided to implement the second solution to create the integration between ROS2 and BeamNG. To do so, we used WSL and successfully installed ROS2 for Ubuntu 22.04 as recommended.

However, we have encountered some challenges while using the same command mentioned in the second step of the tutorial: BeamNG ROS2 Integration.

The command we executed is:

rosdep install -i --from-path src --rosdistro humble -y

Unfortunately, it fails with the following error:

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
beamng_agent: Cannot locate rosdep definition for [ament_python]

Interestingly, this error alternates with another similar one:

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
beamng_agent: Cannot locate rosdep definition for [beamngpy]

We are unable to find a way to resolve or bypass this issue. Additionally, we tried using the rosdep check command to debug further:

rosdep check --from-paths src --rosdistro humble

This resulted in multiple errors, including:

All system dependencies have been satisfied
ERROR[beamng_ros2]: Cannot locate rosdep definition for [beamng_msgs]
        rosdep key : beamng_msgs
        OS name    : ubuntu
        OS version : jammy
        Data:
<no data>
ERROR[beamng_agent]: Cannot locate rosdep definition for [beamng_msgs]
        rosdep key : beamng_msgs
        OS name    : ubuntu
        OS version : jammy
        Data:
<no data>
ERROR[beamng_bringup]: Cannot locate rosdep definition for [beamng_agent]
        rosdep key : beamng_agent
        OS name    : ubuntu
        OS version : jammy
        Data:
<no data>
ERROR[beamng_teleop_keyboard]: Cannot locate rosdep definition for [beamng_msgs]
        rosdep key : beamng_msgs
        OS name    : ubuntu
        OS version : jammy
        Data:
<no data>

We are wondering if there might be some modifications needed in the CMake files or elsewhere to resolve these dependency issues. It seems like we followed all the previous steps correctly, but we’re now stuck on this.

Any guidance or suggestions on how to resolve this would be greatly appreciated!

Hi, sorry for your bad experience, seems there was a bug introduced in the repository, you should be able to make it work with the latest version of GitHub - BeamNG/beamng-ros2-integration (pushed a fix just now).

The Cannot locate rosdep definition for [beamng_msgs] errors from the rosdep check command can be ignored.

2 Likes

You should also be able to use the BeamNG ROS2 integration on Windows without installing the dependencies through rosdep (as that is not supported on Windows). I tested that just now and I was able to run the examples we have.

2 Likes