微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > 关于sensor中的sign和map,求指点

关于sensor中的sign和map,求指点

时间:10-02 整理:3721RD 点击:
/*
* @sign, map: only used in acceleROMeter/magnetic field
*      sometimes, the sensor output need to be remapped before reporting to php?mod=tag&id=6090" target="_blank" class="relatedlink">Framework.
*      the 'sign' is only -1 or +1 to align the sign for framework's coordinate system
*      the 'map'  align the value for framework's coordinate system. Take accelerometer
*      as an exmaple:
*      assume HAL receives original acceleration: acc[] = {100, 0, 100}
*      sign[] = {1, -1, 1, 0};
*      map[]  = {HWM_CODE_ACC_Y, HWM_CODE_ACC_X, HWM_CODE_ACC_Z, 0};
*      according to the above 'sign' & 'map', the sensor output need to remap as {y, -x, z}:
*      float resolution = unit_numerator*GRAVITY_EARTH/unit_denominator;
*      acc_x = sign[0]*acc[map[0]]*resolution;
*      acc_y = sign[1]*acc[map[1]]*resolution;
*      acc_z = sign[2]*acc[map[2]]*resolution;  
*/
这段注解一直看的懵懵懂懂的,求高手指点一下,这里的sign和map到底是个怎样的概念?

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top