/rclUE

Primary LanguageC++

Basic information

Branches

master

This build of the plugin is based on ROS2 Foxy and has been tested on Ubuntu 20.

This branch currently represents the release branch.

Other branches

Experimental and WIP

Installation

How to add this plugin to an Unreal Engine 4 project (Ubuntu 20):

  1. clone this repository in your project Plugin folder
  2. create and use the following shell script to run the UE4 editor (substituting PROJECT_PATH, PROJECT_NAME and UNREAL_ENGINE_REPO for the appropriate strings):
#!/bin/sh

export LD_LIBRARY_PATH=\
"${PWD}/Plugins/rclUE/Source/ThirdParty/ros2lib":\
"${PWD}/Plugins/rclUE/Source/ThirdParty/ros2lib/std_msgs/lib":\
"${PWD}/Plugins/rclUE/Source/ThirdParty/ros2lib/geometry_msgs/lib":\
"${PWD}/Plugins/rclUE/Source/ThirdParty/ros2lib/sensor_msgs/lib":\
"${PWD}/Plugins/rclUE/Source/ThirdParty/ros2lib/rosgraph_msgs/lib":\
"${PWD}/Plugins/rclUE/Source/ThirdParty/ros2lib/builtin_interfaces/lib":\
"${PWD}/Plugins/rclUE/Source/ThirdParty/ros2lib/ue4_interfaces/lib"

EDITOR_COMMAND="UNREAL_ENGINE_REPO/Engine/Binaries/Linux/UE4Editor"

(exec "$EDITOR_COMMAND" "PROJECT_PATH/PROJECT_NAME.uproject")
  1. For messages not in std_msgs, the appropriate library path needs to be added to LD_LIBRARY_PATH
  2. within the Unreal Editor: Edit->Plugins, search and enable for rclc
  3. change the world settings to use meters as units instead of the default centimeters
  4. Example_BP_PubSub.mp4 shows how to build a PubSub example using Blueprint

How to install this plugin (Ubuntu 18):

Development switched from Ubuntu18+noetic to Ubuntu20+foxy - please refer to the Ubuntu 20 and adapt it

Windows is currently unsupported

Dependencies

Compile time (includes+libs)

  • rcl
  • rcl_action
  • rcl_interfaces
  • rcl_lifecycle
  • rcl_yaml_param_parser
  • rclc
  • rclc_lifecycle
  • rcutils
  • rmw
  • tracetools
  • rosidl_adapter
  • rosidl_cmake
  • rosidl_generator_c
  • rosidl_parser
  • rosidl_typesupport_c
  • rosidl_typesupport_interface
  • rosidl_typesupport_introspection_c
  • rosidl_runtime_c (Ubuntu 20/Foxy)
  • rosgraph_msgs
  • std_msgs
  • ue4_interfaces (contains an example of custom interface)

Runtime (in addition to the compile time requirements)

Currently, the plugin requires the following shared libraries at runtime:

  • libfastcdr.so
  • libfastcdr.so.1
  • libfastrtps.so.1 (Ubuntu 18/Eloquent)
  • libfastrtps.so.2 (Ubuntu 20/Foxy)
  • librcl_logging_spdlog.so
  • librmw_fastrtps_cpp.so
  • librmw_fastrtps_shared_cpp.so
  • librmw_implementation.so
  • librosidl_typesupport_cpp.so (Ubuntu 20/Foxy)
  • librosidl_typesupport_fastrtps_cpp.so
  • librosidl_typesupport_fastrtps_c.so
  • librcpputils.so (Ubuntu 20/Foxy)
  • librmw_dds_common.so (Ubuntu 20/Foxy)
  • librmw_dds_common__rosidl_typesupport_cpp.so (Ubuntu 20/Foxy)
  • librmw_dds_common__rosidl_typesupport_fastrtps_cpp.so (Ubuntu 20/Foxy)

Getting Started

The plugin folder contains a video "Example_BP_PubSub.mp4" demonstrating how to setup a PubSub example in Blueprint.

An example setup for Turtlebot3 using this plugin can be found at https://github.com/rapyuta-robotics/turtlebot3-UE

Notes on working with ROS2 and UE4

  • rcl and void* types cannot be managed by UE4 (no UPROPERTY) and therefore can't be used directly in Blueprint. Whenever access to these variables is needed, the user should write a class to wrap it and all of their handling must be done in C++.
  • some basic numerical types are not natively supported in Blueprint (e.g. double, unsigned int). In order to use these, a workaround is needed (a plugin implementing those types for BP, a modified UE4 or a custom implementation).
  • In autogenerated messages, the method MsgToString() should be implemented by the user as its current purpose is to help debugging.