mirror of
https://github.com/apache/nuttx.git
synced 2026-10-17 11:08:57 +00:00
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>
|
||
|---|---|---|
| .. | ||
| 1wire | ||
| analog | ||
| audio | ||
| binfmt | ||
| can | ||
| clk | ||
| contactless | ||
| crypto | ||
| dma | ||
| drivers | ||
| eeprom | ||
| efuse | ||
| fs | ||
| himem | ||
| hwspinlock | ||
| i2c | ||
| input | ||
| ioexpander | ||
| lcd | ||
| leds | ||
| lib | ||
| math | ||
| mbox | ||
| mm | ||
| modem | ||
| motor | ||
| mtd | ||
| net | ||
| note | ||
| nx | ||
| power | ||
| rc | ||
| reset | ||
| rf | ||
| rptun | ||
| segger | ||
| sensors | ||
| serial | ||
| spi | ||
| syslog | ||
| timers | ||
| usb | ||
| usrsock | ||
| video | ||
| virtio | ||
| wireless | ||
| .gitignore | ||
| addrenv.h | ||
| allsyms.h | ||
| arch.h | ||
| ascii.h | ||
| atexit.h | ||
| bits.h | ||
| board.h | ||
| cache.h | ||
| can.h | ||
| cancelpt.h | ||
| clock.h | ||
| compiler.h | ||
| crc8.h | ||
| crc16.h | ||
| crc32.h | ||
| crc64.h | ||
| elf.h | ||
| environ.h | ||
| envpath.h | ||
| fdcheck.h | ||
| fdt.h | ||
| gdbstub.h | ||
| hashtable.h | ||
| init.h | ||
| ipcc.h | ||
| irq.h | ||
| kmalloc.h | ||
| kthread.h | ||
| lirc.h | ||
| list.h | ||
| mmcsd.h | ||
| module.h | ||
| mqueue.h | ||
| mutex.h | ||
| notifier.h | ||
| nuttx.h | ||
| page.h | ||
| panic_notifier.h | ||
| pgalloc.h | ||
| progmem.h | ||
| pthread.h | ||
| queue.h | ||
| random.h | ||
| reboot_notifier.h | ||
| sched.h | ||
| sched_note.h | ||
| scsi.h | ||
| sdio.h | ||
| sdio_slave.h | ||
| semaphore.h | ||
| signal.h | ||
| spawn.h | ||
| spinlock.h | ||
| streams.h | ||
| symtab.h | ||
| tls.h | ||
| trace.h | ||
| userspace.h | ||
| vt100.h | ||
| wdog.h | ||
| wqueue.h | ||
| zoneinfo.h | ||