ros2 机器人imu传感器 加速度计 陀螺仪精度和数据填充单位换算 |
您所在的位置:网站首页 › 单位换算nm和m › ros2 机器人imu传感器 加速度计 陀螺仪精度和数据填充单位换算 |
起因,imu解算出了加速度 角速度,但原始数据是没有单位的,只是在一个精度范围的值,要使用这些数据,就需要把这些没有单位的数据换算成带单位的数据,下面解说一下换算原理。 imu读取数据代码参考上期的博客: ros2 c++实现JY_95T IMU解算三轴 加速度 角速度 欧拉角 磁力计 四元数_JT_BOT的博客-CSDN博客 单位转换依据imu使用说明 ros2 ium数据填充要求:加速度单位:m/s^2 角速度: rad/sec 四元数没有单位 ros2 interface show sensor_msgs/msg/Imu # This is a message to hold data from an IMU (Inertial Measurement Unit) # # Accelerations should be in m/s^2 (not in g's), and rotational velocity should be in rad/sec #加速度应以m/s ^2为单位(而不是以g's为单位),旋转速度应以rad/sec为单位 # # If the covariance of the measurement is known, it should be filled in (if all you know is the # variance of each measurement, e.g. from the datasheet, just put those along the diagonal) # A covariance matrix of all zeros will be interpreted as "covariance unknown", and to use the # data a covariance will have to be assumed or gotten from some other source # # If you have no estimate for one of the data elements (e.g. your IMU doesn't produce an # orientation estimate), please set element 0 of the associated covariance matrix to -1 # If you are interpreting this message, please check for a value of -1 in the first element of each # covariance matrix, and disregard the associated estimate. std_msgs/Header header geometry_msgs/Quaternion orientation float64[9] orientation_covariance # Row major about x, y, z axes geometry_msgs/Vector3 angular_velocity float64[9] angular_velocity_covariance # Row major about x, y, z axes geometry_msgs/Vector3 linear_acceleration float64[9] linear_acceleration_covariance # Row major x, y z先拿加速度做示范,加速度的默认测量范围是-16G—+16G,G就是gravity,是重力加速度9.8m/s²,数据存储在2个字节一共16位2进制数据,扣除第一位符号位,2的15次方数据范围是-7FFF-7FFF (-32767~32767) 所以在解算出加速度的原始数据要 acc/2048*9.8单位才是m/s^2,imu c++完整代码看上期博客。 加速度解算代码: // 加速度 acc_x = ((double)((short)(data[index + 5] |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |