bno055

Christian: I got a script from Mats to have my bnoValues read every 50 ms.

Looking at the code there are so many options what to get from the device - I am confused. For my hand leveling I need the offsets of pitch and roll in relation to horizontal.

I can not get usable values from the service, most of the times I get a few readings and after that only 0's.

Did you expect that the function "getOrientationEuler" would provide above mentioned values as yaw, pitch and roll and what do you think could cause the values to switch to 0 after a few reads?

I know you are busy and I will soon be away for vacation quite a while so there is no hurry for an answer

Juerg

calamity's picture

Hi juerg Yes, I have been

Hi juerg

Yes, I have been very busy lately, it`s the high season at my job and it leaves very low time for hobbies.

Can you show me the script you are using?

I have test the device only minimally (I have check that data where returned, but not if they where precise). I never get zero value after a few read, data returned seem consistant. But again I mostly test using the accelerometer interrupt. 

I will look at your script and try to find out what's not working

 

juerg's picture

bno055

I use a stripped down script only for testing the leveling of the hand

arduinoRight = Runtime.createAndStart("arduino","Arduino")
arduinoRight.connect("/dev/ttyACM0")

bno = Runtime.createAndStart("bno","Bno055")
bno.setController(arduinoRight)
clock = Runtime.createAndStart("clock","Clock")  #start clock service
loops = 0 

def startLeveling():
  global loops
  while not bno.begin():
    print "wait for device"
  print "bno055 connected";
  python = Runtime.getService("python")
  clock.setInterval(2000);
  clock.addListener("pulse",python.name, "keepHandLeveled")
  clock.startClock()
  loops = 0
def keepHandLeveled(time):
  global loops
  loops += 1
  if loops > 20:
    stopLeveling()

  print "loops " + str(loops) 
  event = bno.getOrientationEuler()
  print "pitch: " + event.pitch

def stopLeveling():
  clock.stopClock()
  print "clock stopped"  

The device connects and I normally do get a few pitch values in the loop but then I get only 0's for the pitch.

 

calamity's picture

hi juergI have test your

hi juerg

I have test your script and it working fine for me

I got 0.0 as first read, but after that I have what seem good value for all the loops

https://gyazo.com/3dcf00c0dc4702871c753b7d563ce431

if you get a few value then it stop, I suspect that your sensor is resetting.

There is a few debugging function in the bn0055 service, try to use them to see if your sensor is working correctly

bno055.getPOSTResult()   -> result of the bno self test at powerup

bno055.testBNO055()         -> ask for on sensor test

bno055.showSystemStatus() -> return the status of the board and error if any

The method you use should gives the value you want. But maybe you need to calibrate the sensor first.

the bno055 need to be calibrated to give precise value, see the documentation for the how to calibrate. 

Unfortunatly, the sensor don't save the calibration and it reset at every power up. But you can retrieve the calibration offset for each of the accelerometer, magnetometer and gyroscope with the function getCalibrationOffset(Device). then you can set the calibration offset in your python script to avoid doing the calibration protocol with setCalibrationOffset(Device, x, y, z, Unit)

 

juerg's picture

looks like a wiring problem

Hi Christian

looks like I loose I2C connection once the arm/hand is moving.

Had already planned to redo the wiring - one more reason to do it now.

I use Markus's method of wiring (HDMI cables) but its rather hard to remove the isolation from the thin wires. I have now ordered a AWG38 micro stripper so it should go better. Want also to provide more space for the cable in the shoulder as of Gael latest updates- so quite a job ahead. 

Thanks for your help.