Skip to content

Instantly share code, notes, and snippets.

View bugobliterator's full-sized avatar

Siddharth Bharat Purohit bugobliterator

View GitHub Profile
/*
* testpru
*
*/
#define PRU1
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
HAL_BOARD=HAL_BOARD_LINUX TOOLCHAIN=NATIVE EXTRAFLAGS=-DGIT_VERSION="53268c31"
building /tmp/ArduCopter.build/ArduCopter.cpp
%% ArduCopter.cpp
make: *** No rule to make target `/root/beaglepilot/libraries/AP_Notify/ToshibaLED_VRBRAIN.h', needed by `/tmp/ArduCopter.build/ArduCopter.o'. Stop.
%% libraries/AP_HAL_AVR/utility/pins_arduino_mega.o
arm-linux-gnueabihf-gcc-4.7 -g -D_GNU_SOURCE -DF_CPU= -DSKETCH=\"INS_generic\" -DSKETCHNAME="\"INS_generic\"" -DAPM_BUILD_DIRECTORY=APM_BUILD_INS_generic -DGIT_VERSION="\"318ea98b\"" -DCONFIG_HAL_BOARD=HAL_BOARD_LINUX -DCONFIG_HAL_BOARD_SUBTYPE=HAL_BOARD_SUBTYPE_LINUX_PXF -Wa, -O0 -Wformat -Wall -Wshadow -Wpointer-arith -Wcast-align -Wno-unused-parameter -Wno-missing-field-initializers -Wwrite-strings -Wformat=2 -MD -MT /tmp/INS_generic.build/libraries/AP_HAL_AVR/utility/pins_arduino_mega.o -ffunction-sections -fdata-sections -fsigned-char -c -o /tmp/INS_generic.build/libraries/AP_HAL_AVR/utility/pins_arduino_mega.o /media/psf/Home/Documents/Programming/beaglepilot/libraries/AP_HAL_AVR/utility/pins_arduino_mega.c -I/media/psf/Home/Documents/Programming/beaglepilot/libraries/AP_HAL_AVR/utility//utility -I/media/psf/Home/Documents/Programming/beaglepilot/libraries/AP_InertialSensor/examples/INS_generic -I/media/psf/Home/Documents/Programming/beaglepilot/libra
spi@48030000 {
compatible = "ti,omap4-mcspi";
#address-cells = <0x1>;
#size-cells = <0x0>;
reg = <0x48030000 0x400>;
interrupts = <0x41>;
ti,spi-num-cs = <0x2>;
ti,hwmods = "spi0";
dmas = <0x7 0x10 0x7 0x11 0x7 0x12 0x7 0x13>;
dma-names = "tx0", "rx0", "tx1", "rx1";
APM: PERF: 0/1000 9730
Scheduler overrun task[15] (21/20)
Scheduler overrun task[5] (33/10)
Scheduler overrun theight -10
APM: PERF: 0/1000 9484
APM: PERF: 0/4000 2968
height -20
APM: PERF: 0/4000 2981
height -10
APM: PERF: 0/4000 2939
APM: PERF: 0/4000 2649
height -10
APM: PERF: 0/4000 2704
APM: PERF: 0/4000 2668
U-Boot SPL 2013.04-dirty (Jul 10 2013 - 14:02:53)
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
/*
Levenberg-Marquadt Optimiser for Magnetometer Calibration
by Siddharth Bharat Purohit
Optimiser: {Transpose(J)*J-l*I}*B=Transpose(J)*F
where: J is the jacobian with respect to parameters to be optimised
I is the Identity Matrix
l is a scalar value varying required acting as gradient
B is set of parameters optimisation is being done for
F is the force matrix or fitness matrix storing degree of fitness each sample in sample space
void CompassCalibrator::run_sphere_fit(uint8_t max_iterations)
{
float fitness = _fitness, prevfitness = _fitness, fit1, fit2;
sphere_param_t fit_param = _sphere_param, temp_param;
static float lambda;
if(lambda == 0){
lambda =1;
}
for(uint8_t iterations=0; iterations<max_iterations; iterations++) {