Search Unity

How to use Perception simulation in Unity

Discussion in 'VR' started by SwathiJayaraman, Sep 19, 2017.

  1. SwathiJayaraman

    SwathiJayaraman

    Joined:
    May 26, 2017
    Posts:
    2
    Hi,

    I have Unity 2017.1.0f3 version. I managed to import the "PerceptionSimulation" dll's into my unity project.
    I have created a TestRunner->Editmode test and wrote the following:

    Task.Run(async () =>
    {
    System.Uri a = new System.Uri("http://169.254.48.38/");
    try
    {
    //Thread.Sleep(5000);
    System.Console.WriteLine("inside try");

    RestSimulationStreamSink sink = await RestSimulationStreamSink.Create(
    // use the IP address for your device/emulator
    a,
    // no credentials are needed for the emulator
    new System.Net.NetworkCredential("", ""),
    // normal priorty
    true
    // cancel token
    );
    System.Console.WriteLine("simulaiton manager object created");
    IPerceptionSimulationManager manager = PerceptionSimulationManager.CreatePerceptionSimulationManager(sink);


    But, the sink object is not getting initialised. The second print state is not printed. Only System.Console.WriteLine("inside try"); is printed.

    How do I proceed with this?

    Thanks!
     
  2. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    558
    I'm unsure of why you are trying to do this through script since simulation is built into the editor. Are you trying to do remoting?