- Unreal Engine 4 based robot simulator with ROS integration
- UE Version: 4.27
- Version using SDF for loading robots.
See
gzsdf
for convertingURDF
toSDF
.
- drag and drop a compatible
urdf
in the content menu:
- drag and drop the the generated
urdf data asset
file in the world:
- resulting generated robot model:
Plugin Dependencies
Installation
- place the URobosim into the plugin folder of your project
- place all plugin dependencies into the plugin folder of your project
- add URoboSim as dependency to the *.Build.cs
ROS requirements
- install ROS (tested on kinetic)
- install rosbridge_suite
- add urobosim_msgs to your workspace
Tools
Setup Editor
- open Editor Settings
- search for CPU
- disable "Use less CPU when in Background"
Importing new Robot Model
-
convert xacro to urdf:
rosrun xacro xacro --inorder -o model.urdf model.urdf.xacro
-
convert urdf to sdf:
gz sdf -v 1.6 -p /my_urdf.urdf > /my_sdf.sdf
-
replace ' with ":
sed -i "s/'/\"/g" my_sdf.sdf
-
convert .stl and .dae files to .fbx
- you can use this blender script (experimental state) FBX conversion
-
Source ROS environment before starting UE4.
- Currently only ros python tool "catkin build" supported (catkin_make creates different ROS_PACKAGE_PATH which unreal uses to finds all ros packages)
-
Start unreal
-
Create Collision channel Robot in new Projects
-
Click import
- Select sdf
- Tick combine meshes
- Click ImportAll (if first mesh does not include textures the rest will be loaded without texture. Workaround: click import until mesh with texture is imported)
- Drag and drop the created asset into the world (while dragging wait for the mesh creation to be finished before dropping the model)
Setup GameInstance
- Create Blueprint of RoboSimGameInstance or adjust URoboSimGameInstance of the URoboSim Content
- Open the Project Settings (Edit > ProjectSettings)
- In Maps & Modes set
- Default GameMode to GameMode
- GameInstance to the RoboSimGameInstance
Add Controller
- create new data asset, right click into ContentBrowser > Miscellaneous > Data Asset
- search for RControllerDataAsset
- double click on the created asset
- add robot name and controller configurations
- drag and drop the config file into the world
Add ROSCommunication
- create new data asset, right click into ContentBrowser > Miscellaneous > Data Asset
- search for RROSCommunicationDataAsset
- double click on the created asset
- add robot name and communication configurations
- drag and drop the config file into the world
FQA
- The robot in dynamic mode wobbles/moves strange
- Unreal has problems with long kinematic chains
- Try optimizing the joint controller parameters
- Try small changes in joint space large changes might lead to overswinging