Skip to content

Commit

Permalink
Merge pull request #13 from stereolabs/v4.0.2
Browse files Browse the repository at this point in the history
V4.0.2
  • Loading branch information
Bvallon-sl authored Apr 25, 2023
2 parents 328d5d7 + 30b983a commit b76bf04
Show file tree
Hide file tree
Showing 87 changed files with 175 additions and 427 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ The remap asset **must** be set in the **Anim blueprint**, in the **ZED Livelink

For example, if you are using the Body format *Body_38*, open the **ABP_ZED_Manny** anim blueprint, select the **ZED LivelinkPose** component and, in the Detail panel, set the **Remap Asset** field to **RemapAssetBody38**

![](UnrealProject/images/remap_asset_selection.PNG)
![](./images/remap_asset_selection.PNG)
Binary file modified UnrealProject/Content/Maps/LiveLinkMap.umap
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified UnrealProject/Content/ZED/Blueprints/Animation/ABP_ZED_Manny.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified UnrealProject/Content/ZED/Blueprints/Animation/BP_ZED_Manny.uasset
Binary file not shown.
Binary file not shown.
311 changes: 0 additions & 311 deletions UnrealProject/README.md

This file was deleted.

2 changes: 0 additions & 2 deletions UnrealProject/Source/ZEDUnrealLiveLink.Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ public ZEDUnrealLiveLinkTarget(TargetInfo Target) : base(Target)
Type = TargetType.Game;
DefaultBuildSettings = BuildSettingsVersion.V2;

BuildEnvironment = TargetBuildEnvironment.Unique;

GlobalDefinitions.Add("ALLOW_UDP_MESSAGING_SHIPPING=1");

