ngimu-python-example's Introduction
ngimu-python-example's People
ngimu-python-example's Issues
pyosc support discontinued
I tried the code with pyosc but i was not able to fix some issue with dependent library. I had to install python osc and python3. I want to connect to the sensor for a time period of 10 minutes and terminate the connection. The following is the code I have:
from pythonosc import udp_client
from pythonosc import osc_message_builder
from pythonosc import dispatcher
import socket, threading, time
from pythonosc import osc_server
import time
tstart=time.time();
Change this to the NGIMU IP address
send_address = '192.100.1.1', 9000
client =udp_client.SimpleUDPClient('192.100.1.1', 9000)
msg=osc_message_builder.OscMessageBuilder()
msg=msg.build()
print(str(socket.gethostbyname(socket.gethostname())))
#receive_address='192.100.16.2', 8000
dispatcher = dispatcher.Dispatcher()
server = osc_server.ThreadingOSCUDPServer(('192.100.16.2', 8001),dispatcher)
#server.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
print("Serving on {}".format(server.server_address))
server.server_activate()
#server.server_close()
tnow= time.time();
tdiff= tnow-tstart
while(tdiff1000<10):
tnow= time.time();
tdiff= tnow-tstart;
print(tdiff)
if(tdiff1000>10):
server.server_close()`
It gives me an error:
File "C:/sensor/ngimu.py", line 27, in server = osc_server.ThreadingOSCUDPServer(('192.168.1.2', 8001),dispatcher)
File "C:\ProgramData\Anaconda3\lib\site-packages\pythonosc\osc_server.py", line 107, in init super().init(server_address, _UDPHandler)
File "C:\ProgramData\Anaconda3\lib\socketserver.py", line 453, in init self.server_bind()
File "C:\ProgramData\Anaconda3\lib\socketserver.py", line 467, in server_bind self.socket.bind(self.server_address)
OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted
Can you post a code with python3 and pythonosc?
Python example in BeagleBone Blue
Hello,
I am trying to read NGIMUs data via UDP on a BeagleBone using the example you provided. I inserted the port numbers indicated by the GUI and it worked once. After that, it never worked anymore. The error I get is: [Errno 11] Resource temporarily unavailable
Is it possible that the port numbers are different from the ones displayed in the GUI? Do you have any suggestions on how to solve this issue?
Thank you!
Elena
Where is the client storing the timetag
I am using an ngimu, and trying to read the timestamps from the incoming OSC packets using python-osc. Is there any example of how I should approach retrieving these timetags? (I would also like to set the time on the ngimu, I was unsuccessful sending a '/time' message)
udp port and ip in python example
The comment in script.py says that udp_ports must be an array of ports listen to and "These ports must be equal to
the UDP Send Port in the NGIMU settings." I checked with the GUI, the UDP send port is 8000, so changed to:
udp_ports = [8000]
For ip, the comment says "The UDP Send IP Address setting must be the computer's IP address". But it's not working with my ip address...
The next sentence is unclear: "Both these settings are changed automatically when connecting to the NGIMU using the NGIMU GUI." So what am I required to do? Running the GUI, checking udp send port and ip, closing GUI and starting the python example? Can you give me an advice/clarification what to do?
Hint/Info: With the GUI I can connect to the device, but only via serial (Comport). When cklicking on UDP, I get an error. I would actually like to read the device over USB from a python script.
do you know how to get the IP address of the NGIMU?
What should I do in order to get the IP address of the NGIMU on Linux (Ubuntu 16.04)? I tried to find the answer using the manual and the example code, but no good result came. Please help.
How do I get sensor to send name?
I have added this the the python sample. dispatcher.map("/name", name)
However, the device never sends this info. So my python script doesn't know which sensor is sending in data. If I have 2 sensors sending to the same osc server the name needs to be included on all data or there is no way to know which one is sending in what. From the NGIMU gui you can issue a read from device command but don't know how to make this happen from the python script. suggestions?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.