You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am pretty new to python and i am trying to set up a 3DM-GX5-15 to constantly stream values, in this case euler angles. I can successfully connect and ping the device but i am haing troubble with the setActiveChannelFields function. I am getting the error shown below
It looks like the error says the function needs 3 arguments but in the documentation it only shows 2
Do you have any ideas on how to solve this? my code is below.
Also how would i set the device to stream two values ex. euler angles and linear accelerations?
Thank you for the help,
# -*- coding: utf-8 -*-"""Spyder EditorThis is a temporary script file."""importmsclimportmisctry:
connection=mscl.Connection.TcpIp("10.0.1.53",10001)
#create the InertialNode, passing in the connectionnode=mscl.InertialNode(connection)
pingSuccess=node.ping()#test is already connected to imuifpingSuccess==True:# only reconnect if not already connectedprintmisc.GREEN+"ping success"+misc.ENDCelse:
printmisc.RED+"ping failed"+misc.ENDCnode.setToIdle()#set the accelerometer to idle so it can be configuredsampleRate1=mscl.SampleRate(1,100)# mode 1=hertz, 100 hertzMipChannel1=mscl.MipChannel(0x8205,sampleRate1)#euler angles for channel 1node.setActiveChannelFields(0x80,MipChannel1)#need to fix thisexceptmscl.Error, e:
print(e)
The text was updated successfully, but these errors were encountered:
The setActiveChannelFields actually takes a MipChannels (note the 's') as a second parameter. You are passing it a single MipChannel.
You want to do something like the following:
mipChannel1=mscl.MipChannel(mscl.MipTypes.CH_FIELD_ESTFILTER_ESTIMATED_ORIENT_EULER, mscl.SampleRate.Hertz(100))
chs=mscl.MipChannels()
chs.append(mipChannel1)
#append more 'mscl.MipChannel' objects to 'chs' as necessary
One other thing to note (that I'd like to abstract and make better in the future), is that the setActiveChannelFields function needs to be called once per mscl.MipTypes.DataClass that you want to change. For instance, the function will error out if you try to set Estimation Filter channel fields for the mscl.MipTypes.CLASS_AHRS_IMU Data Class, which is what it looks like your code was doing as well.
Hi, I am pretty new to python and i am trying to set up a 3DM-GX5-15 to constantly stream values, in this case euler angles. I can successfully connect and ping the device but i am haing troubble with the setActiveChannelFields function. I am getting the error shown below
It looks like the error says the function needs 3 arguments but in the documentation it only shows 2
Do you have any ideas on how to solve this? my code is below.
Also how would i set the device to stream two values ex. euler angles and linear accelerations?
Thank you for the help,
The text was updated successfully, but these errors were encountered: