xioTechnologies / NGIMU-MATLAB-Real-Time-Example

11 stars 11 forks source link

How to connect NGIMU to MATLAB #6

Open MYEONGKO opened 2 years ago

MYEONGKO commented 2 years ago

Hello, I am a student studying codes and sensors on my own. I'm trying to follow the Matlab real-time example code, but I'm inexperienced in using matlb, so I can't even connect to matlab.

  1. In my case, I changed to Client mode in the NGIMU GUI and connected the wifi being used in the computer to the sensor. Afterwards, I have no idea how to call my NGIMU from code examples such as getOscmessages.m, gui.m, etc. I check the connected ip in the settings part of the NGIMU GUI and try to connect in matlab, but I have no idea how to do it. Can you tell me in detail how to connect to matlab?? (AP/Client ) thank you. 사진1
xioTechnologies commented 2 years ago

I suggest you do the following:

  1. Configure the NGIMU and your computer to be on the same network. You can do this with the NGIMU in AP mode or Client mode. In AP mode the NGIMU creates a Wi-Fi network that you connect to in the same way you connect to any other Wi-Fi network (no password). In Client mode you must set the Client SSID and Client Key to match the router you are connecting to.
  2. Open the NGIMU GUI, click Search For Connections and connect to the NGIMU.
  3. Make a note of the UDP Send Port. It is 8016 in your screenshot above.
  4. Close the NGIMU GUI and run the MATLAB example. Enter the UDP Send Port value and click open.
MYEONGKO commented 2 years ago

Thank you for quick response! I checked the Wi-Fi connection with the sensor, and I also checked the port serial number. After that, where do you enter the udp port serial number or wifi IP address to proceed with real-time communication? I download the latest codes and proceed, but I am not sure where to enter the port number or IP to connect. I'm not familiar with the code yet, so I'm not sure where the connection part is in the gui or getOscMessages as in the picture below. sorry for inconveniencing to you. We would appreciate it if you could reply as soon as possible.

image

xioTechnologies commented 2 years ago

It sounds like you have not attempted to run the code. If you run the code then a gui will appear. The README includes a screenshot of the gui and shows a single text box labelled "UDP Port". This is where you enter the UDP port value.

MYEONGKO commented 2 years ago

캡처1 캡처2 캡처3

When I run gui.m and try to input the port number, the plot window opens like this and the plot does not close either. So the connection itself is not working. The size of the plot window is not adjusted, so the upper part is not visible. Is this a problem with matlab itself or the computer itself?

xioTechnologies commented 2 years ago

The example runs without issue on my machine. I suggest you adjust the window size of the gui on your machine so that all of the components fit. Alternatively you can move the UDP port text box so that it is in the viewable area of the window.

MYEONGKO commented 2 years ago

Your advice has been really helpful. After checking in mathworks, the problem with plot was a screen magnification problem. It was made as a guide, so there seems to be a bug in certain screen magnifications.

  1. Is the .fig code in the app design rather than the guide?
  2. I proceeded with the gui by adjusting the screen magnification, but the real-time communication speed is very slow, and later this error pops up and stops. Can you figure out the cause? Thank you.

error1

image

xioTechnologies commented 2 years ago

If the update rate speed is unreliable then this may be because you are sending data a rate to high for the MATLAB gui to handle. I suggest you reduce the send rates in the NGIMU settings.