Announcement

Collapse
No announcement yet.

[Free][Windows only] UE4Duino 2 - Arduino (COM port) communication

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Hey folks,
    I came across some weird behaviour regarding keyframes in recorded Takes.
    I have a simple cube that I constantly rotate by a fixed value around itself using the "AddRelativeRotation" node. Recording that using the Take Recorder I get an animation curve that looks like this.

    stepped animation curve

    I rather assumed a straight linear curve. Also I can't explain myself why there a always 2 keyframes "inside" the same frame. I thought I would get 1 keyframe per frame.
    In the Take Recorder I set "Remove redundant tracks" to false as well as "Reduce Keys". However, enabling "Reduce Keys" shows the same behaviour.
    BTW: this behaviour is also shown when recording data received via Arduino or from a Vive tracker.

    Hopefully someone can help me out on this one.
    cheers!

    Leave a comment:


  • replied
    Hello,

    I finally did it (USB HID communication on Unreal Engine), but I don't think you will be able to implement it in your plugin since it's a little special plugin I did.

    I splitted the plugin into two parts, one is to use my program with a little modification applied: https://www.codeproject.com/Articles...ices-using-HID

    And I used a short code C++ plugin that will communicate with the previous tool in order to have the USB data inside unreal engine.

    So, how do you want that, a tutorial or I give you a template + the USB tool.

    I tried to implement the USB tool inside a C++ plugin, but it crashed and slowed the game since I need an infinite loop in my USB tool.

    Leave a comment:


  • replied
    Originally posted by jessekirbs View Post
    RVillani Thanks for this plugin - it's incredible. Do you plan on ever making it compatible with Mac?
    Thanks! I can't take all the credit. I can't take most of it actually haha. I just improved an existing plugin.
    No plans for Mac. I'm not a fan of Apple, I don't own one and don't plan on doing so. It's too expensive compared to building a PC of same power and not cool for gaming.
    Sorry for the rant, but I don't wanna create false hope xD

    Leave a comment:


  • replied
    RVillani Thanks for this plugin - it's incredible. Do you plan on ever making it compatible with Mac?

    Leave a comment:


  • replied
    Originally posted by Muszti Projekt View Post
    Hi!
    How to dynamically get the COM port number?
    This plugin doesn't do it.
    I did it years ago for a Unity application, but I had to call code to read the Windows registry. Something like checking the names of the devices registered on all existing ports and using the first one that matched the Arduino device, if any.

    I didn't do it for this plugin because I can't know beforehand all possible Arduino device names. I only did it on the Unity application because I was only gonna use a specific board, which I got the name from Windows' Device Settings.

    Perhaps I could try to do it in the plugin and just return all names, so the burden to pick the right one would be on the final developer. It's not as beautiful as I like a plugin to be, but at least it would give users an option.

    Leave a comment:


  • replied
    Originally posted by Spyhabs View Post
    Hello,

    Is it possible to use this plugin to wait for data from outside.

    For example, sends a command from the PC to my device and then, wait for data or timeout reach.

    What I see in some examples, it's write data to the serial port, add a delay and then, read data from the serial port. I would like to be blocked until I receive some data OR reach a timeout.

    Thanks
    You NEVER want to block Unreal. Instead, write a timeout logic while trying to non-blockingly get the answer from Arduino. Something like
    Code:
    SendCommandToArduino()
    {
        Serial.Print("some command");
        CommandTime = WorldRealltimeSeconds;
    }
    
    Tick(float DeltaSeconds)
    {
    
        if (CommandTime - WorldRealtimeSeconds > Timeout)
        {
            SendCommandToArduino();
        }
        else
        {
            Response = Serial.ReadBytes();
            // Check if response is valid
        }
    }

    Leave a comment:


  • replied
    Hi!
    I would like to ask you guys, How to dynamically get the COM port number?

    Click image for larger version

