浏览代码

[AIRO-420] Adding Pick and Place Integration Test (#228)

* AIRO-420 Adding integration tests to PickAndPlaceProject

* Updating version in tutorial and fixing TargetPlacement bug.
/dev-backup
GitHub 4 年前
当前提交
5b9c56db
共有 45 个文件被更改,包括 2414 次插入132 次删除
  1. 9
      .gitignore
  2. 59
      .yamato/yamato-config.yml
  3. 4
      tutorials/pick_and_place/1_urdf.md
  4. 6
      tutorials/pick_and_place/PickAndPlaceProject/.gitignore
  5. 2
      tutorials/pick_and_place/PickAndPlaceProject/Assets/DemoScripts/Demo.cs
  6. 29
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Prefabs/TargetPlacement.prefab
  7. 12
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/EditMode/EditMode.asmdef
  8. 121
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/EditMode/PickAndPlaceMessageGenerationtests.cs
  9. 3
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/EditMode/PlayerBuildTests.cs
  10. 27
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/PlayMode/PlayMode.asmdef
  11. 3
      tutorials/pick_and_place/PickAndPlaceProject/Assets/URDF/niryo_one/niryo_one_urdf/meshes/collada/arm_link.dae.meta
  12. 3
      tutorials/pick_and_place/PickAndPlaceProject/Assets/URDF/niryo_one/niryo_one_urdf/meshes/collada/base_link.dae.meta
  13. 3
      tutorials/pick_and_place/PickAndPlaceProject/Assets/URDF/niryo_one/niryo_one_urdf/meshes/collada/elbow_link.dae.meta
  14. 3
      tutorials/pick_and_place/PickAndPlaceProject/Assets/URDF/niryo_one/niryo_one_urdf/meshes/collada/forearm_link.dae.meta
  15. 3
      tutorials/pick_and_place/PickAndPlaceProject/Assets/URDF/niryo_one/niryo_one_urdf/meshes/collada/hand_link.dae.meta
  16. 3
      tutorials/pick_and_place/PickAndPlaceProject/Assets/URDF/niryo_one/niryo_one_urdf/meshes/collada/shoulder_link.dae.meta
  17. 3
      tutorials/pick_and_place/PickAndPlaceProject/Assets/URDF/niryo_one/niryo_one_urdf/meshes/collada/wrist_link.dae.meta
  18. 14
      tutorials/pick_and_place/PickAndPlaceProject/Packages/manifest.json
  19. 8
      tutorials/pick_and_place/PickAndPlaceProject/ProjectSettings/EditorBuildSettings.asset
  20. 22
      tutorials/pick_and_place/PickAndPlaceProject/ProjectSettings/EditorSettings.asset
  21. 12
      tutorials/pick_and_place/PickAndPlaceProject/ProjectSettings/ProjectSettings.asset
  22. 4
      tutorials/pick_and_place/PickAndPlaceProject/ProjectSettings/ProjectVersion.txt
  23. 8
      tutorials/pick_and_place/PickAndPlaceProject/Assets/RosMessages.meta
  24. 8
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Scripts.meta
  25. 176
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/EditMode/IntegrationTest.cs
  26. 11
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/EditMode/IntegrationTest.cs.meta
  27. 8
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/PlayMode/PlayModeTestScenes.meta
  28. 83
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/PlayMode/TargetPlacementTests.cs
  29. 673
      .yamato/PickAndPlaceTests/IntegrationTestSettings.asset
  30. 66
      .yamato/PickAndPlaceTests/set-up-integration-tests.py
  31. 11
      .yamato/PickAndPlaceTests/start-ros.bash
  32. 16
      tutorials/pick_and_place/PickAndPlaceProject/Assets/RosMessages/Unity.Robotics.RosMessages.asmdef
  33. 7
      tutorials/pick_and_place/PickAndPlaceProject/Assets/RosMessages/Unity.Robotics.RosMessages.asmdef.meta
  34. 185
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Scripts/TargetPlacement.cs
  35. 11
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Scripts/TargetPlacement.cs.meta
  36. 17
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Scripts/Unity.Robotics.PickAndPlace.asmdef
  37. 7
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Scripts/Unity.Robotics.PickAndPlace.asmdef.meta
  38. 874
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/PlayMode/PlayModeTestScenes/TargetPlacementTest.unity
  39. 7
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/PlayMode/PlayModeTestScenes/TargetPlacementTest.unity.meta
  40. 25
      tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/PlayMode/ExamplePlayModeTests.cs
  41. 0
      /tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/PlayMode/TargetPlacementTests.cs.meta

9
.gitignore


.DS_Store
.swp
*.swp
# Generated by local utr runs
.Editor
.download
.bin
test-results
tutorials/pick_and_place/PickAndPlaceProject/Packages/packages-lock.json

59
.yamato/yamato-config.yml


name: Robotics Hub Tests
agent:
type: Unity::VM
image: robotics/ci-ubuntu20:latest
flavor: i1.large
type: Unity::VM
image: robotics/ci-ubuntu20:v0.1.0pnp-796097
flavor: i1.large
PATH: /root/.local/bin:/home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
PATH: /root/.local/bin:/home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
- git submodule update --init --recursive
# TODO: Fix this hack - our bokken image is missing a .NET dependency (System.CodeDom) without which causes compilation to fail
- rm ./tutorials/pick_and_place/PickAndPlaceProject/Assets/DemoScripts/Demo.*
# This is another hack to ensure audio is disabled. Unity built-in audio fails to initialize in our Bokken image.
- "sed -i -e '/m_DisableAudio/ s/: .*/: 1/' ./tutorials/pick_and_place/PickAndPlaceProject/ProjectSettings/AudioManager.asset"
- python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
- unity-downloader-cli -u 2020.2.0b9 -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
- git clone git@github.cds.internal.unity3d.com:unity/utr.git utr
- utr/utr --testproject=./tutorials/pick_and_place/PickAndPlaceProject --editor-location=.Editor --reruncount=0 --artifacts_path=test-results --suite=playmode --suite=editor --platform=Editor --editorTestsCategories MessageGeneration
- mkdir -p ./tutorials/pick_and_place/PickAndPlaceProject/Assets/Scripts && cp ./tutorials/pick_and_place/Scripts/*.cs ./tutorials/pick_and_place/PickAndPlaceProject/Assets
- utr/utr --testproject=./tutorials/pick_and_place/PickAndPlaceProject --editor-location=.Editor --reruncount=0 --artifacts_path=test-results --suite=playmode --suite=editor --platform=Editor --editorTestsCategories BuildTests
- git submodule update --init --recursive
# We must remove the Demo.cs script because the System.CodeDom assembly is not in the bokken .NET sdk
- rm ./tutorials/pick_and_place/PickAndPlaceProject/Assets/DemoScripts/Demo.*
# Ensure audio is disabled. Unity built-in audio fails to initialize in our Bokken image.
- "sed -i -e '/m_DisableAudio/ s/: .*/: 1/' ./tutorials/pick_and_place/PickAndPlaceProject/ProjectSettings/AudioManager.asset"
- python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
- unity-downloader-cli -u 2020.3.11f1 -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
- git clone git@github.cds.internal.unity3d.com:unity/utr.git utr
# Explicitly run MessageGeneration tests first to generate dependencies
- utr/utr --testproject=./tutorials/pick_and_place/PickAndPlaceProject --editor-location=.Editor --reruncount=0
--artifacts_path=test-results --suite=editor --platform=Editor --editorTestsCategories
MessageGeneration
# Run each category of tests in its own process, in order of increasing complexity
- utr/utr --testproject=./tutorials/pick_and_place/PickAndPlaceProject --editor-location=.Editor --reruncount=0
--artifacts_path=test-results --suite=playmode --suite=editor --platform=Editor --editorTestCategories UnitTests
# - utr/utr --testproject=./tutorials/pick_and_place/PickAndPlaceProject --editor-location=.Editor --reruncount=0
#--artifacts_path=test-results --suite=editor --platform=Editor --testfilter BuildTests.PlayerBuilder.BuildPlayerLinux
- python3 .yamato/PickAndPlaceTests/set-up-integration-tests.py
#TODO: Determine how best to capture ROS logging as test artifacts
- /bin/bash .yamato/PickAndPlaceTests/start-ros.bash
# NOTE: Simply specifying the testCategory is not enough to get a test marked with [Explicit] to run
- utr/utr --testproject=./tutorials/pick_and_place/PickAndPlaceProject --editor-location=.Editor --reruncount=0
--artifacts_path=test-results --suite=editor --platform=Editor --testfilter IntegrationTests.RosIntegrationTests
#TODO: Determine when it would be prudent to run BuildTests and add them here or in a new config
cancel_old_ci: true
expression: |
(pull_request.target eq "main" AND
NOT pull_request.push.changes.all match ["**/*.md","**/*.jpg","**/*.jpeg","**/*.gif","**/*.pdf"]) OR
(push.branch eq "dev" AND
NOT push.changes.all match ["**/*.md","**/*.jpg","**/*.jpeg","**/*.gif","**/*.pdf"])
cancel_old_ci: true
expression: |
(pull_request.target in ["main", "dev"] AND
NOT pull_request.changes.all match ["**/*.md","**/*.jpg","**/*.jpeg","**/*.gif","**/*.pdf"])
logs:
paths:
- "test-results/**/*"
logs:
paths:
- "test-results/**/*"

4
tutorials/pick_and_place/1_urdf.md


1. Install [Unity Hub](https://unity3d.com/get-unity/download).
1. Go to the [Unity 2020.2 Beta website](https://unity3d.com/unity/beta/2020.2.0b9) to install this project's version of Unity: **2020.2.0b9**.
1. Go it the "Installs" tab in the Unity Hub, and click the "Add" button. Select Unity **2020.3.11f1 (LTS)**. If this version is no longer available through the hub, you can find it in the [Unity Download Archive](https://unity3d.com/get-unity/download/archive).
1. Click the "Add" button in the top right of the "Projects" tab on Unity Hub, and navigate to and select the PickAndPlaceProject directory within this cloned repository (`/PATH/TO/Unity-Robotics-Hub/tutorials/pick_and_place/PickAndPlaceProject/`) to add the tutorial project to your Hub.
1. Go to the "Projects" tab in the Unity Hub, click the "Add" button, and navigate to and select the PickAndPlaceProject directory within this cloned repository (`/PATH/TO/Unity-Robotics-Hub/tutorials/pick_and_place/PickAndPlaceProject/`) to add the tutorial project to your Hub.
![](img/hub_addproject.png)

6
tutorials/pick_and_place/PickAndPlaceProject/.gitignore


/[Aa]ssets/[Rr]os[Mm]essages/
/[Aa]ssets/[Rr]os[Mm]essages.meta
# Ignore scripts that are expected to get copied in at some point
/**/SourceDestinationPublisher.*
/**/TrajectoryPlanner.*
# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
/[Mm]emoryCaptures/

2
tutorials/pick_and_place/PickAndPlaceProject/Assets/DemoScripts/Demo.cs


CreateRosConnection();
CreateTrajectoryPlannerPublisher();
}
void Update()
{
// Make sure to publish only once in the demo

29
tutorials/pick_and_place/PickAndPlaceProject/Assets/Prefabs/TargetPlacement.prefab


- component: {fileID: 850690186460591411}
- component: {fileID: 850690186460591410}
- component: {fileID: 850690186460591413}
- component: {fileID: 4980278694990496136}
- component: {fileID: 7978903071639371792}
m_Layer: 0
m_Name: TargetPlacement
m_TagString: Untagged

m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &4980278694990496136
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 850690186460591414}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1.2, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &7978903071639371792
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 850690186460591414}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f7ac960dc884b4042a0de8920854c9e5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Target: {fileID: 0}
m_ColorAlpha: 100

12
tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/EditMode/EditMode.asmdef


"name": "EditMode",
"rootNamespace": "",
"references": [
"UnityEngine.TestRunner",
"UnityEditor.TestRunner",
"Unity.Robotics.ROSTCPConnector.Editor",
"Unity.Robotics.ROSTCPConnector"
"GUID:27619889b8ba8c24980f49ee34dbb44a",
"GUID:0acc523941302664db1f4e527237feb3",
"GUID:1da8e23352f14494396eac5033ba9894",
"GUID:625bfc588fb96c74696858f2c467e978",
"GUID:204b12c73a0ba074c888ec09a2713605",
"GUID:465c1207fffb96245a352265e7622205",
"GUID:b1ef917f7a8a86a4eb639ec2352edbf8",
"GUID:79169c04a5f9b014e919b69ac8df4286"
],
"includePlatforms": [
"Editor"

121
tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/EditMode/PickAndPlaceMessageGenerationtests.cs


using Unity.Robotics.ROSTCPConnector.MessageGeneration;
using Unity.Robotics.ROSTCPConnector.Editor.MessageGeneration;
using UnityEditor;
using UnityEngine;
[TestFixture]
[Category("MessageGeneration")]
public class PickAndPlaceMessageGenerationTests
namespace MessageGenerationTests
// Relative path to the directory containing the catkin packages
static readonly string k_ROSDirectory = Path.GetFullPath(Path.Combine("..", "ROS", "src"));
static string m_MessageGenOutputPath => MessageGenBrowserSettings.Get().outputPath;
// This gets a special category to enable running independently when needed to generate message definitions
[TestFixture, Category("MessageGeneration")]
public class MessageGenerationTests
{
enum PathType
{
File,
Directory
}
// Relative path to the directory containing the catkin packages
static readonly string k_ROSDirectory = Path.GetFullPath(Path.Combine("..", "ROS", "src"));
static string m_MessageGenOutputPath => MessageGenBrowserSettings.Get().outputPath;
static void WarnIfAlreadyExists(string path, PathType pathType)
{
var alreadyExists = pathType == PathType.File ? File.Exists(path) : Directory.Exists(path);
if (alreadyExists)
{
Debug.LogWarning($"{path} already exists. Test can't validate files were generated correctly unless " +
"this path is manually deleted first.");
}
}
static void AssertExists(string path, PathType pathType)
{
Assert.IsTrue(pathType == PathType.File ? File.Exists(path) : Directory.Exists(path));
}
// Define more individual messages to run generation on within this test case enumerable
static IEnumerable<TestCaseData> IndividualMessages()
{
yield return new TestCaseData(Path.Combine(k_ROSDirectory, "moveit_msgs", "msg", "RobotTrajectory.msg"));
}
// Define more individual messages to run generation on within this test case enumerable
static IEnumerable<TestCaseData> IndividualMessages()
{
yield return new TestCaseData(Path.Combine(k_ROSDirectory, "moveit_msgs", "msg", "RobotTrajectory.msg"));
}
// Define directories of message files to be generated here
static IEnumerable<TestCaseData> MessageDirectories()
{
yield return new TestCaseData(Path.Combine(k_ROSDirectory, "niryo_moveit", "msg"));
}
// Define directories of message files to be generated here
static IEnumerable<TestCaseData> MessageDirectories()
{
yield return new TestCaseData(Path.Combine(k_ROSDirectory, "niryo_moveit", "msg"));
}
// Define directories of service files to be generated here
static IEnumerable<TestCaseData> ServiceDirectories()
{
yield return new TestCaseData(Path.Combine(k_ROSDirectory, "niryo_moveit", "srv"));
}
// Define directories of service files to be generated here
static IEnumerable<TestCaseData> ServiceDirectories()
{
yield return new TestCaseData(Path.Combine(k_ROSDirectory, "niryo_moveit", "srv"));
}
[Test]
[TestCaseSource(nameof(IndividualMessages))]
public void TestMessageBuildSingle_ThrowsNoExceptions(string messageToBuild)
{
MessageAutoGen.GenerateSingleMessage(messageToBuild, m_MessageGenOutputPath);
AssetDatabase.Refresh();
}
[Test]
[TestCaseSource(nameof(IndividualMessages))]
public void TestMessageBuildSingle_ThrowsNoExceptions(string messageToBuild)
{
var msgPath = MessageAutoGen.GetMessageClassPath(messageToBuild, m_MessageGenOutputPath);
Debug.Log($"Generating code for {messageToBuild}, output should be at {msgPath}");
WarnIfAlreadyExists(msgPath, PathType.File);
MessageAutoGen.GenerateSingleMessage(messageToBuild, m_MessageGenOutputPath);
AssetDatabase.Refresh();
AssertExists(msgPath, PathType.File);
}
[Test]
[TestCaseSource(nameof(MessageDirectories))]
public void TestMessageBuildDirectory_ThrowsNoExceptions(string directoryToBuild)
{
MessageAutoGen.GenerateDirectoryMessages(directoryToBuild, m_MessageGenOutputPath);
AssetDatabase.Refresh();
}
[Test]
[TestCaseSource(nameof(MessageDirectories))]
public void TestMessageBuildDirectory_ThrowsNoExceptions(string directoryToBuild)
{
var msgPath = MessageAutoGen.GetMessageClassPath(directoryToBuild, m_MessageGenOutputPath);
var msgDirectory = Path.GetDirectoryName(msgPath);
Debug.Log($"Generating code in {directoryToBuild}, output should be in {msgDirectory}");
WarnIfAlreadyExists(msgDirectory, PathType.Directory);
MessageAutoGen.GenerateDirectoryMessages(directoryToBuild, m_MessageGenOutputPath);
AssetDatabase.Refresh();
AssertExists(msgDirectory, PathType.Directory);
}
[Test]
[TestCaseSource(nameof(ServiceDirectories))]
public void TestServiceBuildDirectory_ThrowsNoExceptions(string directoryToBuild)
{
ServiceAutoGen.GenerateDirectoryServices(directoryToBuild, m_MessageGenOutputPath);
AssetDatabase.Refresh();
[Test]
[TestCaseSource(nameof(ServiceDirectories))]
public void TestServiceBuildDirectory_ThrowsNoExceptions(string directoryToBuild)
{
var msgPath = ServiceAutoGen.GetServiceClassPaths(directoryToBuild, m_MessageGenOutputPath);
var msgDirectory = Path.GetDirectoryName(msgPath[0]);
Debug.Log($"Generating code in {directoryToBuild}, output should be in {msgDirectory}");
WarnIfAlreadyExists(msgDirectory, PathType.Directory);
ServiceAutoGen.GenerateDirectoryServices(directoryToBuild, m_MessageGenOutputPath);
AssetDatabase.Refresh();
AssertExists(msgDirectory, PathType.Directory);
}
}
}

3
tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/EditMode/PlayerBuildTests.cs


namespace BuildTests
{
[TestFixture]
[Category("BuildTests")]
[TestFixture, Explicit, Category("BuildTests")]
public class PlayerBuilder
{
List<EditorBuildSettingsScene> m_EditorBuildSettingsScenes = new List<EditorBuildSettingsScene>();

27
tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/PlayMode/PlayMode.asmdef


{
"name": "PlayMode",
"optionalUnityReferences": [
"TestAssemblies"
]
}
"rootNamespace": "",
"references": [
"UnityEngine.TestRunner",
"UnityEditor.TestRunner",
"Unity.Robotics.URDFImporter",
"Unity.Robotics.ROSTCPConnector",
"Unity.Robotics.RosMessages",
"Unity.Robotics.PickAndPlace"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll"
],
"autoReferenced": false,
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
],
"versionDefines": [],
"noEngineReferences": false
}

3
tutorials/pick_and_place/PickAndPlaceProject/Assets/URDF/niryo_one/niryo_one_urdf/meshes/collada/arm_link.dae.meta


fileFormatVersion: 2
guid: 4385bf9cdd04d410abf0c13a4671c867
ModelImporter:
serializedVersion: 20101
serializedVersion: 20200
internalIDToNameTable: []
externalObjects: {}
materials:

animationType: 0
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 0
additionalBone: 0
userData:
assetBundleName:

3
tutorials/pick_and_place/PickAndPlaceProject/Assets/URDF/niryo_one/niryo_one_urdf/meshes/collada/base_link.dae.meta


fileFormatVersion: 2
guid: 58835255abb66423abcf30402a3fb236
ModelImporter:
serializedVersion: 20101
serializedVersion: 20200
internalIDToNameTable: []
externalObjects: {}
materials:

animationType: 0
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 0
additionalBone: 0
userData:
assetBundleName:

3
tutorials/pick_and_place/PickAndPlaceProject/Assets/URDF/niryo_one/niryo_one_urdf/meshes/collada/elbow_link.dae.meta


fileFormatVersion: 2
guid: 8b17dab746c4f40c5aea83c9b028635e
ModelImporter:
serializedVersion: 20101
serializedVersion: 20200
internalIDToNameTable: []
externalObjects: {}
materials:

animationType: 0
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 0
additionalBone: 0
userData:
assetBundleName:

3
tutorials/pick_and_place/PickAndPlaceProject/Assets/URDF/niryo_one/niryo_one_urdf/meshes/collada/forearm_link.dae.meta


fileFormatVersion: 2
guid: 9494a43e68bac4ff5b335b4f38685b0f
ModelImporter:
serializedVersion: 20101
serializedVersion: 20200
internalIDToNameTable: []
externalObjects: {}
materials:

animationType: 0
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 0
additionalBone: 0
userData:
assetBundleName:

3
tutorials/pick_and_place/PickAndPlaceProject/Assets/URDF/niryo_one/niryo_one_urdf/meshes/collada/hand_link.dae.meta


fileFormatVersion: 2
guid: 17014b319fad347d09ad182ea939d167
ModelImporter:
serializedVersion: 20101
serializedVersion: 20200
internalIDToNameTable: []
externalObjects: {}
materials:

animationType: 0
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 0
additionalBone: 0
userData:
assetBundleName:

3
tutorials/pick_and_place/PickAndPlaceProject/Assets/URDF/niryo_one/niryo_one_urdf/meshes/collada/shoulder_link.dae.meta


fileFormatVersion: 2
guid: 1a8e3a50f435d489bae37f36bd443001
ModelImporter:
serializedVersion: 20101
serializedVersion: 20200
internalIDToNameTable: []
externalObjects: {}
materials:

animationType: 0
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 0
additionalBone: 0
userData:
assetBundleName:

3
tutorials/pick_and_place/PickAndPlaceProject/Assets/URDF/niryo_one/niryo_one_urdf/meshes/collada/wrist_link.dae.meta


fileFormatVersion: 2
guid: 81700e0c647d64beeab06b71d2b614ae
ModelImporter:
serializedVersion: 20101
serializedVersion: 20200
internalIDToNameTable: []
externalObjects: {}
materials:

animationType: 0
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 0
additionalBone: 0
userData:
assetBundleName:

14
tutorials/pick_and_place/PickAndPlaceProject/Packages/manifest.json


{
"dependencies": {
"com.unity.collab-proxy": "1.3.9",
"com.unity.collab-proxy": "1.5.7",
"com.unity.ide.visualstudio": "2.0.3",
"com.unity.ide.vscode": "1.2.2",
"com.unity.ide.visualstudio": "2.0.8",
"com.unity.ide.vscode": "1.2.3",
"com.unity.robotics.urdf-importer": "https://github.com/Unity-Technologies/URDF-Importer.git?path=/com.unity.robotics.urdf-importer#v0.4.0",
"com.unity.test-framework": "1.1.18",
"com.unity.textmeshpro": "3.0.1",
"com.unity.timeline": "1.4.3",
"com.unity.robotics.urdf-importer": "https://github.com/Unity-Technologies/URDF-Importer.git?path=/com.unity.robotics.urdf-importer#stl-package-import-fix",
"com.unity.test-framework": "1.1.24",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.4.8",
"com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",

8
tutorials/pick_and_place/PickAndPlaceProject/ProjectSettings/EditorBuildSettings.asset


EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes: []
m_Scenes:
- enabled: 0
path: Assets/Tests/PlayMode/PlayModeTestScenes/TargetPlacementTest.unity
guid: 3d328f38f71b71e47bb8d96869012ffe
- enabled: 1
path: Assets/Tests/PlayMode/PlayModeTestScenes/TargetPlacementTest.unity
guid: 3d328f38f71b71e47bb8d96869012ffe
m_configObjects: {}

22
tutorials/pick_and_place/PickAndPlaceProject/ProjectSettings/EditorSettings.asset


EditorSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_ExternalVersionControlSupport: Visible Meta Files
m_LineEndingsForNewScripts: 0
m_LineEndingsForNewScripts: 1
m_DefaultBehaviorMode: 0
m_PrefabRegularEnvironment: {fileID: 0}
m_PrefabUIEnvironment: {fileID: 0}

m_EtcTextureBestCompressor: 4
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref
m_ProjectGenerationRootNamespace:
m_CollabEditorSettings:
inProgressEnabled: 1
m_CachingShaderPreprocessor: 1
m_PrefabModeAllowAutoSave: 1
m_ShowLightmapResolutionOverlay: 1
m_GameObjectNamingDigits: 1
m_GameObjectNamingScheme: 0
m_AssetNamingUsesSpace: 1
m_SerializeInlineMappingsOnOneLine: 1
m_SerializeInlineMappingsOnOneLine: 1
m_DisableCookiesInLightmapper: 0
m_AssetPipelineMode: 1
m_CacheServerMode: 0
m_CacheServerEndpoint:
m_CacheServerNamespacePrefix: default
m_CacheServerEnableDownload: 1
m_CacheServerEnableUpload: 1
m_CacheServerEnableAuth: 0
m_CacheServerEnableTls: 0

12
tutorials/pick_and_place/PickAndPlaceProject/ProjectSettings/ProjectSettings.asset


targetDevice: 2
useOnDemandResources: 0
accelerometerFrequency: 60
companyName: DefaultCompany
productName: PickAndPlaceProject
companyName: UnityRobotics
productName: PickAndPlace
defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0}
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}

androidSupportedAspectRatio: 1
androidMaxAspectRatio: 2.1
applicationIdentifier:
Standalone: com.DefaultCompany.PickAndPlaceProject
Standalone: com.UnityRobotics.PickAndPlace
buildNumber:
Standalone: 0
iPhone: 0

webGLLinkerTarget: 1
webGLThreadsSupport: 0
webGLDecompressionFallback: 0
scriptingDefineSymbols: {}
additionalCompilerArguments: {}
scriptingDefineSymbols:
1:
additionalCompilerArguments:
1: []
platformArchitecture: {}
scriptingBackend: {}
il2cppCompilerConfiguration: {}

4
tutorials/pick_and_place/PickAndPlaceProject/ProjectSettings/ProjectVersion.txt


m_EditorVersion: 2020.2.0b9
m_EditorVersionWithRevision: 2020.2.0b9 (ef2968fa77ae)
m_EditorVersion: 2020.3.11f1
m_EditorVersionWithRevision: 2020.3.11f1 (99c7afb366b3)

8
tutorials/pick_and_place/PickAndPlaceProject/Assets/RosMessages.meta


fileFormatVersion: 2
guid: 7e9ac35ae6089214eb6d10352af3bc26
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
tutorials/pick_and_place/PickAndPlaceProject/Assets/Scripts.meta


fileFormatVersion: 2
guid: d4e987dd3f8374e458f751390c3982b8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

176
tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/EditMode/IntegrationTest.cs


using System;
using System.Collections;
using System.IO;
using NUnit.Framework;
using RosSharp;
using RosSharp.Control;
using RosSharp.Urdf;
using Unity.Robotics.PickAndPlace;
using UnityEngine;
using Unity.Robotics.ROSTCPConnector;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine.TestTools;
namespace IntegrationTests
{
[TestFixture, Explicit, Category("IntegrationTests")]
// IMPORTANT: In order for this category of tests to run correctly, MessageGeneration must be run first and the
// INTEGRATION_TEST script define must be set
public class RosIntegrationTests
{
#region Parameters
// Testing parameters
const float k_TestTimeoutSeconds = 20f;
const string k_NamePackageNiryoMoveIt = "niryo_moveit";
const string k_NameNiryoOne = "niryo_one";
const string k_NameBaseLink = "base_link";
// Prefabs that get instantiated into scene
const string k_NameTable = "Table";
const string k_NameTarget = "Target";
const string k_NameTargetPlacement = "TargetPlacement";
// GameObjects that hold important components
const string k_NameCamera = "Main Camera";
const string k_NameRosConnect = "ROSConnect";
const string k_NamePublisher = "Publisher";
// Parameters for robot joint controller
const float k_ControllerStiffness = 10000f;
const float k_ControllerDamping = 100f;
const float k_ControllerForceLimit = 1000f;
const float k_ControllerSpeed = 30f;
const float k_ControllerAcceleration = 10f;
// Parameters for ROS connection
const string k_IpAddressLoopback = "127.0.0.1";
const int k_HostPort = 10000;
const int k_UnityPort = 5005;
const int k_NumAwaitDataRetries = 10;
const int k_NumAwaitDataSleepSeconds = 1;
const string k_PrefabSuffix = ".prefab";
readonly string k_DirectoryPrefabs = Path.Combine("Assets", "Prefabs");
readonly string k_PathUrdf = Path.Combine("URDF", "niryo_one", "niryo_one.urdf");
readonly string k_PathTestScene = Path.Combine("Assets", "Scenes", "EmptyScene.unity");
readonly Vector3 k_CameraPosition = new Vector3(0, 1.4f, -0.7f);
readonly Quaternion k_CameraRotation = Quaternion.Euler(new Vector3(45, 0, 0));
readonly ImportSettings k_UrdfImportSettings = new ImportSettings
{
choosenAxis = ImportSettings.axisType.yAxis,
convexMethod = ImportSettings.convexDecomposer.unity
};
#endregion
float m_TimeElapsedSeconds;
[SerializeField, HideInInspector]
ROSConnection m_RosConnection;
[SerializeField, HideInInspector]
TargetPlacement m_TargetPlacement;
// NOTE: This check could be made more robust by checking the gripper state of the arm to confirm it has
// released the Target
bool DidPlacementSucceed => m_TargetPlacement.CurrentState == TargetPlacement.PlacementState.InsidePlaced;
[UnityTest]
public IEnumerator TrajectoryPublisher_PickAndPlaceDemo_CompletesTask()
{
#if INTEGRATION_TEST
SetUpScene();
// TODO: This test could be made a PlayMode test once ImportRobot can use the PlayMode URDF import
ImportRobot();
CreateRosConnection();
CreateTrajectoryPlannerPublisher();
yield return new EnterPlayMode();
m_TargetPlacement = GameObject.Find(k_NameTargetPlacement).GetComponent<TargetPlacement>();
Assert.IsNotNull(m_TargetPlacement, $"Unable to find {nameof(TargetPlacement)} attached to a " +
$"GameObject called {k_NameTargetPlacement} in scene.");
var publisher = GameObject.Find(k_NamePublisher).GetComponent<TrajectoryPlanner>();
publisher.PublishJoints();
while(!DidPlacementSucceed && m_TimeElapsedSeconds < k_TestTimeoutSeconds)
{
m_TimeElapsedSeconds += Time.deltaTime;
yield return null;
}
Assert.IsTrue(DidPlacementSucceed, "Pick and Place did not complete before test timed out.");
yield return new ExitPlayMode();
}
void SetUpScene()
{
EditorSceneManager.OpenScene(k_PathTestScene);
InstantiatePrefabFromName(k_NameTable);
InstantiatePrefabFromName(k_NameTarget);
InstantiatePrefabFromName(k_NameTargetPlacement);
var camera = GameObject.Find(k_NameCamera);
camera.transform.position = k_CameraPosition;
camera.transform.rotation = k_CameraRotation;
}
void CreateTrajectoryPlannerPublisher()
{
var planner = new GameObject(k_NamePublisher).AddComponent<TrajectoryPlanner>();
planner.rosServiceName = k_NamePackageNiryoMoveIt;
planner.niryoOne = GameObject.Find(k_NameNiryoOne);
planner.target = GameObject.Find(k_NameTarget);
planner.targetPlacement = GameObject.Find(k_NameTargetPlacement);
}
GameObject InstantiatePrefabFromName(string name)
{
var filepath = Path.Combine(k_DirectoryPrefabs, $"{name}{k_PrefabSuffix}");
var gameObject = (GameObject) PrefabUtility.InstantiatePrefab(
AssetDatabase.LoadAssetAtPath<GameObject>(filepath));
gameObject.name = name;
return gameObject;
}
void CreateRosConnection()
{
m_RosConnection = new GameObject(k_NameRosConnect).AddComponent<ROSConnection>();
m_RosConnection.RosIPAddress = k_IpAddressLoopback;
m_RosConnection.RosPort = k_HostPort;
//m_RosConnection.overrideUnityIP = k_IpAddressLoopback;
//m_RosConnection.unityPort = k_UnityPort;
//m_RosConnection.awaitDataMaxRetries = k_NumAwaitDataRetries;
//m_RosConnection.awaitDataSleepSeconds = k_NumAwaitDataSleepSeconds;
}
void ImportRobot()
{
var urdfFullPath = Path.Combine(Application.dataPath, k_PathUrdf);
var robotImporter = UrdfRobotExtensions.Create(urdfFullPath, k_UrdfImportSettings, false);
// Create is a coroutine that would usually run only in EditMode, so we need to force its execution here
while (robotImporter.MoveNext())
{
}
// Ensure parameters are set to reasonable values
var controller = GameObject.Find(k_NameNiryoOne).GetComponent<Controller>();
controller.stiffness = k_ControllerStiffness;
controller.damping = k_ControllerDamping;
controller.forceLimit = k_ControllerForceLimit;
controller.speed = k_ControllerSpeed;
controller.acceleration = k_ControllerAcceleration;
GameObject.Find(k_NameBaseLink).GetComponent<ArticulationBody>().immovable = true;
#else
throw new NotImplementedException(
"This integration test can only be executed with the INTEGRATION_TEST scripting define set. " +
"The dependencies of this test are not guaranteed to exist in the Project by default.");
#endif
}
}
}

11
tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/EditMode/IntegrationTest.cs.meta


fileFormatVersion: 2
guid: 47248c975ddb5bb498501829315c818d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/PlayMode/PlayModeTestScenes.meta


fileFormatVersion: 2
guid: 01cfe2c2ad3030e45aece82563af9de1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

83
tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/PlayMode/TargetPlacementTests.cs


using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using Unity.Robotics.PickAndPlace;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.TestTools;
[TestFixture, Category("UnitTests")]
public class TargetPlacementTests
{
const int k_NumAllowedFramesStatic = 5;
const int k_NumAllowedFramesDynamic = 20;
const string k_NamePlaced = "TargetPlacementPlaced";
const string k_NameOutside = "TargetPlacementOutside";
const string k_NameFloating = "TargetPlacementFloating";
[UnitySetUp]
public IEnumerator LoadSceneAndStartPlayMode()
{
SceneManager.LoadScene("TargetPlacementTest");
yield return new EnterPlayMode();
}
[UnityTearDown]
public IEnumerator ExitSceneOnTearDown()
{
yield return new ExitPlayMode();
}
public static IEnumerable<TestCaseData> TargetPlacementCases()
{
yield return new TestCaseData(k_NamePlaced, TargetPlacement.PlacementState.InsidePlaced).Returns(null);
yield return new TestCaseData(k_NameOutside, TargetPlacement.PlacementState.Outside).Returns(null);
yield return new TestCaseData(k_NameFloating, TargetPlacement.PlacementState.InsideFloating).Returns(null);
}
TargetPlacement GetTargetPlacement(string name)
{
var targetPlacement = GameObject.Find(name)?.GetComponent<TargetPlacement>();
Assert.IsNotNull(targetPlacement, $"Failed to find {name}");
return targetPlacement;
}
static IEnumerator WaitForState(
TargetPlacement targetPlacement, TargetPlacement.PlacementState stateExpected, int numFramesToWait)
{
var numFramesTested = 0;
while (targetPlacement.CurrentState != stateExpected && numFramesTested < numFramesToWait)
{
numFramesTested++;
yield return null;
}
Assert.AreEqual(stateExpected, targetPlacement.CurrentState);
}
[UnityTest, TestCaseSource(nameof(TargetPlacementCases))]
public IEnumerator TargetPlacement_WithStaticObjects_SetsStateCorrectly(
string name, TargetPlacement.PlacementState stateExpected)
{
var targetPlacement = GetTargetPlacement(name);
yield return WaitForState(targetPlacement, stateExpected, k_NumAllowedFramesStatic);
}
[UnityTest]
public IEnumerator TargetPlacement_WithFallingObject_ChangesStateCorrectly()
{
const string name = "TargetPlacementStateChange";
var targetPlacement = GetTargetPlacement(name);
Assert.AreEqual(TargetPlacement.PlacementState.Outside, targetPlacement.CurrentState,
$"{name} should start with no Target in its bounds.");
// Target should fall into placement and come to reset
yield return WaitForState(
targetPlacement, TargetPlacement.PlacementState.InsideFloating, k_NumAllowedFramesDynamic);
yield return WaitForState(
targetPlacement, TargetPlacement.PlacementState.InsidePlaced, k_NumAllowedFramesDynamic);
}
}

673
.yamato/PickAndPlaceTests/IntegrationTestSettings.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!129 &1
PlayerSettings:
m_ObjectHideFlags: 0
serializedVersion: 21
productGUID: 653f7f2858f49284bbf5f6d04c027b96
AndroidProfiler: 0
AndroidFilterTouchesWhenObscured: 0
AndroidEnableSustainedPerformanceMode: 0
defaultScreenOrientation: 4
targetDevice: 2
useOnDemandResources: 0
accelerometerFrequency: 60
companyName: UnityRobotics
productName: PickAndPlace
defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0}
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
m_ShowUnitySplashScreen: 1
m_ShowUnitySplashLogo: 1
m_SplashScreenOverlayOpacity: 1
m_SplashScreenAnimation: 1
m_SplashScreenLogoStyle: 1
m_SplashScreenDrawMode: 0
m_SplashScreenBackgroundAnimationZoom: 1
m_SplashScreenLogoAnimationZoom: 1
m_SplashScreenBackgroundLandscapeAspect: 1
m_SplashScreenBackgroundPortraitAspect: 1
m_SplashScreenBackgroundLandscapeUvs:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
m_SplashScreenBackgroundPortraitUvs:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
m_SplashScreenLogos: []
m_VirtualRealitySplashScreen: {fileID: 0}
m_HolographicTrackingLossScreen: {fileID: 0}
defaultScreenWidth: 1024
defaultScreenHeight: 768
defaultScreenWidthWeb: 960
defaultScreenHeightWeb: 600
m_StereoRenderingPath: 0
m_ActiveColorSpace: 0
m_MTRendering: 1
mipStripping: 0
numberOfMipsStripped: 0
m_StackTraceTypes: 010000000100000001000000010000000100000001000000
iosShowActivityIndicatorOnLoading: -1
androidShowActivityIndicatorOnLoading: -1
iosUseCustomAppBackgroundBehavior: 0
iosAllowHTTPDownload: 1
allowedAutorotateToPortrait: 1
allowedAutorotateToPortraitUpsideDown: 1
allowedAutorotateToLandscapeRight: 1
allowedAutorotateToLandscapeLeft: 1
useOSAutorotation: 1
use32BitDisplayBuffer: 1
preserveFramebufferAlpha: 0
disableDepthAndStencilBuffers: 0
androidStartInFullscreen: 1
androidRenderOutsideSafeArea: 1
androidUseSwappy: 1
androidBlitType: 0
defaultIsNativeResolution: 1
macRetinaSupport: 1
runInBackground: 1
captureSingleScreen: 0
muteOtherAudioSources: 0
Prepare IOS For Recording: 0
Force IOS Speakers When Recording: 0
deferSystemGesturesMode: 0
hideHomeButton: 0
submitAnalytics: 1
usePlayerLog: 1
bakeCollisionMeshes: 0
forceSingleInstance: 0
useFlipModelSwapchain: 1
resizableWindow: 0
useMacAppStoreValidation: 0
macAppStoreCategory: public.app-category.games
gpuSkinning: 1
xboxPIXTextureCapture: 0
xboxEnableAvatar: 0
xboxEnableKinect: 0
xboxEnableKinectAutoTracking: 0
xboxEnableFitness: 0
visibleInBackground: 1
allowFullscreenSwitch: 1
fullscreenMode: 1
xboxSpeechDB: 0
xboxEnableHeadOrientation: 0
xboxEnableGuest: 0
xboxEnablePIXSampling: 0
metalFramebufferOnly: 0
xboxOneResolution: 0
xboxOneSResolution: 0
xboxOneXResolution: 3
xboxOneMonoLoggingLevel: 0
xboxOneLoggingLevel: 1
xboxOneDisableEsram: 0
xboxOneEnableTypeOptimization: 0
xboxOnePresentImmediateThreshold: 0
switchQueueCommandMemory: 0
switchQueueControlMemory: 16384
switchQueueComputeMemory: 262144
switchNVNShaderPoolsGranularity: 33554432
switchNVNDefaultPoolsGranularity: 16777216
switchNVNOtherPoolsGranularity: 16777216
switchNVNMaxPublicTextureIDCount: 0
switchNVNMaxPublicSamplerIDCount: 0
stadiaPresentMode: 0
stadiaTargetFramerate: 0
vulkanNumSwapchainBuffers: 3
vulkanEnableSetSRGBWrite: 0
vulkanEnablePreTransform: 0
vulkanEnableLateAcquireNextImage: 0
m_SupportedAspectRatios:
4:3: 1
5:4: 1
16:10: 1
16:9: 1
Others: 1
bundleVersion: 0.1
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1
xboxOneDisableKinectGpuReservation: 1
xboxOneEnable7thCore: 1
vrSettings:
enable360StereoCapture: 0
isWsaHolographicRemotingEnabled: 0
enableFrameTimingStats: 0
useHDRDisplay: 0
D3DHDRBitDepth: 0
m_ColorGamuts: 00000000
targetPixelDensity: 30
resolutionScalingMode: 0
androidSupportedAspectRatio: 1
androidMaxAspectRatio: 2.1
applicationIdentifier:
Standalone: com.UnityRobotics.PickAndPlace
buildNumber:
Standalone: 0
iPhone: 0
tvOS: 0
overrideDefaultApplicationIdentifier: 0
AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 19
AndroidTargetSdkVersion: 0
AndroidPreferredInstallLocation: 1
aotOptions:
stripEngineCode: 1
iPhoneStrippingLevel: 0
iPhoneScriptCallOptimization: 0
ForceInternetPermission: 0
ForceSDCardPermission: 0
CreateWallpaper: 0
APKExpansionFiles: 0
keepLoadedShadersAlive: 0
StripUnusedMeshComponents: 1
VertexChannelCompressionMask: 4054
iPhoneSdkVersion: 988
iOSTargetOSVersionString: 11.0
tvOSSdkVersion: 0
tvOSRequireExtendedGameController: 0
tvOSTargetOSVersionString: 11.0
uIPrerenderedIcon: 0
uIRequiresPersistentWiFi: 0
uIRequiresFullScreen: 1
uIStatusBarHidden: 1
uIExitOnSuspend: 0
uIStatusBarStyle: 0
appleTVSplashScreen: {fileID: 0}
appleTVSplashScreen2x: {fileID: 0}
tvOSSmallIconLayers: []
tvOSSmallIconLayers2x: []
tvOSLargeIconLayers: []
tvOSLargeIconLayers2x: []
tvOSTopShelfImageLayers: []
tvOSTopShelfImageLayers2x: []
tvOSTopShelfImageWideLayers: []
tvOSTopShelfImageWideLayers2x: []
iOSLaunchScreenType: 0
iOSLaunchScreenPortrait: {fileID: 0}
iOSLaunchScreenLandscape: {fileID: 0}
iOSLaunchScreenBackgroundColor:
serializedVersion: 2
rgba: 0
iOSLaunchScreenFillPct: 100
iOSLaunchScreenSize: 100
iOSLaunchScreenCustomXibPath:
iOSLaunchScreeniPadType: 0
iOSLaunchScreeniPadImage: {fileID: 0}
iOSLaunchScreeniPadBackgroundColor:
serializedVersion: 2
rgba: 0
iOSLaunchScreeniPadFillPct: 100
iOSLaunchScreeniPadSize: 100
iOSLaunchScreeniPadCustomXibPath:
iOSLaunchScreenCustomStoryboardPath:
iOSLaunchScreeniPadCustomStoryboardPath:
iOSDeviceRequirements: []
iOSURLSchemes: []
iOSBackgroundModes: 0
iOSMetalForceHardShadows: 0
metalEditorSupport: 1
metalAPIValidation: 1
iOSRenderExtraFrameOnPause: 0
iosCopyPluginsCodeInsteadOfSymlink: 0
appleDeveloperTeamID:
iOSManualSigningProvisioningProfileID:
tvOSManualSigningProvisioningProfileID:
iOSManualSigningProvisioningProfileType: 0
tvOSManualSigningProvisioningProfileType: 0
appleEnableAutomaticSigning: 0
iOSRequireARKit: 0
iOSAutomaticallyDetectAndAddCapabilities: 1
appleEnableProMotion: 0
shaderPrecisionModel: 0
clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea
templatePackageId: com.unity.template.3d@5.0.4
templateDefaultScene: Assets/Scenes/SampleScene.unity
useCustomMainManifest: 0
useCustomLauncherManifest: 0
useCustomMainGradleTemplate: 0
useCustomLauncherGradleManifest: 0
useCustomBaseGradleTemplate: 0
useCustomGradlePropertiesTemplate: 0
useCustomProguardFile: 0
AndroidTargetArchitectures: 1
AndroidSplashScreenScale: 0
androidSplashScreen: {fileID: 0}
AndroidKeystoreName:
AndroidKeyaliasName:
AndroidBuildApkPerCpuArchitecture: 0
AndroidTVCompatibility: 0
AndroidIsGame: 1
AndroidEnableTango: 0
androidEnableBanner: 1
androidUseLowAccuracyLocation: 0
androidUseCustomKeystore: 0
m_AndroidBanners:
- width: 320
height: 180
banner: {fileID: 0}
androidGamepadSupportLevel: 0
AndroidMinifyWithR8: 0
AndroidMinifyRelease: 0
AndroidMinifyDebug: 0
AndroidValidateAppBundleSize: 1
AndroidAppBundleSizeToValidate: 150
m_BuildTargetIcons: []
m_BuildTargetPlatformIcons: []
m_BuildTargetBatching:
- m_BuildTarget: Standalone
m_StaticBatching: 1
m_DynamicBatching: 0
- m_BuildTarget: tvOS
m_StaticBatching: 1
m_DynamicBatching: 0
- m_BuildTarget: Android
m_StaticBatching: 1
m_DynamicBatching: 0
- m_BuildTarget: iPhone
m_StaticBatching: 1
m_DynamicBatching: 0
- m_BuildTarget: WebGL
m_StaticBatching: 0
m_DynamicBatching: 0
m_BuildTargetGraphicsJobs:
- m_BuildTarget: MacStandaloneSupport
m_GraphicsJobs: 0
- m_BuildTarget: Switch
m_GraphicsJobs: 1
- m_BuildTarget: MetroSupport
m_GraphicsJobs: 1
- m_BuildTarget: AppleTVSupport
m_GraphicsJobs: 0
- m_BuildTarget: BJMSupport
m_GraphicsJobs: 1
- m_BuildTarget: LinuxStandaloneSupport
m_GraphicsJobs: 1
- m_BuildTarget: PS4Player
m_GraphicsJobs: 1
- m_BuildTarget: iOSSupport
m_GraphicsJobs: 0
- m_BuildTarget: WindowsStandaloneSupport
m_GraphicsJobs: 1
- m_BuildTarget: XboxOnePlayer
m_GraphicsJobs: 1
- m_BuildTarget: LuminSupport
m_GraphicsJobs: 0
- m_BuildTarget: AndroidPlayer
m_GraphicsJobs: 0
- m_BuildTarget: WebGLSupport
m_GraphicsJobs: 0
m_BuildTargetGraphicsJobMode:
- m_BuildTarget: PS4Player
m_GraphicsJobMode: 0
- m_BuildTarget: XboxOnePlayer
m_GraphicsJobMode: 0
m_BuildTargetGraphicsAPIs:
- m_BuildTarget: AndroidPlayer
m_APIs: 150000000b000000
m_Automatic: 0
- m_BuildTarget: iOSSupport
m_APIs: 10000000
m_Automatic: 1
- m_BuildTarget: AppleTVSupport
m_APIs: 10000000
m_Automatic: 1
- m_BuildTarget: WebGLSupport
m_APIs: 0b000000
m_Automatic: 1
m_BuildTargetVRSettings:
- m_BuildTarget: Standalone
m_Enabled: 0
m_Devices:
- Oculus
- OpenVR
openGLRequireES31: 0
openGLRequireES31AEP: 0
openGLRequireES32: 0
m_TemplateCustomTags: {}
mobileMTRendering:
Android: 1
iPhone: 1
tvOS: 1
m_BuildTargetGroupLightmapEncodingQuality: []
m_BuildTargetGroupLightmapSettings: []
m_BuildTargetNormalMapEncoding: []
playModeTestRunnerEnabled: 0
runPlayModeTestAsEditModeTest: 0
actionOnDotNetUnhandledException: 1
enableInternalProfiler: 0
logObjCUncaughtExceptions: 1
enableCrashReportAPI: 0
cameraUsageDescription:
locationUsageDescription:
microphoneUsageDescription:
switchNMETAOverride:
switchNetLibKey:
switchSocketMemoryPoolSize: 6144
switchSocketAllocatorPoolSize: 128
switchSocketConcurrencyLimit: 14
switchScreenResolutionBehavior: 2
switchUseCPUProfiler: 0
switchUseGOLDLinker: 0
switchApplicationID: 0x01004b9000490000
switchNSODependencies:
switchTitleNames_0:
switchTitleNames_1:
switchTitleNames_2:
switchTitleNames_3:
switchTitleNames_4:
switchTitleNames_5:
switchTitleNames_6:
switchTitleNames_7:
switchTitleNames_8:
switchTitleNames_9:
switchTitleNames_10:
switchTitleNames_11:
switchTitleNames_12:
switchTitleNames_13:
switchTitleNames_14:
switchPublisherNames_0:
switchPublisherNames_1:
switchPublisherNames_2:
switchPublisherNames_3:
switchPublisherNames_4:
switchPublisherNames_5:
switchPublisherNames_6:
switchPublisherNames_7:
switchPublisherNames_8:
switchPublisherNames_9:
switchPublisherNames_10:
switchPublisherNames_11:
switchPublisherNames_12:
switchPublisherNames_13:
switchPublisherNames_14:
switchIcons_0: {fileID: 0}
switchIcons_1: {fileID: 0}
switchIcons_2: {fileID: 0}
switchIcons_3: {fileID: 0}
switchIcons_4: {fileID: 0}
switchIcons_5: {fileID: 0}
switchIcons_6: {fileID: 0}
switchIcons_7: {fileID: 0}
switchIcons_8: {fileID: 0}
switchIcons_9: {fileID: 0}
switchIcons_10: {fileID: 0}
switchIcons_11: {fileID: 0}
switchIcons_12: {fileID: 0}
switchIcons_13: {fileID: 0}
switchIcons_14: {fileID: 0}
switchSmallIcons_0: {fileID: 0}
switchSmallIcons_1: {fileID: 0}
switchSmallIcons_2: {fileID: 0}
switchSmallIcons_3: {fileID: 0}
switchSmallIcons_4: {fileID: 0}
switchSmallIcons_5: {fileID: 0}
switchSmallIcons_6: {fileID: 0}
switchSmallIcons_7: {fileID: 0}
switchSmallIcons_8: {fileID: 0}
switchSmallIcons_9: {fileID: 0}
switchSmallIcons_10: {fileID: 0}
switchSmallIcons_11: {fileID: 0}
switchSmallIcons_12: {fileID: 0}
switchSmallIcons_13: {fileID: 0}
switchSmallIcons_14: {fileID: 0}
switchManualHTML:
switchAccessibleURLs:
switchLegalInformation:
switchMainThreadStackSize: 1048576
switchPresenceGroupId:
switchLogoHandling: 0
switchReleaseVersion: 0
switchDisplayVersion: 1.0.0
switchStartupUserAccount: 0
switchTouchScreenUsage: 0
switchSupportedLanguagesMask: 0
switchLogoType: 0
switchApplicationErrorCodeCategory:
switchUserAccountSaveDataSize: 0
switchUserAccountSaveDataJournalSize: 0
switchApplicationAttribute: 0
switchCardSpecSize: -1
switchCardSpecClock: -1
switchRatingsMask: 0
switchRatingsInt_0: 0
switchRatingsInt_1: 0
switchRatingsInt_2: 0
switchRatingsInt_3: 0
switchRatingsInt_4: 0
switchRatingsInt_5: 0
switchRatingsInt_6: 0
switchRatingsInt_7: 0
switchRatingsInt_8: 0
switchRatingsInt_9: 0
switchRatingsInt_10: 0
switchRatingsInt_11: 0
switchRatingsInt_12: 0
switchLocalCommunicationIds_0:
switchLocalCommunicationIds_1:
switchLocalCommunicationIds_2:
switchLocalCommunicationIds_3:
switchLocalCommunicationIds_4:
switchLocalCommunicationIds_5:
switchLocalCommunicationIds_6:
switchLocalCommunicationIds_7:
switchParentalControl: 0
switchAllowsScreenshot: 1
switchAllowsVideoCapturing: 1
switchAllowsRuntimeAddOnContentInstall: 0
switchDataLossConfirmation: 0
switchUserAccountLockEnabled: 0
switchSystemResourceMemory: 16777216
switchSupportedNpadStyles: 22
switchNativeFsCacheSize: 32
switchIsHoldTypeHorizontal: 0
switchSupportedNpadCount: 8
switchSocketConfigEnabled: 0
switchTcpInitialSendBufferSize: 32
switchTcpInitialReceiveBufferSize: 64
switchTcpAutoSendBufferSizeMax: 256
switchTcpAutoReceiveBufferSizeMax: 256
switchUdpSendBufferSize: 9
switchUdpReceiveBufferSize: 42
switchSocketBufferEfficiency: 4
switchSocketInitializeEnabled: 1
switchNetworkInterfaceManagerInitializeEnabled: 1
switchPlayerConnectionEnabled: 1
switchUseNewStyleFilepaths: 0
ps4NPAgeRating: 12
ps4NPTitleSecret:
ps4NPTrophyPackPath:
ps4ParentalLevel: 11
ps4ContentID: ED1633-NPXX51362_00-0000000000000000
ps4Category: 0
ps4MasterVersion: 01.00
ps4AppVersion: 01.00
ps4AppType: 0
ps4ParamSfxPath:
ps4VideoOutPixelFormat: 0
ps4VideoOutInitialWidth: 1920
ps4VideoOutBaseModeInitialWidth: 1920
ps4VideoOutReprojectionRate: 60
ps4PronunciationXMLPath:
ps4PronunciationSIGPath:
ps4BackgroundImagePath:
ps4StartupImagePath:
ps4StartupImagesFolder:
ps4IconImagesFolder:
ps4SaveDataImagePath:
ps4SdkOverride:
ps4BGMPath:
ps4ShareFilePath:
ps4ShareOverlayImagePath:
ps4PrivacyGuardImagePath:
ps4ExtraSceSysFile:
ps4NPtitleDatPath:
ps4RemotePlayKeyAssignment: -1
ps4RemotePlayKeyMappingDir:
ps4PlayTogetherPlayerCount: 0
ps4EnterButtonAssignment: 1
ps4ApplicationParam1: 0
ps4ApplicationParam2: 0
ps4ApplicationParam3: 0
ps4ApplicationParam4: 0
ps4DownloadDataSize: 0
ps4GarlicHeapSize: 2048
ps4ProGarlicHeapSize: 2560
playerPrefsMaxSize: 32768
ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ
ps4pnSessions: 1
ps4pnPresence: 1
ps4pnFriends: 1
ps4pnGameCustomData: 1
playerPrefsSupport: 0
enableApplicationExit: 0
resetTempFolder: 1
restrictedAudioUsageRights: 0
ps4UseResolutionFallback: 0
ps4ReprojectionSupport: 0
ps4UseAudio3dBackend: 0
ps4UseLowGarlicFragmentationMode: 1
ps4SocialScreenEnabled: 0
ps4ScriptOptimizationLevel: 0
ps4Audio3dVirtualSpeakerCount: 14
ps4attribCpuUsage: 0
ps4PatchPkgPath:
ps4PatchLatestPkgPath:
ps4PatchChangeinfoPath:
ps4PatchDayOne: 0
ps4attribUserManagement: 0
ps4attribMoveSupport: 0
ps4attrib3DSupport: 0
ps4attribShareSupport: 0
ps4attribExclusiveVR: 0
ps4disableAutoHideSplash: 0
ps4videoRecordingFeaturesUsed: 0
ps4contentSearchFeaturesUsed: 0
ps4CompatibilityPS5: 0
ps4GPU800MHz: 1
ps4attribEyeToEyeDistanceSettingVR: 0
ps4IncludedModules: []
ps4attribVROutputEnabled: 0
monoEnv:
splashScreenBackgroundSourceLandscape: {fileID: 0}
splashScreenBackgroundSourcePortrait: {fileID: 0}
blurSplashScreenBackground: 1
spritePackerPolicy:
webGLMemorySize: 16
webGLExceptionSupport: 1
webGLNameFilesAsHashes: 0
webGLDataCaching: 1
webGLDebugSymbols: 0
webGLEmscriptenArgs:
webGLModulesDirectory:
webGLTemplate: APPLICATION:Default
webGLAnalyzeBuildSize: 0
webGLUseEmbeddedResources: 0
webGLCompressionFormat: 1
webGLWasmArithmeticExceptions: 0
webGLLinkerTarget: 1
webGLThreadsSupport: 0
webGLDecompressionFallback: 0
scriptingDefineSymbols:
1: INTEGRATION_TEST
additionalCompilerArguments:
1: []
platformArchitecture: {}
scriptingBackend: {}
il2cppCompilerConfiguration: {}
managedStrippingLevel: {}
incrementalIl2cppBuild: {}
suppressCommonWarnings: 1
allowUnsafeCode: 0
useDeterministicCompilation: 1
useReferenceAssemblies: 1
enableRoslynAnalyzers: 1
additionalIl2CppArgs:
scriptingRuntimeVersion: 1
gcIncremental: 1
gcWBarrierValidation: 0
apiCompatibilityLevelPerPlatform:
Standalone: 3
m_RenderingPath: 1
m_MobileRenderingPath: 1
metroPackageName: Template_3D
metroPackageVersion:
metroCertificatePath:
metroCertificatePassword:
metroCertificateSubject:
metroCertificateIssuer:
metroCertificateNotAfter: 0000000000000000
metroApplicationDescription: Template_3D
wsaImages: {}
metroTileShortName:
metroTileShowName: 0
metroMediumTileShowName: 0
metroLargeTileShowName: 0
metroWideTileShowName: 0
metroSupportStreamingInstall: 0
metroLastRequiredScene: 0
metroDefaultTileSize: 1
metroTileForegroundText: 2
metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0}
metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1}
metroSplashScreenUseBackgroundColor: 0
platformCapabilities: {}
metroTargetDeviceFamilies: {}
metroFTAName:
metroFTAFileTypes: []
metroProtocolName:
XboxOneProductId:
XboxOneUpdateKey:
XboxOneSandboxId:
XboxOneContentId:
XboxOneTitleId:
XboxOneSCId:
XboxOneGameOsOverridePath:
XboxOnePackagingOverridePath:
XboxOneAppManifestOverridePath:
XboxOneVersion: 1.0.0.0
XboxOnePackageEncryption: 0
XboxOnePackageUpdateGranularity: 2
XboxOneDescription:
XboxOneLanguage:
- enus
XboxOneCapability: []
XboxOneGameRating: {}
XboxOneIsContentPackage: 0
XboxOneEnableGPUVariability: 1
XboxOneSockets: {}
XboxOneSplashScreen: {fileID: 0}
XboxOneAllowedProductIds: []
XboxOnePersistentLocalStorageSize: 0
XboxOneXTitleMemory: 8
XboxOneOverrideIdentityName:
XboxOneOverrideIdentityPublisher:
vrEditorSettings: {}
cloudServicesEnabled:
UNet: 1
luminIcon:
m_Name:
m_ModelFolderPath:
m_PortalFolderPath:
luminCert:
m_CertPath:
m_SignPackage: 1
luminIsChannelApp: 0
luminVersion:
m_VersionCode: 1
m_VersionName:
apiCompatibilityLevel: 6
activeInputHandler: 0
cloudProjectId:
framebufferDepthMemorylessMode: 0
qualitySettingsNames: []
projectName:
organizationId:
cloudEnabled: 0
legacyClampBlendShapeWeights: 0
virtualTexturingSupportEnabled: 0

