This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IMU wit-motion does not show angles
#1
Good day.
I have an IMU of Wit-motion.com production. When I checked on Python software of Ubuntu OS, it could not show the angles in roll, pitch and yaw directions. Instead, it wrote 'None'. Who can help me? The code of python has been attached below:

from witmotion import IMU
import time


def callback(msg):
    print(msg)

# In old MAC
# imu = IMU("/dev/tty.wchusbserial110")


# In the new M2 Mac
imu = IMU("/dev/ttyUSB3")

# In Unix, default port ttyUSB0
# imu = IMU

imu.subscribe(callback)

Orientation = []

StartTime = time.time()
for i in range(100):
    angles = imu.get_angle()
    print(angles)
    if angles[0] is not None:
        roll = float(angles[0])
        pitch = float(angles[1])
        yaw = float(angles[2])
        print("roll = {:03.1f}, pitch = {:03.1f}, yaw = {:03.1f}".format(roll, pitch, yaw))
    Orientation.append(angles)
    time.sleep(0.05)
EndTime = time.time()

print("The Acquisition Lasted=", EndTime-StartTime, " s")
imu.close()
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)