Hey all,
I’m trying to build a real-time 3D model visualization tool with VTK and PyQt5 and I’m looking for some assistance.
I am currently reading data from a 6 axis IMU over serial as the following:
"second, accel_x, accel_y, accel_z, gyro_x, gyro_y, gyro_z"
with accel values in m/s^2 and gyro values in degrees/second.
Currently I have a skeleton of a function to read values over serial and I want to be able to then rotate my 3D model to match the orientation of my sensor.
def display_rotations_on_visual(self, data):
if not self.uic.buttonConnectSerial.isChecked():
pass
else:
line = data.strip().split(',')
if len(line) != 7: # Checks if len is correct
pass
else:
try:
seconds = line[0]
# Accel values
accelX = float(line[1])
accelY = float(line[2])
accelZ = float(line[3])
# Gyro values
gyroX = float(line[4])
gyroY = float(line[5])
gyroZ = float(line[6])
# Additional data processing and rotation handling
except:
pass
Ideally I’m looking for some sort of data fusion with quaternions (to help negate gyro drift), but anything that remotely tracks my sensor is helpful and can be iterated on.
Now, how would I go about this? How can I apply rotations and re-render my model in real time without causing any memory issues? Any information is useful, and I appreciate any messages.
Thank you in advance!