Type or Namespace missing 'TcpClient' and 'NetworkStream'

Discussion in 'MuJoCo Pro + Unity Integration' started by Arunava Nag, Apr 13, 2018.

  1. Hi,
    I am trying to develop an app using UR5 robot model. I wrote a mjcf for UR5. I added the plugin and script as told in the unity mujoco integration page and imported the model. My targeted device is Hololens.

    Unity version is latest 2017.4.0f1,

    The error thrown during build:

    Assets\Scripts\MJRemote.cs(81,5): error CS0246: The type or namespace name 'TcpListener' could not be found (are you missing a using directive or an assembly reference?)​

    Assets\Scripts\MJRemote.cs(83,5): error CS0246: The type or namespace name 'NetworkStream' could not be found (are you missing a using directive or an assembly reference?)


    upload_2018-4-13_22-49-34.png
    Please help.
     
  2. that's cool post admin keep it up :)
     
  3. Emo Todorov

    Emo Todorov Administrator Staff Member

    This appears to be an issue with Unity/C# that is not specific to MuJoCo. TcpListener and NetworkStream should be provided by the C# environment. Perhaps something about the HoloLens environment is different?

    To isolate the issue, you could look at the C# code provided with the mjuni distribution, and implement a stand-alone C# script (without including anything from MuJoCo) that attempts to open a socket connection using the same commands. If this fails (and I am pretty sure it will fail) it means that you have to add socket functionality to your installation. My experience with Unity/C# is limited to the one month that I spent integrating MuJoCo with it, so I don't know how to handle missing packages/classes. The Unity (or HoloLens) forums are more likely to contain relevant information.