Coder Social home page Coder Social logo

bno080's People

Contributors

jps2000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bno080's Issues

FSM300

Hi,

Relatively inexperienced user here, so please excuse the general ignorance. I'm having trouble getting your examples working using an Arduino Uno and a FSM300. The code is verifying and uploading just fine. The furthest i'm getting on the serial monitor in any example is this:

11:48:15.623 -> *********************************************************************
11:48:15.623 -> Basic code for running BNO080 on Arduino Nano etc. (Atmega 328p) V1.1 2017-07-16
11:48:15.657 -> *********************************************************************
11:48:15.657 ->
11:48:16.130 -> Scanning for I2C devices... (SOMETIMES STALLS HERE)
11:48:16.164 ->
11:48:16.164 ->
11:48:16.164 -> ******** set feature command quat **********
11:48:16.535 ->
11:48:16.535 -> ******** configure ME cal **********

I'm using the following wiring :
('/' to indicate when i've tried multiple)

UNO ---------FSM300
3.3v-----------VDD
GND----------GND
SCL/A4--------SCL
SDA/A5--------SDA

I've also tried using 2.2k pullups on the SCL and SDA lines.

Uncommenting SerialDebug doesn't seem to have any effect.

I don't believe there's anything wrong with my soldering or any damage to the FSM300, as i've gotten it working with the software provided by Hillcrest. Unfortunately, I still need it working on Arduino.

Thanks in advance for any help you could provide.

Best,

Merlin

Connection via I2C

Hi jps2000,
i bought the dev. Kit from Hillcrest Labs for the BNO080. I went threw the starting guide and everything worked fine. But because i am not familiar using FRTOS i tried to write my oen code. Im also new to STMicrocontrollers and the HAL library. So i tried it like that.

if(HAL_I2C_IsDeviceReady(&hi2c1, 0x4A, 100 ,100) != HAL_OK){
HAL_UART_Transmit(&huart2, "Device not found! \n\r", strlen(msg), 0xFFFF);
}
else{
HAL_UART_Transmit(&huart2, "Device found! \n\r", strlen(msg), 0xFFFF);
}
If my NUCLEO-F411RE Board could reach the BNO080 should be enough to check if the Device is rdy?
I would be glad if you could help me.

greets

Problem with this library to obtain yaw, pitch and roll

Hi,

I have un problem with this library to obtain yaw, pitch and roll.

With this buffer 'cargo':
0x17 0x80 0x03 0xAF 0xFB 0x19 0x00 0x00 0x00 0x05 0x0B 0x00 0x00 0xC6 0xFE 0xB0 0x01 0x29 0x3A 0xA2 0x1A 0x44 0x32

I have obtain this results:
q1 = ( ( ( int16_t ) cargo [ 14 ] << 8 ) | cargo [ 13 ] ) ;
q2 = ( ( ( int16_t ) cargo [ 16 ] << 8 ) | cargo [ 15 ] ) ;
q3 = ( ( ( int16_t ) cargo [ 18 ] << 8 ) | cargo [ 17 ] ) ;
q0 = ( ( ( int16_t ) cargo [ 20 ] << 8 ) | cargo [ 19 ] ) ;

q0 *= QP14 ; q1 *= QP14 ; q2 *= QP14 ; q3 *= QP14 ;

q1 = 3.9808
q2 = 0.0263
q3 = 0.9087
q0 = 0.4161

To obtain yaw.pitch and roll i have apply this conversions :
tmp_yaw = atan2 ( ( q1 * q2 + q0 * q3 ) , ( ( q0 * q0 + q1 * q1 ) - 0.5f ) ) ;
tmp_pitch = -asin ( 2.0f * ( q1 * q3 - q0 * q2 ) ) ;
tmp_roll = atan2 ( ( q0 * q1 + q2 * q3 ) , ( ( q0 * q0 + q3 * q3 ) - 0.5f ) ) ;

tmp_yaw = 0.0311
tmp_pitch = 0
tmp_roll = 1.2821

I have convert this variables in degrees:
pitch = tmp_pitch * ( 180.0 / M_PI ) ;
yaw = tmp_yaw * ( 180.0 / M_PI ) ;
roll = tmp_roll * ( 180.0 / M_PI ) ;

pitch = 0
yaw = 1.78
roll = 73.46

This results in degrees, it are not real because the BNO080 sensor is stopped. Where is the problem ? It's urgent !

Thanks you!

Regards,

Question (actually looking for your opinion) re: reliability

Hi There jps2000!

You probably remember me and I wanted to say that I have the BNO080 running fine for my testing thus far (using SPI thanks to you). I just so happened to come back here and re-read your repository readme and it got me thinking... Is it fair to say that all of the risk you mention with this sensor (ie using indoors, degauss practices etc) are mostly directed at the heading / magnetometer sensors?

I ask because I am using the BNO080 primarily for a balancing robot, which relies on a stable X,Y (accel and gyro - but I think it also uses the magnetometer). The heading is secondary and not relied on in my use case. In your opinion is the X,Y output on this sensor at risk because of the advanced housekeeping required? If so, maybe I should downgrade to something more reliable such as a MPU-6050? Or....once calibrated, are you fairly certain that the BNO080 X,Y would at least remain stable even if my sensor suddenly drove next to a large piece of iron :)

