Add the option to define a custom user motion size
This commit is contained in:
parent
25f88d48ae
commit
4b16857401
3
.gitignore
vendored
3
.gitignore
vendored
@ -41,3 +41,6 @@ gps-sdr-sim-lut
|
|||||||
|
|
||||||
# Netbeans project folder
|
# Netbeans project folder
|
||||||
nbproject/*
|
nbproject/*
|
||||||
|
|
||||||
|
# Last used USER_MOTION_SIZE variable
|
||||||
|
.user-motion-size
|
||||||
|
19
Makefile
19
Makefile
@ -6,15 +6,32 @@ all: gps-sdr-sim
|
|||||||
SHELL=/bin/bash
|
SHELL=/bin/bash
|
||||||
CC=gcc
|
CC=gcc
|
||||||
CFLAGS=-O3 -Wall -D_FILE_OFFSET_BITS=64
|
CFLAGS=-O3 -Wall -D_FILE_OFFSET_BITS=64
|
||||||
|
ifdef USER_MOTION_SIZE
|
||||||
|
CFLAGS+=-DUSER_MOTION_SIZE=$(USER_MOTION_SIZE)
|
||||||
|
endif
|
||||||
LDFLAGS=-lm
|
LDFLAGS=-lm
|
||||||
|
|
||||||
gps-sdr-sim: gpssim.o
|
gps-sdr-sim: gpssim.o
|
||||||
${CC} $< ${LDFLAGS} -o $@
|
${CC} $< ${LDFLAGS} -o $@
|
||||||
|
|
||||||
|
gpssim.o: .user-motion-size
|
||||||
|
|
||||||
|
.user-motion-size: .FORCE
|
||||||
|
@if [ -f .user-motion-size ]; then \
|
||||||
|
if [ "`cat .user-motion-size`" != "$(USER_MOTION_SIZE)" ]; then \
|
||||||
|
echo "Updating .user-motion-size"; \
|
||||||
|
echo "$(USER_MOTION_SIZE)" >| .user-motion-size; \
|
||||||
|
fi; \
|
||||||
|
else \
|
||||||
|
echo "$(USER_MOTION_SIZE)" > .user-motion-size; \
|
||||||
|
fi;
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f gpssim.o gps-sdr-sim *.bin
|
rm -f gpssim.o gps-sdr-sim *.bin .user-motion-size
|
||||||
|
|
||||||
time: gps-sdr-sim
|
time: gps-sdr-sim
|
||||||
time ./gps-sdr-sim -e brdc3540.14n -u circle.csv -b 1
|
time ./gps-sdr-sim -e brdc3540.14n -u circle.csv -b 1
|
||||||
time ./gps-sdr-sim -e brdc3540.14n -u circle.csv -b 8
|
time ./gps-sdr-sim -e brdc3540.14n -u circle.csv -b 8
|
||||||
time ./gps-sdr-sim -e brdc3540.14n -u circle.csv -b 16
|
time ./gps-sdr-sim -e brdc3540.14n -u circle.csv -b 16
|
||||||
|
|
||||||
|
.FORCE:
|
||||||
|
16
README.md
16
README.md
@ -18,6 +18,22 @@ to RF using software-defined radio (SDR) platforms, such as
|
|||||||
$ gcc gpssim.c -lm -O3 -o gps-sdr-sim
|
$ gcc gpssim.c -lm -O3 -o gps-sdr-sim
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Using bigger user motion files
|
||||||
|
|
||||||
|
In order to use user motion files with more than 30000 samples (at 10Hz), the `USER_MOTION_SIZE`
|
||||||
|
variable can be set to the maximum time of the user motion file in seconds. It is advisable to do
|
||||||
|
this using make so gps-sdr-bin can update the size when needed. e.g:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ make USER_MOTION_SIZE=4000
|
||||||
|
```
|
||||||
|
|
||||||
|
This variable can also be set when compiling directly with GCC:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ gcc gpssim.c -lm -O3 -o gps-sdr-sim -DUSER_MOTION_SIZE=4000
|
||||||
|
```
|
||||||
|
|
||||||
### Generating the GPS signal file
|
### Generating the GPS signal file
|
||||||
|
|
||||||
A user-defined trajectory can be specified in either a CSV file, which contains
|
A user-defined trajectory can be specified in either a CSV file, which contains
|
||||||
|
2
gpssim.h
2
gpssim.h
@ -16,7 +16,9 @@
|
|||||||
#define MAX_CHAN (16)
|
#define MAX_CHAN (16)
|
||||||
|
|
||||||
/*! \brief Maximum number of user motion points */
|
/*! \brief Maximum number of user motion points */
|
||||||
|
#ifndef USER_MOTION_SIZE
|
||||||
#define USER_MOTION_SIZE (3000) // max duration at 10Hz
|
#define USER_MOTION_SIZE (3000) // max duration at 10Hz
|
||||||
|
#endif
|
||||||
|
|
||||||
/*! \brief Maximum duration for static mode*/
|
/*! \brief Maximum duration for static mode*/
|
||||||
#define STATIC_MAX_DURATION (86400) // second
|
#define STATIC_MAX_DURATION (86400) // second
|
||||||
|
Loading…
Reference in New Issue
Block a user