🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    live motion tracking with multiple m5stickc in unity [QUESTION]

    PROJECTS
    6
    20
    32.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      shintobi
      last edited by

      Hey guys,

      I want to use several m5stickc's to track the upper body movement.
      The movement data should be streamed live into unity and applied to an armature.
      The goal is to get somewhat accurate rotation and location data of the upper limb joints.

      Is this possible?

      Kind regards,
      Tobi

      S 1 Reply Last reply Reply Quote 0
      • ajb2k3A
        ajb2k3
        last edited by

        It should be possible. You will need to connect the stickC’s to a server to receive the data and send it to unity and then something in unity to receive the data a deal with it. You can make a basic tracker in UIFlow which will record movement and transmit the values.

        UIFlow, so easy an adult can learn it!
        If I don't know it, be patient!
        I've ether not learned it or am too drunk to remember it!
        Author of the WIP UIFlow Handbook!
        M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

        1 Reply Last reply Reply Quote 0
        • T
          Thrasher
          last edited by

          Yeah, with UIflow GetAccX blocks are not a problem, but sending data via socket connection? Could be solved easily with wifi <>uart esp32 mode but Im not sure its possible with uiflow

          1 Reply Last reply Reply Quote 0
          • S
            shintobi @shintobi
            last edited by

            I started to use cloudmqtt and uiflow to send sensor data to my pc terminal via mqtt.
            I read that there is a mqtt lib for unity. So will try to research that. :)

            ajb2k3A 1 Reply Last reply Reply Quote 0
            • ajb2k3A
              ajb2k3 @shintobi
              last edited by ajb2k3

              @shintobi that is a good idea but for a more local version, you could used an M5Stack as a hub that connects to the pc over uart and have the sticks send the data to the stack.
              UIFlow has peer to peer connections between units.

              UIFlow, so easy an adult can learn it!
              If I don't know it, be patient!
              I've ether not learned it or am too drunk to remember it!
              Author of the WIP UIFlow Handbook!
              M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

              S 1 Reply Last reply Reply Quote 0
              • S
                shintobi @ajb2k3
                last edited by

                @ajb2k3 my goal is to make the communication wireless.
                do you mean i can get data from multiple devices in UIFlow at the same time?

                1 Reply Last reply Reply Quote 0
                • W
                  wikistik
                  last edited by

                  Have you considered using Bluetooth? I have connected a single Bluetooth tracking device (not from M5) to Unity without too much trouble. I believe Bluetooth supports up 7 clients connected at once.

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    shintobi @wikistik
                    last edited by

                    @wikistik actually an interesting idea. do you also have experience connecting several m5s via bluetooth?

                    W 1 Reply Last reply Reply Quote 0
                    • W
                      wikistik @shintobi
                      last edited by

                      @shintobi no I don't

                      1 Reply Last reply Reply Quote 0
                      • ajb2k3A
                        ajb2k3
                        last edited by

                        Okay, just got sent this link.
                        https://randomnerdtutorials.com/esp32-esp8266-raspberry-pi-lamp-server/

                        UIFlow, so easy an adult can learn it!
                        If I don't know it, be patient!
                        I've ether not learned it or am too drunk to remember it!
                        Author of the WIP UIFlow Handbook!
                        M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

                        S C 2 Replies Last reply Reply Quote 0
                        • S
                          shintobi @ajb2k3
                          last edited by shintobi

                          @ajb2k3 damn. i just randomly got the thought to check the forum and see you posted 2 mins ago. crazy...
                          Thanks i will check it out

                          ajb2k3A 1 Reply Last reply Reply Quote 1
                          • ajb2k3A
                            ajb2k3 @shintobi
                            last edited by

                            @shintobi only got the email an 10mins befor posting on the forum

                            UIFlow, so easy an adult can learn it!
                            If I don't know it, be patient!
                            I've ether not learned it or am too drunk to remember it!
                            Author of the WIP UIFlow Handbook!
                            M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

                            1 Reply Last reply Reply Quote 0
                            • lukasmaximusL
                              lukasmaximus
                              last edited by

                              I remember a Japanese user posting a video on twitter about using the M5Stack as a controller in unity. I found his slides its all in Japanese I'm afraid and not possible to copy past the text to translate but here's the link https://speakerdeck.com/naninunenoy/m5stack-with-unity in the slides he mentions a bluetooth library called grayblue, might be worth a shot checking that out. I also found these other two blog posts covering the subject again in Japanese but this time at least you should be able to copy and paste the text to translate https://qiita.com/Zeni-Y/items/1d0e545259fbcd9381c8 and http://prince9.hatenablog.com/entry/2018/09/26/055809

                              C S 2 Replies Last reply Reply Quote 0
                              • C
                                cmisztur
                                last edited by cmisztur

                                @shintobi , just sent you a voucher to our Unity MQTT asset.

                                http://unity3dassets.com/demos/wak-mqtt-demo2/index.html

                                S 1 Reply Last reply Reply Quote 0
                                • C
                                  cmisztur @ajb2k3
                                  last edited by

                                  @ajb2k3 for this use case I would recommend streaming IMU data to InfluxDB. Seems more appropriate for limb tracking.

                                  1 Reply Last reply Reply Quote 0
                                  • C
                                    cmisztur @lukasmaximus
                                    last edited by

                                    @lukasmaximus , below is some code I used on PYCOM hardware and WebBluetooth. I ran into issues when getting characteristic notifications faster than 1/2 sec. Not sure if it was an IDF GATT issue or WebBluetooth or PYCOM implementation. But it did kinda work.

                                    https://pastebin.com/We2S8JwR

                                    https://pastebin.com/HDrktkQZ

                                    https://pastebin.com/s23hUMiD

                                    https://pastebin.com/WtWr9C2J

                                    https://pastebin.com/7d9CEyuR

                                    1 Reply Last reply Reply Quote 0
                                    • lukasmaximusL
                                      lukasmaximus
                                      last edited by

                                      @cmisztur thanks for sharing

                                      1 Reply Last reply Reply Quote 0
                                      • S
                                        shintobi @cmisztur
                                        last edited by

                                        @cmisztur the unity mqtt asset looks nice. but where can i put port / user / pwd? :D
                                        i am using cloudmqtt as my broker.

                                        C 1 Reply Last reply Reply Quote 0
                                        • S
                                          shintobi @lukasmaximus
                                          last edited by

                                          @lukasmaximus will check it out. thanks!

                                          1 Reply Last reply Reply Quote 0
                                          • C
                                            cmisztur @shintobi
                                            last edited by

                                            @shintobi check out some of the scenes like ping-pong. It’s in a script on a GO.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post