Comments (9)
Same problem, please help us
from pyteapot-quaternion-euler-cube-rotation.
It seems like you have the the dependencies installed. Did you configure the UDP IP if using WiFi, or set useSerial
to True
if using serial port for communication (and also set the right serial port in place of /dev/ttyUSB0
)? Try using the serial port first to see if it works. If the problem is with using UDP sockets, perhaps @Takaklas can help since they implemented that functionality?
from pyteapot-quaternion-euler-cube-rotation.
Glad to receive your response.
I confirmed thet I had the dependencies installed already and changed useSerial
to True
as you suggested. Anyway I'm trying to test my new-bought IMU sensor, but the program always gets stuck and when it exit the error info is:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf8 in position 0: invalid start byte
I tried to change utf-8
to gbk, ascii, gb2312, etc. , but none of them works. Can you help me out?
Thanks again
from pyteapot-quaternion-euler-cube-rotation.
Is there an error stack trace? Any traceback to which line the error originates? Also, which version of python are you using? Are you already sending the IMU data on your computer's serial port in the format mentioned in the readme? Did you change to that particular serial port in the code?
from pyteapot-quaternion-euler-cube-rotation.
The full error stack trace is as below:
Traceback (most recent call last):
File "C:/.../PyTeapot-Quaternion-Euler-cube-rotation/pyteapot.py", line 203, in
main()
File "C:/.../PyTeapot-Quaternion-Euler-cube-rotation/pyteapot.py", line 43, in main
[yaw, pitch, roll] = read_data()
File "C:/.../PyTeapot-Quaternion-Euler-cube-rotation/pyteapot.py", line 102, in read_data
line = ser.readline().decode('UTF-8').replace('\n', '')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf8 in position 0: invalid start byte
My python version is 3.8.8.
I just used official upper machine software of this IMU and confirmed my PC reads the data correctly. As I am new in this area, I just change my setting as that of the upper machine, like this:
useSerial = True # set true for using serial for data transmission, false for wifi
useQuat = False # set true for using quaternions, false for using y,p,r angles
if(useSerial):
import serial
ser = serial.Serial('com5', 115200)
else:
import socket
...
Did I set those params correctly? Or the data from IMU needs to be formatted as some standards first?
from pyteapot-quaternion-euler-cube-rotation.
Yes the IMU data needs to be formatted as defined in the readme (see the String passed over Serial or WiFi section). You can connect the IMU to a microcontroller like Arduino and write a simple program to read the IMU data and send it on your computer's serial port in the format specified in the readme. Also, I just ran my application on Windows for the first time and it ran perfectly fine. Just reiterating the steps I performed from scratch (you can ignore steps 2, 3 if you wrote a program to send your IMU's actual data on the serial port):
pip install pygame PyOpenGL PySerial
- Since I don't have a physical device to send IMU data over serial port, I used com0com to fake a pair of virtual COM ports (labelled
COM11
(Tx),COM12
(Rx)) on Windows. - Wrote a bare minimum python script to send fake data on the Tx COM port:
import serial
ser = serial.Serial('COM11', 38400)
while True:
ser.write(b'w0.09wa-0.12ab-0.09bc0.98cy168.8099yp12.7914pr-11.8401r\n')
ser.close()
- Set
useSerial
toTrue
and used the right COM port (in my caseCOM12
).
I had to do nothing else for the program to work.
Here's a screenshot:
from pyteapot-quaternion-euler-cube-rotation.
Thank you, I believe that's the problem.
I'll try later and thanks again.
Updated(28th July, 2022).
I changed my settings and now the program runs well. Thanks!
from pyteapot-quaternion-euler-cube-rotation.
Sure no problem. Closing issue for now, feel free to reopen if it still doesn't work.
from pyteapot-quaternion-euler-cube-rotation.
I changed following lines and it is working now:
useSerial = False
to
useSerial = True
ser = serial.Serial('/dev/ttyUSB0', 38400)
to
ser = serial.Serial('COM6', 115200)
Thank you!
from pyteapot-quaternion-euler-cube-rotation.
Related Issues (11)
- OpenGL.error.NullFunctionError: Attempt to call an undefined function gluPerspective HOT 2
- Do graceful error handling for socket communication HOT 1
- Which order to pass quaternions? HOT 2
- How to rotate object 180 degrees?
- MPU9250 sensor fusion HOT 2
- Quaternion calculation HOT 1
- unable to initialize HOT 8
- Euler angles Range HOT 4
- No argparse interface for controlling the program HOT 1
- [TODO] Read data from file for visualisation HOT 3
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.
from pyteapot-quaternion-euler-cube-rotation.