66
.yamato/PickAndPlaceTests/set-up-integration-tests.py


import os
import shutil
import glob
from collections import OrderedDict
from unityparser import UnityDocument
# NOTE: This must match the flag defined in the Unity Integration Tests
_INTEGRATION_TEST_DEFINE = "INTEGRATION_TEST"
# This script is executed inside of a bokken image in order to automate the manual steps a user would
# perform when going through the tutorials. This allows us to perform integration tests on the expected final
# state of a tutorial project.
script_dir = os.path.dirname(os.path.realpath(__file__))
root_dir = os.path.join(script_dir, "..", "..", "tutorials", "pick_and_place")
external_scripts_dir = os.path.join(root_dir, "Scripts")
project_dir = os.path.join(root_dir, "PickAndPlaceProject")
project_scripts_dir = os.path.join(project_dir, "Assets", "Scripts")
# project_settings_file = os.path.join(project_dir, "ProjectSettings", "ProjectSettings.asset")
scripts_to_move = glob.glob(os.path.join(external_scripts_dir, "*.cs"))
for external_script in scripts_to_move:
script_name = os.path.basename(external_script)
script_destination = os.path.join(project_scripts_dir, script_name)
print(f">>> Copying {external_script} to {script_destination}")
shutil.copyfile(external_script, script_destination)
files_to_cat = []
message_dir = os.path.join(project_dir, "Assets", "RosMessages")
print(f">>> Files in {message_dir}:")
for root, _, files in os.walk(message_dir):
level = root.replace(message_dir, '').count(os.sep)
indent = ' ' * 4 * level
print('{}{}/'.format(indent, os.path.basename(root)))
subindent = ' ' * 4 * (level + 1)
for f in files:
print('{}{}'.format(subindent, f))
if f.endswith(".cs") or f.endswith(".asmdef"):
files_to_cat.append(os.path.join(root, f))
# On Yamato, Unity fails to recompile the message directory under mysterious circumstances, so moving it into
# the Scripts directory to attempt to force a recompile
print(f"Moving {message_dir} to {project_scripts_dir}")
shutil.move(message_dir, project_scripts_dir)
# for f in files_to_cat:
# print(f">>> {f}:")
# os.system(f"cat {f}")
# print("\n")
# We must keep a backup copy of the ProjectSettings.asset because UTR will serialize the one in the project as a binary
# file, making it impossible to load as a yaml file here
test_settings = os.path.join(".", ".yamato", "PickAndPlaceTests", "IntegrationTestSettings.asset")
project_settings_relative = os.path.join(".", "tutorials", "pick_and_place", "PickAndPlaceProject", "ProjectSettings", "ProjectSettings.asset")
shutil.copyfile(test_settings, project_settings_relative)
# TODO: We have to use the above, bad solution, for now, because the below solution won't work until
# UTR stops re-serializing the settings
# project_settings_asset = UnityDocument.load_yaml(project_settings_file)
# scripting_defines = project_settings_asset.entry.scriptingDefineSymbols # type: OrderedDict
# if scripting_defines[1]:
# scripting_defines[1] += f";{_INTEGRATION_TEST_DEFINE}"
# else:
# scripting_defines[1] = _INTEGRATION_TEST_DEFINE
# project_settings_asset.dump_yaml()

