Implemented Academy / Set GoalPoint / Bug: Training does not move agents

This commit is contained in:
Tobi
2019-05-17 19:12:07 +02:00
parent a7dd5527bb
commit e3482a3eab
11 changed files with 7302 additions and 19 deletions
@@ -134,10 +134,12 @@ public class ImageProcessor : MonoBehaviour
Moments m = new Moments(processedImage, true);
CenterOfGravity = new Point(m.M10 / m.M00, m.M01 / m.M00);
#if UNITY_EDITOR
// show the image with a point mark at the centroid
Cv2.Circle(processedImage, CenterOfGravity, 5, new Scalar(128, 0, 0), -1);
Cv2.Flip(processedImage, processedImage, FlipMode.X);
Cv2.ImShow("Image with center", processedImage);
//Cv2.WaitKey(0);
#endif
}
}
+17 -1
View File
@@ -5,5 +5,21 @@ using UnityEngine;
public class CozmoAcademy : Academy
{
public GameObject cozmo;
public Transform startPoint;
//public bool testAcademyReset = false;
public override void AcademyReset()
{
cozmo.transform.position = startPoint.position;
}
//private void Update()
//{
// if (testAcademyReset)
// {
// AcademyReset();
// testAcademyReset = !testAcademyReset;
// }
//}
}
+9
View File
@@ -112,6 +112,15 @@ public class CozmoAgent : Agent
}
private void OnTriggerEnter(Collider other)
{
if (other.transform.CompareTag("Goal"))
{
print("Collission");
Done();
}
}
private void WaitTimeInference()
{
if (renderCamera != null)