I love the BNO080 for the precision and speed, but I worry that it may be overkill and have reliability issues in the real world.

Your opinions (and I know they are just that) are appreciated.

Thanks!

Richard

BNO055 to BNO080

Wow, this is incredible! A million thanks for putting this code together. I am looking forward to trying this code over the existing 055 nightmare.

I am using the IMU in a tractor for heading and roll in Precision Ag applications. The BNO055 is certainly fine on the desk, but in a moving world is a disaster as i am sure you know.

FMS on order and can't wait to try this!

https://github.com/farmerbriantee

UART communication

Hi there. I am using the Hillcrest FSM300 board with an Arduino Mega and your code works perfectly. I was wondering if you have ever tried to communicate via UART instead of I2C? I tried converting the BNO080_2 code to talk to the FSM300 through the Mega's Serial1 connection, but have had no luck at all. Serial1.available never goes > 0, so I don't know whether I'm not sending the setup commands correctly or not listening correctly. I tried looking through Hillcrests' Nucleo code but that hasn't helped at all, and their tech support hasn't either.

Any help/advice you could give would be greatly appreciated, as I've been banging my head against the wall for a few days now and have gotten nowhere (except a headache).

Michael

Thank you

This obviously is not an issue, but I did not know where else I could express my gratitude.

I just want to say very big thank you jps2000 for sharing the code and being so responsive. I went through earlier issues and your comments and I was able to solve my issues with BNO080 drift at last. The trick that solved the problem was degaussing it and calibrating at site. Thank you for the advice!

Keep up the good work,

Fred

General questions about BNO080

Hello jps2000,
i'm a german student writing my bachelor thesis in a company. I should use the BNO080 to determine the actual position in a "Local Positioning System". I didnt get a lot of information and also the internet is is very less of information about the BNO080. What would you recommend to start with. Buying the BNO080 development kit by Hillcrest? Also i want to ask about the software. I read about the IAR Embedded Workbench. Is this the IDE or just the compiler for the ARM processor on the Nucleo development board. I would be glad if you can help me.

greetings

Yaw, pitch and roll - BNO080

Hi,
I have a new problem, with this buffer 'cargo' i obtain this yaw,pitch and roll value:
0x17 0x80 0x03 0x9B 0xFB 0x17 0x00 0x00 0x00 0x05 0xB2 0x03 0x00 0xA8 0x16 0x21 0xF1 0xF6 0xDF 0x53 0x30 0xCF 0x01

a=0.755065
b=0.354003
c=-0.23236
d=-0.50061
argument=-0.00354
yaw=336.9
pitch=-0.2
roll=50.1

But the pitch value can't be about equal to 0, why the sensor is positioned like this:

                  \
                    \  -> BNO080
                      \
         ---------------------------- -> DESK

The pitch should take the value about 70-80. I posted my code:

/* VARIABLES */

float Q0 , Q1 , Q2 , Q3 ;

float H_est ; // heading accurracy estimation
uint8_t stat_ ; // Status (0-3)

int len = 0 ;
uint8_t next_data_seqNum = 0x0A ; // reading next data sequence number start with 10 to catch up earlier
uint8_t seqNum_2 = 0 ; // writing sequence number channel 2
uint8_t cargo [ 300 ] = "" ;

const uint8_t quat_report = 0x05 ; // defines kind of rotation vector (0x05), geomagnetic (0x09), AR/VR (0x28),
// without magnetometer : game rotation vector (0x08), AR/VR Game (0x29)

#define reporting_frequency 100 // reporting frequency in Hz
// report interval need to be longer than loop duration not to miss any report ! --> code checks for incrementing seqNum
// note that serial output strongly reduces data rate

uint8_t B0_rate = 1000000 / reporting_frequency ; // Calculate LSB (byte 0)
uint8_t B1_rate = ( 1000000 / reporting_frequency ) >> 8 ; // Calculate byte 1