11
.yamato/PickAndPlaceTests/start-ros.bash


source /opt/ros/noetic/setup.bash
set -e
# Assuming this script is invoked from the root of the repository...
DIR_ORIGINAL=$PWD
cd tutorials/pick_and_place/ROS
catkin_make
source devel/setup.bash
cd "$DIR_ORIGINAL"
roslaunch niryo_moveit part_3.launch &

16
tutorials/pick_and_place/PickAndPlaceProject/Assets/RosMessages/Unity.Robotics.RosMessages.asmdef


{
"name": "Unity.Robotics.RosMessages",
"rootNamespace": "",
"references": [
"GUID:625bfc588fb96c74696858f2c467e978"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": true
}

7
tutorials/pick_and_place/PickAndPlaceProject/Assets/RosMessages/Unity.Robotics.RosMessages.asmdef.meta


fileFormatVersion: 2
guid: 204b12c73a0ba074c888ec09a2713605
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

185
tutorials/pick_and_place/PickAndPlaceProject/Assets/Scripts/TargetPlacement.cs


using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Unity.Robotics.PickAndPlace
{
[RequireComponent(typeof(MeshRenderer))]
[RequireComponent(typeof(BoxCollider))]
public class TargetPlacement : MonoBehaviour
{
const string k_NameExpectedTarget = "Target";
static readonly int k_ShaderColorId = Shader.PropertyToID("_Color");
// The threshold that the Target's speed must be under to be considered "placed" in the target area
const float k_MaximumSpeedForStopped = 0.01f;
[SerializeField]
[Tooltip("Target object expected by this placement area. Can be left blank if only one Target in scene")]
GameObject m_Target;
[SerializeField]
[Range(0, 255)]
[Tooltip("Alpha value for any color set during state changes.")]
int m_ColorAlpha = 100;
MeshRenderer m_TargetMeshRenderer;
float m_ColorAlpha01 => m_ColorAlpha / 255f;
MeshRenderer m_MeshRenderer;
BoxCollider m_BoxCollider;
PlacementState m_CurrentState;
PlacementState m_LastColoredState;
public PlacementState CurrentState
{
get => m_CurrentState;
private set
{
m_CurrentState = value;
UpdateStateColor();
}
}
public enum PlacementState
{
Outside,
InsideFloating,
InsidePlaced
}
// Start is called before the first frame update
void Start()
{
// Check for mis-configurations and disable if something has changed without this script being updated
// These are warnings because this script does not contain critical functionality
if (m_Target == null)
{
m_Target = GameObject.Find(k_NameExpectedTarget);
}
if (m_Target == null)
{
Debug.LogWarning($"{nameof(TargetPlacement)} expects to find a GameObject named " +
$"{k_NameExpectedTarget} to track, but did not. Can't track placement state.");
enabled = false;
return;
}
if (!TrySetComponentReferences())
{
enabled = false;
return;
}
InitializeState();
}
bool TrySetComponentReferences()
{
m_TargetMeshRenderer = m_Target.GetComponent<MeshRenderer>();
if (m_TargetMeshRenderer == null)
{
Debug.LogWarning($"{nameof(TargetPlacement)} expects a {nameof(MeshRenderer)} to be attached " +
$"to {k_NameExpectedTarget}. Cannot check bounds without it, so cannot track placement state.");
return false;
}
// Assume these are here because they are RequiredComponent components
m_MeshRenderer = GetComponent<MeshRenderer>();
m_BoxCollider = GetComponent<BoxCollider>();
return true;
}
void OnValidate()
{
// Useful for visualizing state in editor, but doesn't wholly guarantee accurate coloring in EditMode
// Enter PlayMode to see color update correctly
if (m_Target != null)
{
if (TrySetComponentReferences())
{
InitializeState();
}
}
}
void InitializeState()
{
if (m_Target.GetComponent<BoxCollider>().bounds.Intersects(m_BoxCollider.bounds))
{
CurrentState = IsTargetStoppedInsideBounds() ?
PlacementState.InsidePlaced : PlacementState.InsideFloating;
}
else
{
CurrentState = PlacementState.Outside;
}
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.name == m_Target.name)
{
CurrentState = PlacementState.InsideFloating;
}
}
void OnTriggerExit(Collider other)
{
if (other.gameObject.name == m_Target.name)
{
CurrentState = PlacementState.Outside;
}
}
bool IsTargetStoppedInsideBounds()
{
var targetIsStopped = m_Target.GetComponent<Rigidbody>().velocity.magnitude < k_MaximumSpeedForStopped;
var targetIsInBounds = m_BoxCollider.bounds.Contains(m_TargetMeshRenderer.bounds.center);
return targetIsStopped && targetIsInBounds;
}
// Update is called once per frame
void Update()
{
if (CurrentState != PlacementState.Outside)
{
CurrentState = IsTargetStoppedInsideBounds() ?
PlacementState.InsidePlaced : PlacementState.InsideFloating;
}
}
void UpdateStateColor()
{
if (m_CurrentState == m_LastColoredState)
{
return;
}
var mpb = new MaterialPropertyBlock();
Color stateColor;
switch (m_CurrentState)
{
case PlacementState.Outside:
stateColor = Color.red;
break;
case PlacementState.InsideFloating:
stateColor = Color.yellow;
break;
case PlacementState.InsidePlaced:
stateColor = Color.green;
break;
default:
Debug.LogError($"No state handling implemented for {m_CurrentState}");
stateColor = Color.magenta;
break;
}
stateColor.a = m_ColorAlpha01;
mpb.SetColor(k_ShaderColorId, stateColor);
m_MeshRenderer.SetPropertyBlock(mpb);
m_LastColoredState = m_CurrentState;
}
}
}