Name:	arduino.jpg
Views:	206
Size:	222.6 KB
ID:	1783606

    Leave a comment:


  • replied
    Hello,

    Is it possible to use this plugin to wait for data from outside.

    For example, sends a command from the PC to my device and then, wait for data or timeout reach.

    What I see in some examples, it's write data to the serial port, add a delay and then, read data from the serial port. I would like to be blocked until I receive some data OR reach a timeout.

    Thanks

    Leave a comment:


  • replied
    I´m having trouble running UE4Duino. I created a new project and put ue4Duino (correct version) inside Plugins Folder. When I try to open the project it says "failed to load plugin ue4duino because module could not loaded" And the project closes. I tried with version 4.23.1 and also 4.24.1 (I downloaded the two engine versions)
    Click image for larger version  Name:	Imagem1.png Views:	7 Size:	36.7 KB ID:	1729841

    UPDATE:
    I managed to solve it. If someone is experiencing the same, try this:
    1. Check if Visual Studio is installed with "game development with C++".
    2. Create a unreal blank project with C++ and not Blueprint
    3. Create Plugins Folder under the project folder and put inside all ue4duino files without Binaries folder (delete it).
    4. Wait until the unreal project load and select rebuild plugin, when asked.
    5. After that, copy this ue4duino folder with your recompiled binaries to whatever project you want, including VR templates using only blueprints.
      that is it!
    Last edited by johnpaullima; 03-10-2020, 08:39 AM.

    Leave a comment:


  • replied
    Got it, thanks for the proposition I will try to do it cause I only know C# for now lol, I see so much potential with it, like including of VR controller support made with Arduino in UE4 directly, without the need of SteamVR and Windows driver USB setup, the dream
    Last edited by Fortnite50v50_; 02-27-2020, 01:38 PM.

    Leave a comment:


  • replied
    Originally posted by Haeath View Post
    Cool project.

    Do you plan to add the HID protocol support too ?

    I wrote this to be able to do that in Arduino-side: https://www.codeproject.com/Tips/125...g-HID-Protocol

    And I am using this: https://www.codeproject.com/Articles...ices-using-HID for PC-side

    But I wonder if we can bypass it and do it in UE4 directly with your method.
    That's very interesting!
    Well, lately I've been super busy with work, so I try to, at least, keep the plugin's binaries and code up to date with new UE4 versions. But if you implement that in the plugin, do a pull request to the Git repo and I'd gladly make it a part of it.
    Although, it looks like something only very advanced users would try, with the replacement of Arduino libraries and all.

    Leave a comment:


  • replied
    RVillani

    Thank you. I did not know that. My stuff builds now.

    Leave a comment:


  • replied
    Cool project.

    Do you plan to add the HID protocol support too ?

    I wrote this to be able to do that in Arduino-side: https://www.codeproject.com/Tips/125...g-HID-Protocol

    And I am using this: https://www.codeproject.com/Articles...ices-using-HID for PC-side

    But I wonder if we can bypass it and do it in UE4 directly with your method.
    Last edited by Fortnite50v50_; 02-17-2020, 11:03 AM.

    Leave a comment:


  • replied
    Originally posted by COMET-35 View Post
    Hello RVillani,
    I was trying to include the Serial.h file in a custom c++ class but I keep getting this error.
    Error C1083 Cannot open include file: 'Serial.h': No such file or directory
    I did make sure to add the path of the header file to my VC++ Directories include directories.in my project properties. Unfortunately Visual Studio still can't find the header file.
    I am using the latest version of UE4Duino.
    Any help would be appreciated. Thank you and have a nice day.
    You don't want to change the project settings. Those will be overwritten when you do Generate Project Files (and we always have to do it again every once in a while).
    What you need to do in order to use the plugin in C++ code is to add it to your module's dependencies, in its Build.cs file.

    For instance, if your project is called MyProject, it'll be Source\MyProject\MyProject.Build.cs.
    On that file, add "UE4Duino" to your PrivateDependencyModuleNames. So, if UE4Duino is the first module you're adding there, it'll look like
    Code:
    PrivateDependencyModuleNames.AddRange(new string[] { "UE4Duino" });
    Unreal Build Tool will then understand you want to use the UE4Duino module on your project's main module and automatically know where to include and link stuff from.
    Besides that, you need to have the plugin in a Plugins folder and enabled in your project.

    Leave a comment:


  • replied
    Hello RVillani,

    I was trying to include the Serial.h file in a custom c++ class but I keep getting this error.

    Error C1083 Cannot open include file: 'Serial.h': No such file or directory

    I did make sure to add the path of the header file to my VC++ Directories include directories.in my project properties. Unfortunately Visual Studio still can't find the header file.

    I am using the latest version of UE4Duino.

    Any help would be appreciated. Thank you and have a nice day.

    Leave a comment:

Working...
X