decawave / mynewt-timescale-lib Goto Github PK
View Code? Open in Web Editor NEWTimescale processing library
License: Apache License 2.0
Timescale processing library
License: Apache License 2.0
Hi Paul:
We are using dw1000 with Microsemi'cpu and compile toolchain.
Is it possible that this timescale lib can support?
Much appreciated
Tks
Sayid
Hello Paul,
I'm getting the following errors when trying to link the libtimescale_core.a_xtensa
/Users/pkettle/workspace/timescale-core/lib/srkf_dbl.c:346:(.text.srkf_dbl_init+0x545): dangerous relocation: call0: call target out of range: memset
/Users/pkettle/workspace/timescale-core/lib/srkf_dbl.c:348:(.text.srkf_dbl_init+0x556): dangerous relocation: call0: call target out of range: realloc
/Users/pkettle/workspace/timescale-core/lib/srkf_dbl.c:350:(.text.srkf_dbl_init+0x571): dangerous relocation: call0: call target out of range: memset
The fix for this issue is to compile the library with the option "-mlongcalls" from this post:
https://www.esp32.com/viewtopic.php?t=549
Could i request you to do the same.
Thanks.
Hi Paul,
I'm using ESP32 as host controller, and it's architecture is Xtensa LX6.
I have realized that there is a library named libtimescale_core.a_xtensa at src folder, and form #1 I already knew that the library is compiled for ESP8266.
ESP8266โs architecture is Xtensa L106, slightly different form Xtensa LX6. I have tested the libtimescale_core.a_xtensa library using the code below:
//////////////
#include <stdio.h>
#include "esp_system.h"
#include "timescale.h"
void app_main(void)
{
printf("SDK version:%s\n", esp_get_idf_version());
double x0[3] = {0}, q[3] = {128e6 * 512 * 3e-20, 128e6 * 512 * 3e-20 * 0.1, 128e6 * 512 * 3e-20 * 0.01}, T = 1e-6l * 0x100000;
timescale_instance_t * inst = timescale_init(NULL, x0, q, T);
printf("inst=%lu\n", (unsigned long)inst);
}
///////////
The ESP8266's result: inst=1074814716, and it seems all OK.
The ESP32's result: inst=0. And when I compile my app , there is some warnings like below:
"libtimescale_core.a(timescale.c.obj): warning: incompatible Xtensa configuration (ABI does not match)"
It seems that the library is not compatible with ESP32's architecture.
Then, can you please provide the libtimescale_core.a for ESP32 ?
The ESP32's SDK is not under the mynewt framework.
For the toolchain, please refer this link https://docs.espressif.com/projects/esp-idf/en/latest/get-started/linux-setup.html
Than you very much!
Is the libtimescale used in TWR usecase
I'm linking the libtimescale_core.a_xtensa library to my application, but during the call to timescale_main it crashes. I'm unable to get a backtrace currently probably due to missing symbols etc. But it may be due to the initialization/variable allocation that may be a problem.
If its not too much could you please include a sample program with sample inputs that could show the correct sequence of initialization and calling of timescale_main?
Here's a sample of the functions I've used, copied from mynewt application:
#include <timescale/timescale.h>
// 'Model Variance'
#define TIMESCALE_QVAR (double)(128e65123e-20)
// 'Observation Variance'
#define TIMESCALE_RVAR (double)(128e65126e-20)
struct _timescale_instance_t * timescale;
double x0[TIMESCALE_N];
double q[TIMESCALE_N];
double r[TIMESCALE_M];
double timescale_skew;
void dwm1000_tdoa_init()
{
#ifdef FS_XTALT_AUTOTUNE_ENABLED
xtalt_sos = sosfilt_init(NULL, sizeof(g_fs_xtalt_b)/sizeof(float)/BIQUAD_N);
#endif
#ifdef TIMESCALE_PROCESSING_ENABLED
double x0[] = {0};
q[0] = (TIMESCALE_QVAR) * 1.0;
q[1] = (TIMESCALE_QVAR) * 0.1;
r[0] = (TIMESCALE_RVAR);
// peroid in sec
double T = 1e-6l * SYNC_PERIOD * UUS_TO_DWT_TIME;
timescale = timescale_init(NULL, x0, q, T);
// Ignore X0 values, until we get first event
timescale->status.initialized = 0;
timescale_skew = 1.0f;
#endif
}
void dwm1000_tdoa_sync_rx(TdoaContext *tdoaContext)
{
#ifdef TIMESCALE_PROCESSING_ENABLED
int16_t nT = (int16_t)(tdoaContext->curr_seq_number - tdoaContext->prev_seq_number);
nT = (nT < 0) ? 0x100+nT : nT;
timescale_states_t *states = (timescale_states_t *)(timescale->eke->x);
if(timescale->status.initialized == 0)
{
states->time = tdoaContext->curr_sync_rx_ts;
states->skew = ((double) ((uint64_t)1 << 16) / 1e-6l);
timescale->status.initialized = 1;
}
else
{
// Period in sec
double T = 1e-6l * SYNC_PERIOD * UUS_TO_DWT_TIME * nT;
timescale->status.valid = timescale_main(timescale, tdoaContext->curr_sync_rx_ts, q, r, T).valid;
}
timescale_skew = states->skew * (1e-6l/((uint64_t)1 << 16));
uint64_t interval = (uint64_t)((uint64_t)(tdoaContext->curr_sync_rx_ts) - (uint64_t)(tdoaContext->prev_sync_rx_ts)) & 0xFFFFFFFFFULL;
timescale_skew = (double) interval / (double)(nT * ((uint64_t)SYNC_PERIOD * ((uint64_t)1 <<16)));
#endif
}
Hi everyone,
Our earlier work with freertos operating system had been. We are trying to determine the position with TDOA. The clock frequencies that should be the same were not the same. Due to this significant ppm difference between the cards, we could not perform the wireless clock synchronization process. We obtained this information with the timestamp data we received. we think this is ultimately a hardware problem. I want to ask, can this problem be solved with this library?
Best Regards
Enes
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.