Custom ROS2 bridge plugin for SVL simulator version 2021.3+ with native C# implementation.
This plugin relies on binaries included in this repository releases page.
To start developing ROS2ForUnitySVLBridge
with Unity Editor:
- Make sure you have LGSVL simulatior version 2021.3 (see https://www.svlsimulator.com/docs/installation-guide/build-instructions/ for more instructions about getting and launching SVL project).
- Copy contents of this repository into
Assets/External/Bridges/ROS2ForUnitySVLBridge
folder of SVL simulator Unity project. - Unzip required binaries from releases to
Assets/Plugins
- you can usedeploy_unity_plugins.sh
script to do that for you:
cd Assets/External/Bridges/ROS2ForUnitySVLBridge
./deploy_unity_plugins.sh <ARCHIVE_PATH>
Use ROS2ForUnitySVLBridgeInstance
and ROS2ForUnitySVLBridgeFactory
classes to implement or change interface and ROS2ForUnitySVLBridgeConversions
to add or modify existing conversions between SVL sensors and ROS2 messages.
Building a simulator release with ROS2ForUnitySVLBridge
plugin:
- Source ROS2 foxy:
. /opr/ros/foxy/setup.bash
- Set RMW middleware to
cyclonedds
:
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
- Update
LD_LIBRARY_PATH
to include plugins directory (this is due to Unity Editor limitation in linking certain libraries), please note OS subfolderLinux/Windows
:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<SVL_PROJECT_PATH>/Assets/Plugins/<Linux/Windows>/x86_64
- Launch Unity Editor directly:
<UNITY_EDITOR_PATH>/Unity -projectPath <SVL_PROJECT_PATH>
Simulator -> Build
and checkROS2ForUnitySVLBridge
underBridges
.- Click
Build
.
SVL uses cloud-based web user interface for handling assets and simulations: https://wise.svlsimulator.com/.
- Find
ROS2ForUnitySVLBridge
underhttps://wise.svlsimulator.com/plugins
and add it to your library. - install required binaries from github releases page into SVL simulator application:
- libraries from release archive
Plugins/x86_64/*
goes intosimulator_Data/Plugins
of svl simulator directory, - libraries from release archive
Plugins/*.dll
goes intosimulator_Data/Managed
of svl simulator directory.
- libraries from release archive
Then you can just use SVL web interface to set up bridge. See https://www.svlsimulator.com/docs for more informations on how to set up an SVL simulation.
IMPORTANT After building an app from editor, you must manually copy soversion files (ending with library version .so.X.Y.Z
) from editor Plugins/<OS>/x86_64
to simulator_Data/Plugins
folder. This is due to Unity for some reason doesn't copy them while deploying application.