Giter VIP home page Giter VIP logo

pi-bno055's Introduction

Welcome

I enjoy designing and building electronics hardware (development boards), and learning how to code low-level. I have been working on FPGA PMOD design, on solar position tracking for photovoltaic systems, and with a long work history in Information Security some repos are security-related.

Frank's github statsTop Langs

pi-bno055's People

Contributors

bdholt1 avatar fm4dd avatar mdleiton 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

Watchers

 avatar  avatar

pi-bno055's Issues

License

Could you add a license file, please?

Shell script to automate the loading of the calibration data from previously saved file after first calibration

Thanks Frank M for developing such a wonderful command line tool for bno055 calibration data. It was hard to find a tool that would do this on Raspberry Pi as most of the stuff on web talks about Arduino code.

I took your tool and created a shell script that someone can add to their .bashrc file so as soon as the Raspberry Pi starts, it will execute that script and load previously saved calibration data and you will not have to mess around with calibrating the sensor every time you restart your RPi.

Note: first time I ran the tool to load the file I did not realize I had to change the mode to config before the sensor will allow you to do that so I received errors while loading but after I changed the mode correctly things worked really well.

Assumption here is - you have used the Adafruit Webgl_Demo tool and calibrated your sensor at least one time. After you have initial calibration done with all statuses [system, gyro, accel and mag] showing status=3 in webgl demo tool, you can use the following command to save file one time:

./getbno055 -w ./bno055.cal

after the file is created with name bno055.cal use the following script to load it anytime after that.

To execute the script simply run [assuming the script filename you saved it as is loadcal_bno055.sh]:

. loadcal_bno055.sh [this will ask you to hit any key at every step]

you can run it in fully silent mode with no user interaction by doing this:

. loadcal_bno055.sh silent

you can even add it to your .bashrc file if you wish. The script was tested on RPi4 running Ubuntu 20.04.

Note: You may want to change the folder below to your folder where you have installed the tool. Or you can make this argument for shell script

====================================================================
silentmode=false
if [[ "$1" == silent ]]
then
echo "silent"
silentmode=true
else
echo "user interaction mode"
fi

cd ~/dev/ros2/bno055_python/bno055_cmdline/pi-bno055
./getbno055 -a 0x28 -t inf -v
if [ "$silentmode" = false ] ; then
read -n1 -r -p "Press any key to continue..." key
fi
./getbno055 -m config
if [ "$silentmode" = false ] ; then
read -n1 -r -p "Changed mode to Config, Press any key to continue..." key
fi
./getbno055 -l ./bno055.cal
if [ "$silentmode" = false ] ; then
read -n1 -r -p "Loaded saved calibration offsets successfully. Press any key to continue..." key
fi

./getbno055 -m ndof
if [ "$silentmode" = false ] ; then
read -n1 -r -p "Switched back to operation mode. Press any key to continue..." key
fi

./getbno055 -a 0x28 -t inf -v
if [ "$silentmode" = false ] ; then
read -n1 -r -p "See latest calibration status after load above. Press any key to exit..." key
fi

cd ~

====================================================================

gcc v10 compilation error in latest Raspberry Pi OS "Bullseye"

The latest Raspberry Pi "Bullseye" OS release comes with gcc version 10, which introduces the "-fno-common" parameter as default. This setting now creates a linker error for variables declared in header files, and used in multiple .c files as shown below.

/usr/bin/ld: getbno055.o:/home/pi/pmod2rpi/pi-bno055/getbno055.h:172: multiple definition of `verbose'; i2c_bno055.o:/home/pi/pmod2rpi/pi-bno055/getbno055.h:172: first defined here

A quick workaround is explicitly setting "-fcommon" as a compiler parameter in the Makefile, but the better way is to correctly declare header file variables as extern.

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.