incubator-nuttx/include
Jiuzhu Dong 032a5c75a4 drivers/sensors/: Add coordinate conversion function
convert from body coordinate system to right-hand
coordinate system.

Example:
Compared to the standard coordinate system,
the x-axis and y-axis are interchanged and have opposite directions,
the z-axis remains normal.

  body coordinate   ---->     right-hand coordinate
              +x               +y
               |                |
               |                |
               |                |
               |                |
     -y<-------.                .------>+x
              /                /
             /                /
            /                /
           /                /
         +z                +z

So for the above conversion, using "P3" to represent transformation relationships
The front is 1 0 2, which represents the y x z axis.
The standard order is 0 1 2, so y and x are interchanged.

The following -1 1 1 indicates the direction of the axis.
The standard is 1 1 1. Because the current y-axis is opposite to
the standard x-axis, it is -1.

static const struct sensor_axis_map_s g_remap_tbl[] =
{
  { 0, 1, 2,  1,  1,  1 }, /* P0 */
  { 1, 0, 2,  1, -1,  1 }, /* P1 */
  { 0, 1, 2, -1, -1,  1 }, /* P2 */
  { 1, 0, 2, -1,  1,  1 }, /* P3 */
  { 0, 1, 2, -1,  1, -1 }, /* P4 */
  { 1, 0, 2, -1, -1, -1 }, /* P5 */
  { 0, 1, 2,  1, -1, -1 }, /* P6 */
  { 1, 0, 2,  1,  1, -1 }, /* P7 */
};

you can call the function sensor_remap_vector_raw16 and pass P3 parameters
to perform the conversion.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2023-09-24 11:01:08 +08:00
..
android
arpa
crypto crypto/cryptodev: expansion hash operation 2023-09-24 03:49:33 +08:00
cxx
net net/if.h: add definitions associated with IF_OPER_ 2023-07-08 10:59:37 -03:00
netinet libc/net: compatible with Android for htonq/ntohq 2023-08-02 22:47:29 -07:00
netpacket Fix nuttx coding style 2023-07-11 23:32:17 +08:00
nuttx drivers/sensors/: Add coordinate conversion function 2023-09-24 11:01:08 +08:00
ssp
sys tls: Move task_tls_alloc and task_tls_destruct to libc 2023-08-28 11:02:18 +03:00
.gitignore libs/libc/gpsutils/minmea: move minmea library from apps/gpsutils 2023-08-01 23:09:46 -07:00
aio.h aio: change aio_fildes int type 2023-09-08 00:59:31 +03:00
alloca.h libs/alloca: add alloca implement for MSVC 2023-08-28 11:10:08 -03:00
assert.h assert: add panic notifier data for notify more information 2023-08-03 03:17:22 -07:00
byteswap.h
ctype.h libs/ctype/toupper_l: Implement function toupper_l instead of macro 2023-08-22 00:07:16 +08:00
debug.h debug: add support for IPC (interprocessor communication) debug messages 2023-09-22 00:02:51 +08:00
dirent.h
dlfcn.h
dsp.h
dspb16.h
elf.h Fix and improve dynamic loader 2023-07-13 10:11:58 +08:00
elf32.h Fix and improve dynamic loader 2023-07-13 10:11:58 +08:00
elf64.h Fix loading of ET_DYN type of shared objects 2023-09-20 09:35:28 -04:00
endian.h
err.h
errno.h Fix nuttx coding style 2023-07-11 23:32:17 +08:00
execinfo.h sched_backtrace: define sched_dumpstack when not enable SCHED_BACKTRACE 2023-07-31 05:46:37 -07:00
fcntl.h include/fcntl.h: add O_NOATIME flags 2023-07-28 20:56:22 -07:00
fixedmath.h
fnmatch.h
ftw.h
getopt.h
glob.h
grp.h
hex2bin.h libs/libc/hex2bin: enhance 64-bit compatibility 2023-08-11 19:43:37 +08:00
iconv.h
ifaddrs.h ifaddrs: add union ifa_ifu include ifu_broadaddr and ifu_dstaddr 2023-07-08 15:42:11 +08:00
inttypes.h
iso646.h
langinfo.h
libgen.h
libintl.h
limits.h
locale.h
lzf.h
malloc.h libc/mallopt: implement dummy mallopt 2023-09-07 23:11:10 +08:00
mqueue.h fs/mqueue: Fix the wrong field type in mq_attr as the spec and add the logical judgment to deal with the condition when mq_maxmsg or mq_msgsize is less than zero or equal to zero. 2023-08-03 03:10:56 -07:00
netdb.h
nl_types.h
nxflat.h
obstack.h
poll.h
pthread.h libc/pthread: add pthread_attr_set/getscope 2023-07-28 20:55:22 -07:00
pty.h
pwd.h pwd: Add initial implementation of getpwent 2023-07-31 07:50:10 -07:00
regex.h
resolv.h
sched.h sched: Define sched_getcpu return 0 when CONFIG_SMP equals n 2023-08-06 11:28:49 +02:00
semaphore.h
signal.h signal: add siginterrupt implementation 2023-08-29 09:43:42 +08:00
spawn.h
stdbool.h
stddef.h
stdint.h Fix nuttx coding style 2023-07-11 23:32:17 +08:00
stdio.h libs/libc: support unlock version for fread/fwrite/fputc/fgetc/... 2023-09-06 15:08:24 +03:00
stdlib.h libc/rand_r: support rand_r api 2023-07-29 07:28:23 -07:00
stdnoreturn.h
string.h
strings.h
syscall.h
syslog.h
termios.h
threads.h
time.h include: move clockid_t and time[r]_t define to sys/types.h 2023-08-19 09:08:40 +03:00
unistd.h fs:add syncfs api for sync whole fs data 2023-09-23 15:58:00 +08:00
utime.h
uuid.h
wchar.h libs/libc/wchar: add fputws implementation 2023-09-22 08:51:07 +08:00
wctype.h