void get_QUAT ( void )
{
memset ( cargo , 0 , sizeof ( cargo ) ) ;

nrf_drv_twi_rx ( &m_twi , BNO_ADDRESS , cargo , 4 ) ;	

// Verifico se ho ricevuto il messaggio

if ( check_cargo_buffer_isEmpty ( cargo , 4 ) == false )
{
memset ( cargo , 0 , sizeof ( cargo ) ) ;
nrf_drv_twi_rx ( &m_twi , BNO_ADDRESS , cargo , 23 ) ;

// to reduce I2C bus and computing --> read header first		      
	if ( ( cargo [ 9 ] == quat_report ) /*&& ( ( cargo [ 10 ] ) == next_data_seqNum )*/ )
	{      
		int16_t 	q0 , q1 , q2 , q3 , h_est ; 			
		float 		a , b , c , d , norm ;
		 
		// Check for report and incrementing data seqNum
		next_data_seqNum = ++ cargo [ 10 ] ;	// Predict next data seqNum    
		stat_ = cargo [ 11 ] & 0x03 ;		// bits 1:0 contain the status  

		q1 = ( ( ( int16_t ) cargo [ 14 ] << 8 ) | cargo [ 13 ] ) ; 
		q2 = ( ( ( int16_t ) cargo [ 16 ] << 8 ) | cargo [ 15 ] ) ;
		q3 = ( ( ( int16_t ) cargo [ 18 ] << 8 ) | cargo [ 17 ] ) ;
		q0 = ( ( ( int16_t ) cargo [ 20 ] << 8 ) | cargo [ 19 ] ) ; 

		// Patch for rarely occurring wrong data from BNO of unknown reasons. --> Check if q(0,1,2,3) is not unity vector

		// Apply Q point (quats are already unity vector)
		a = q0 * QP(14) ; b = q1 * QP(14) ; c = q2 * QP(14) ; d = q3 * QP(14) ;	
		norm = sqrtf ( a * a + b * b + c * c + d * d ) ;
		
		// Skip faulty quats; margin is empirically determined
		if ( abs ( norm - 1.0f ) > 0.0015 ) return ;	

		// Update quaternions
		Q0 = a ; Q1 = b; Q2 = c; Q3 = d ;	
		
		// bits 1:0 contain the status (0,1,2,3)
		stat_ = cargo [ 11 ] & 0x03 ;		 

		// Heading accurracy only in some reports available
		if ( ( quat_report == 0x05 ) || ( quat_report == 0x09 ) || ( quat_report == 0x28 ) )	
  {  				
			// Heading accurracy estimation 
			h_est = ( ( ( int16_t ) cargo [ 22 ] << 8 ) | cargo [ 21 ] ) ;	 
			
			// Apply Q point 
			H_est = h_est * QP(12) ;	
			
			// Convert to degrees 
			H_est *= radtodeg ;	

  }

		// Calculate euler angles                
		yaw   =  atan2f ( Q1 * Q2 + Q0 * Q3, Q0 * Q0 + Q1 * Q1 - 0.5f ) ;
		
		// May be > 1 due to rounding errors --> undefined
		float	argument = 2.0f * ( Q1 * Q3 - Q0 * Q2 ) ;	
		
		if ( abs ( argument ) > 1.0f ) 
			argument = 1.0f ; 
		
		pitch =  asinf ( argument ) ; 
		
		roll  =  atan2f ( Q0 * Q1 + Q2 * Q3, Q0 * Q0 + Q3 * Q3 - 0.5f ) ;

		// Correction of the y axis direction
		yaw += M_PI * 0.5f ; 
		
		if ( yaw < 0 ) yaw += 2.0f * M_PI ;
		if ( yaw > 2.0f * M_PI ) yaw -= 2.0f * M_PI ;  

		yaw   *= radtodeg ;
		yaw    = 360.0f - yaw ;
		pitch *= radtodeg ;
		roll  *= radtodeg ;
		
		// Ci sono nuovi dati, li invio via BLE
		update_data_BNO080 = true ;

	}
			
}

}

Where is the problem ? It's very urgent !

Thanks you,

Regards

Assistance required please

Hi Peter l see you are in OZ l am in Taz, could you offer some help regarding the GY-BNO08X please, as l am certainly not a programmer.
I have uploaded your code to a Nano uncommented SerialDebug and I2Scan but nothing showing in the scan,
changed #define BNO_ADDRESS 0x4A to 0x4B without success as well.
I have ohmed out my 3.3v,gnd,SCL, SDA cables from the Nano pins to the IMU pins and they are ok, so connections and cable correct
Have SCL = A5, SDA = A4.
Not sure what you mean re below, as supplying 3.3v off Nano to IMU, so there shouldn't be a level shifter required?.
"Needs a 3V3 supply and connect I2C Bus via a level converter 5V --> 3V3!!! SDA = A4; SCL = A5."

Now have just tested Nano SCL (A5) and see it has 5v on it, In previous things of 3.3v l had used SPI does that use 3.3V?
So l may have killed both these IMU, if that is the case l won’t be getting any more.

Have used another I2C scanner and with 3.3v to IMU and direct SCL, SDA to Nano can see IMU on Ox4B.
Have today purchased a level shifter and connected up, but still your code and now the other I2C scanner that worked with direct connect I2C can't see the IMU.

Any way if l get these to work, the next part of your code ask's for
("******** set feature command quat **"); to do this do l uncomment // get_feature_request_quat()??, which l did and that removed the request.
("
configure ME cal ********** ");to do this do l put 5V to T6?? Tried that without success but of course l have no comms with the IMU.

Anything else required to get Yaw ??
Regards Kevin

BNO080 on Adafruit Feather M0

I'm an amateur programmer that just happened to be looking for BNO080 code as you posted the updated Arduino_BNO080_2.ino. I like the ideas of the buttons for calibration and tare, but am obviously overlooking what ever is necessary to get this code to run on my Adafruit Feather M0. Any suggestions?

PS: The Example1-RotationVectors sketch runs fine on my M0, but it utilized the "SparkFun_BNO080_Arduino_Library.h". Anyway, like I said: "amateur programmer"!

img_9362

Sincerely, MadMadHoosier, Steve.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.