ExtraModuleNames.AddRange( new string[] { "ZEDUnrealLiveLink" } );
Expand Down
2 changes: 1 addition & 1 deletion UnrealProject/ZEDUnrealLiveLink.uproject
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"FileVersion": 3,
"EngineAssociation": "{450BA52B-48CB-098E-7C7F-69A0E7DEE36E}",
"EngineAssociation": "5.1",
"Category": "",
"Description": "",
"Modules": [
Expand Down
Empty file removed UnrealProject/images/.gitkeep
Empty file.
Binary file removed UnrealProject/images/animgraph.jpg
Binary file not shown.
Binary file removed UnrealProject/images/avatarlivelink.jpg
Binary file not shown.
Binary file removed UnrealProject/images/body_converted_32_joints.jpg
Binary file not shown.
Binary file removed UnrealProject/images/capture_livelink_install.jpg
Binary file not shown.
Binary file removed UnrealProject/images/capture_plugin.jpg
Binary file not shown.
Binary file removed UnrealProject/images/coordinate_frame.jpg
Binary file not shown.
Binary file removed UnrealProject/images/create_remap_asset_class.jpg
Binary file not shown.
Binary file removed UnrealProject/images/createanimblueprint.jpg
Binary file not shown.
Binary file removed UnrealProject/images/createremapasset.jpg
Binary file not shown.
Binary file removed UnrealProject/images/forcefrontxaxis.jpg
Binary file not shown.
Binary file removed UnrealProject/images/import_checkboxes.jpg
Binary file not shown.
Binary file removed UnrealProject/images/levelblueprint1.jpg
Binary file not shown.
Binary file removed UnrealProject/images/levelblueprint2.jpg
Binary file not shown.
Binary file removed UnrealProject/images/michelle_leftshoulder.jpg
Binary file not shown.
Binary file not shown.
Binary file removed UnrealProject/images/michelle_tpose.jpg
Binary file not shown.
Binary file removed UnrealProject/images/project_screen.jpg
Binary file not shown.
Binary file removed UnrealProject/images/remappingasset.jpg
Binary file not shown.
File renamed without changes
File renamed without changes
Binary file added images/capture_livelink_install2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file added images/capture_plugin2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added images/capture_zed_connected2.jpg
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
152 changes: 87 additions & 65 deletions zed-livelink-fusion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,20 @@ It can be send through local network on Windows and Linux computers.
## Getting started

- First, download the latest version of the ZED SDK on [stereolabs.com](https://www.stereolabs.com/developers/)
- For more information, read the ZED [Documentation](https://www.stereolabs.com/docs) and [API documentation](https://www.stereolabs.com/docs/api/)
- For more information, read the ZED [Documentation](https://www.stereolabs.com/docs) and [live link documentation](https://www.stereolabs.com/docs/livelink/)


To compile the tool from source, you will require a source build of Unreal Engine.
To compile the tool from source, you will require a source build of Unreal Engine. For more information, read the [Building ZED Live Link Plugin](https://www.stereolabs.com/docs/livelink/building-the-plugin/) documentation page.

## Download the Engine
## Using ZED Live Link

We provide you an Unreal project that already contains the different assets necessary to animate avatars properly using the **ZED Live Link** skeleton data.

You will be able to use directly this project by hitting play while the **ZED Live Link sample** is running and see a default avatar animate. We are showing how to add your own models here: [Animate New Avatar](/livelink/animate-new-avatar/).

In this tutorial, you'll learn how to use our **ZED Live Link sample**, connect it to our Unreal Project and animate a default avatar with the **Live Link** skeleton data. You must follow these steps:

### 1. Download the Engine

To gain access to the UE engine code, please follow the steps below:

Expand All @@ -34,106 +42,120 @@ To gain access to the UE engine code, please follow the steps below:
> *If the invitation isn't sent, clicking on the following link seems to trigger it: [Unreal Group](https://github.com/orgs/EpicGames).
### 2. Open the Unreal Project

## Build for Windows
Open our *ZEDUnrealLiveLink.uproject* project.

### Compile from Source
* In your project root directory right click on the **ZEDUnrealLiveLink.uproject** file and select **Generate Visual Studio project files** in the context menu.
* Open Visual Studio and compile. Launch the project from the **uproject** file or Visual Studio.

1. Inside the root directory, run **Setup.bat**. This will check all the project dependencies and update them as needed.
2. Clone this repository inside of <Engine Install Folder>\Engine\Source\Programs.
3. Run **GenerateProjectFiles.bat** to create project files for the engine.
4. Load the project into Visual Studio by double-clicking on the UE5.sln file, then right click on the ZEDLiveLink target and select **Build**.
5. The binaries will be placed in <Engine Install Folder>\Engine\Binaries\Win64\ZEDLiveLink\.
If these options are not available, make sure your Visual Studio install is correctly setup.

## Build for Linux
### 3. Enable the Live Link Plugin in Unreal

### Compile from Source
You can follow these steps if the Live Link Plugin is not enabled yet in your project.

1. Go into the folder you just downloaded/cloned and run **Setup.sh** from the terminal. This will check all the project dependencies and update them as needed.
2. Clone this repository inside of <Engine Install Folder>/Engine/Source/Programs.
3. In the Engine root directory, run **GenerateProjectFiles.sh**.
4. Run **make** to build the Engine.
5. Go to UnrealEngine/Engine/Build/BatchFiles and open a terminal.
6. Build the plugin with the command :
```bash
$ ./RunUAT.sh BuildGraph -Script=Engine/Source/Programs/zed-livelink-plugin/BuildZEDLinux.xml -Target="Stage ZEDLiveLink Linux"
```
7. The binaries will be placed in <Engine Install Folder>/Engine/Binaries/Linux/ZEDLiveLink/.
1. Inside your project, In the Menu Bar under **Edit**, select **Plugins**.


![](../images/capture_plugin2.jpg)


2. Under the Animation section, click Enabled for Live Link, and Yes on the confirmation window, then restart the Editor.


![](../images/capture_livelink_install2.jpg)

### 4. Select the remap asset

The ZED SDK now has multiple skeleton formats (Body 34, 38, and 70) available for animating a 3D model.
You need to make sure the correct remap asset is selected in the Anim Blueprint of Actor you are using in your level. Indeed, each body format has its own remap asset (as the name and numbers of joint is different).
The remap asset **must** be set in the **Anim blueprint**, in the **ZED Livelink** pose component.

For example, if you are using the Body format *Body_38*, open the **ABP_ZED_Manny** anim blueprint, select the **ZED LivelinkPose** component and, in the Detail panel, set the **Remap Asset** field to **RemapAssetBody38**

![](../images/remap_asset_selection.jpg)

### 4. Run ZED Live Link

The release 4.0 of the ZED SDK introduced the Fusion API which allow you to fuse skeleton data from multiples cameras. This features is also supported in the project.

At this point, you must run the ZED Live Link executable. It will call the ZED SDK in order to compute skeleton data and stream it to the Unreal project. So you must make sure to have the ZED SDK installed on the machine that will run the ZED Live Link sample.

A pre-built `ZEDLiveLinkFusion` sender for the current SDK version is located in `zed-livelink/zed-livelink-fusion/Releases/your system/`.

To learn how to build the ZED Live link sample yourself, take a look at our [Build Zed Live Link](/livelink/building-the-plugin/) documentation page.

### Using the Live Link app
- Open a terminal in the folder containing the ZED Live Link executable, and run

The ZED Live link sample now requires a Config file (Json format) to run. This file contains all the parameters from the ZED SDK that can be modified in this sample.
```bash
$ ./ZEDLiveLinkFusion
```

#### Adjust ZED SDK Parameters

The ZED Live link sample requires a configuration file (Json format) to run. This file contains all the parameters from the ZED SDK that can be modified in this sample.
By default, the sample will try to open a json called "ZEDFusionLiveLinkConfig.json" located next to this executable.

The Fusion API requires a calibration file to be able to fuse the data from multiple camera.
This file cam be generated using the ZED 360 tool available with the ZED SDK. Once your calibration file is ready,
in the ZEDFusionLivelink.json file, set the value of **json_config_filename** to the path to this calibration file.

Your configuration file will look like this :
The configuration file looks like this :

```bash
```json
{
"InitParameters":
{
"resolution": "HD1080",
"fps": 30,
"depth_mode": "ULTRA"
"resolution": "HD1080",
"fps": 30,
"depth_mode": "ULTRA"
},
"BodyTrackingParameters":
{
"detection_model": "HUMAN_BODY_MEDIUM",
"body_format": "BODY_38",
"body_selection": "FULL",
"confidence": 15,
"max_range": -1,
"minimum_keypoints_threshold" : -1
"detection_model": "HUMAN_BODY_ACCURATE",
"body_format": "BODY_38",
"body_selection": "FULL",
"confidence": 40,
"max_range": -1,
"minimum_keypoints_threshold" : -1
},
"InitFusionParameters":
{
"json_config_filename": "",
"output_performance_metrics": true,
"verbose": false

},
"BodyTrackingFusionParameters":
{
"skeleton_minimm_allowed_keypoints": -1,
"skeleton_minimum_allowed_camera": -1,
"skeleton_smoothing": 0
}
"InitFusionParameters":
{
"json_config_filename": "",
"output_performance_metrics": true,
"verbose": false
},
"BodyTrackingFusionParameters":
{
"skeleton_minimm_allowed_keypoints": -1,
"skeleton_minimum_allowed_camera": -1,
"skeleton_smoothing": 0
}
}
```

To change the name or location of the config file, add it as argument.
For example, to use a file called "ConfigFile.json", run :

```bash
$ ./ZEDLiveLinkFusion ConfigFile.json
```
3. You can see the connection status in the terminal.

- On Windows :

![](./doc_images/capture_zed_connected.jpg)
```

You can get more information about the different parameters role by looking at the [API documentation](https://www.stereolabs.com/docs/api/).

### Setting up a Unreal Engine Project
By default, the Live Link sample will try to open a json file called **ZEDFusionLiveLinkConfig.json** next to the executable.

But you can also give the path to your config file as an argument when running the Live Link sample :

```bash
$ ./ZEDLiveLinkFusion path/to/config/file.json
```

### Troubleshooting

- Your firewall might block the data stream. If you do not see the ZED Source in the Live Link window, try to disable it.

- If the ZED Source is not detected in UnrealEngine, enable **Enable by default** in **Edit** -> **Project Settings** -> **UDP Messaging** -> **Enable by default**

![](./doc_images/EnableByDefault.jpg)
![](../images/EnableByDefault.jpg)

- You might also need to specify the "Unicast Endpoint" parameter if you are using the same machine for the ZED Livelink sample and the Unreal Project. In this case,
set the parameter to "127.0.0.1".


#### On Linux

If the plugin crashes at the start, try to run the ldd command onto the sl_zed_c.so library :
Expand All @@ -146,4 +168,4 @@ It will show all the dependencies required by the .so and allow you to install a

Note that the c wrapper used for the Live link plugin is also available here : https://github.com/stereolabs/zed-c-api.

If you encounter issues running the live link plugin, do not hesitate to build the wrapper yourself and place it in the lib/win64 or /linux folder.
If you encounter issues running the live link plugin, do not hesitate to build the wrapper yourself and place it in the `lib/win64` or `lib/linux` folder.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"InitParameters":
{
"resolution": "HD1080",
"resolution": "HD720",
"fps": 30,
"depth_mode": "ULTRA"
},
Expand Down
Binary file modified zed-livelink-fusion/Release/linux/ZEDLiveLinkFusion
100644 → 100755
Binary file not shown.
Binary file modified zed-livelink-fusion/Release/linux/libsl_zed_c.so
100644 → 100755
Binary file not shown.
Binary file modified zed-livelink-fusion/Release/win64/ZEDLiveLinkFusion.exe
Binary file not shown.
Binary file modified zed-livelink-fusion/Release/win64/sl_zed_c.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion zed-livelink-fusion/ZEDFusionLiveLinkConfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"InitParameters":
{
"resolution": "HD1080",
"resolution": "HD720",
"fps": 30,
"depth_mode": "ULTRA"
},
Expand Down
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed zed-livelink-fusion/doc_images/capture_plugin.jpg
Diff not rendered.
Diff not rendered.
Binary file modified zed-livelink-fusion/lib/linux/libsl_zed_c.so
100644 → 100755
Binary file not shown.
Binary file modified zed-livelink-fusion/lib/win64/sl_zed_c.dll
Binary file not shown.
Loading

0 comments on commit b76bf04

Please sign in to comment.