11
tutorials/pick_and_place/PickAndPlaceProject/Assets/Scripts/TargetPlacement.cs.meta


fileFormatVersion: 2
guid: f7ac960dc884b4042a0de8920854c9e5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

17
tutorials/pick_and_place/PickAndPlaceProject/Assets/Scripts/Unity.Robotics.PickAndPlace.asmdef


{
"name": "Unity.Robotics.PickAndPlace",
"rootNamespace": "",
"references": [
"GUID:204b12c73a0ba074c888ec09a2713605",
"GUID:625bfc588fb96c74696858f2c467e978"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

7
tutorials/pick_and_place/PickAndPlaceProject/Assets/Scripts/Unity.Robotics.PickAndPlace.asmdef.meta


fileFormatVersion: 2
guid: 79169c04a5f9b014e919b69ac8df4286
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

874
tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/PlayMode/PlayModeTestScenes/TargetPlacementTest.unity


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &249878388
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalPosition.x
value: -0.098
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalPosition.y
value: 0.643
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalPosition.z
value: 0.3215
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591414, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_Name
value: TargetPlacementPlaced
objectReference: {fileID: 0}
- target: {fileID: 7978903071639371792, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_Target
value:
objectReference: {fileID: 587740271}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
--- !u!1001 &444527226
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalPosition.x
value: -0.098
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalPosition.y
value: 0.643
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalPosition.z
value: -0.07790001
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591414, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_Name
value: TargetPlacementOutside
objectReference: {fileID: 0}
- target: {fileID: 7978903071639371792, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_Target
value:
objectReference: {fileID: 1731673593}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
--- !u!1001 &587740270
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4064412142990923027, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_UseGravity
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_RootOrder
value: 5
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalPosition.x
value: -0.09569999
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalPosition.y
value: 0.6501
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalPosition.z
value: 0.3185
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5601983281253769233, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_Name
value: TargetPlaced
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
--- !u!1 &587740271 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 5601983281253769233, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
m_PrefabInstance: {fileID: 587740270}
m_PrefabAsset: {fileID: 0}
--- !u!1 &721719780 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 5601983281253769233, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
m_PrefabInstance: {fileID: 1722777672}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1044694655
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_RootOrder
value: 10
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalPosition.x
value: -0.2789
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalPosition.y
value: 0.643
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalPosition.z
value: 0.119
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591414, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_Name
value: TargetPlacementStateChange
objectReference: {fileID: 0}
- target: {fileID: 4980278694990496136, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_Center.y
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 7978903071639371792, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_Target
value:
objectReference: {fileID: 721719780}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
--- !u!1001 &1080763006
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4064412142990923027, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_UseGravity
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_RootOrder
value: 7
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalPosition.x
value: -0.106999986
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalPosition.y
value: 0.65760005
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalPosition.z
value: 0.1506
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5601983281253769233, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_Name
value: TargetFloating
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
--- !u!1 &1080763007 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 5601983281253769233, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
m_PrefabInstance: {fileID: 1080763006}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1616270945
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1616270948}
- component: {fileID: 1616270947}
- component: {fileID: 1616270946}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1616270946
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1616270945}
m_Enabled: 1
--- !u!20 &1616270947
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1616270945}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1616270948
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1616270945}
m_LocalRotation: {x: -0.33147213, y: 0.66312367, z: -0.24441679, w: -0.6250229}
m_LocalPosition: {x: 0.473, y: 1.086, z: 0.100999914}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 47.605, y: 261.538, z: -11.471}
--- !u!1001 &1722777672
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4064412142990923027, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_UseGravity
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_RootOrder
value: 9
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalPosition.x
value: -0.2787
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalPosition.y
value: 0.68
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalPosition.z
value: 0.1215
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5601983281253769233, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_Name
value: TargetFalling
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
--- !u!1001 &1731673592
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4064412142990923027, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_UseGravity
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalPosition.x
value: -0.12299999
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalPosition.y
value: 0.68200004
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalPosition.z
value: -0.055899993
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5113255398182140587, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5601983281253769233, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
propertyPath: m_Name
value: TargetOutside
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
--- !u!1 &1731673593 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 5601983281253769233, guid: 3901759e6233748538fffdbc519c1a68, type: 3}
m_PrefabInstance: {fileID: 1731673592}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1970267000
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalPosition.x
value: -0.098
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalPosition.y
value: 0.643
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalPosition.z
value: 0.119
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591411, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 850690186460591414, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_Name
value: TargetPlacementFloating
objectReference: {fileID: 0}
- target: {fileID: 4980278694990496136, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_Center.y
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 7978903071639371792, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
propertyPath: m_Target
value:
objectReference: {fileID: 1080763007}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 43bef545df3e344c4a7e089ca90c15a0, type: 3}
--- !u!1 &2033834534
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2033834536}
- component: {fileID: 2033834535}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &2033834535
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2033834534}
m_Enabled: 1
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &2033834536
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2033834534}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1001 &2134712309
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 2781043625631727712, guid: 85db2308098d34a79837fb7356902f62, type: 3}
propertyPath: m_RootOrder
value: 8
objectReference: {fileID: 0}
- target: {fileID: 2781043625631727712, guid: 85db2308098d34a79837fb7356902f62, type: 3}
propertyPath: m_LocalPosition.x
value: -0.10367495
objectReference: {fileID: 0}
- target: {fileID: 2781043625631727712, guid: 85db2308098d34a79837fb7356902f62, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2781043625631727712, guid: 85db2308098d34a79837fb7356902f62, type: 3}
propertyPath: m_LocalPosition.z
value: 0.121130586
objectReference: {fileID: 0}
- target: {fileID: 2781043625631727712, guid: 85db2308098d34a79837fb7356902f62, type: 3}
propertyPath: m_LocalRotation.w
value: 0.7025373
objectReference: {fileID: 0}
- target: {fileID: 2781043625631727712, guid: 85db2308098d34a79837fb7356902f62, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2781043625631727712, guid: 85db2308098d34a79837fb7356902f62, type: 3}
propertyPath: m_LocalRotation.y
value: -0.711647
objectReference: {fileID: 0}
- target: {fileID: 2781043625631727712, guid: 85db2308098d34a79837fb7356902f62, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2781043625631727712, guid: 85db2308098d34a79837fb7356902f62, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2781043625631727712, guid: 85db2308098d34a79837fb7356902f62, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: -90.738
objectReference: {fileID: 0}
- target: {fileID: 2781043625631727712, guid: 85db2308098d34a79837fb7356902f62, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3302142234816977626, guid: 85db2308098d34a79837fb7356902f62, type: 3}
propertyPath: m_Name
value: Table
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 85db2308098d34a79837fb7356902f62, type: 3}

7
tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/PlayMode/PlayModeTestScenes/TargetPlacementTest.unity.meta


fileFormatVersion: 2
guid: 3d328f38f71b71e47bb8d96869012ffe
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

25
tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/PlayMode/ExamplePlayModeTests.cs


using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
public class ExamplePlayModeTests
{
// A Test behaves as an ordinary method
[Test]
public void ExamplePlayModeTestsSimplePasses()
{
// Use the Assert class to test conditions
}
// A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use
// `yield return null;` to skip a frame.
[UnityTest]
public IEnumerator ExamplePlayModeTestsWithEnumeratorPasses()
{
// Use the Assert class to test conditions.
// Use yield to skip a frame.
yield return null;
}
}

/tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/PlayMode/ExamplePlayModeTests.cs.meta → /tutorials/pick_and_place/PickAndPlaceProject/Assets/Tests/PlayMode/TargetPlacementTests.cs.meta

正在加载...
取消
保存