当前位置:网站首页>IMU learning records
IMU learning records
2022-06-12 15:01:00 【From spring to winter】
IMU A record of learning
List of articles
One 、IMU Brief introduction
1.IMU principle
When we get home at night , When the power failure is found at home , When the eyes can't see anything in the dark , Only based on your own experience , Take small steps with extreme caution , And keep touching things around with your hands ( For example, refrigerator. ), To determine where you are .
IMU The principle of is very similar to taking small steps in the dark . In the dark , Because of the error between the estimation of the step size and the actual distance , When you take more and more steps , The difference between the estimated position and the actual position will be farther and farther . As shown in the figure below :

When taking the first step , estimated position ( Where blacks are ) And the actual location ( Where the white man is ) It is quite close to ; But as the number of steps increases , The difference between the estimated position and the actual position is becoming larger and larger . The little man in the picture only moves in one direction , It's one-dimensional . According to this method, it is extended to three-dimensional , Is the principle of the inertial measurement unit .
Academic language is : Based on Newton's laws of Mechanics , By measuring the acceleration of the carrier in the inertial reference system , Integrate it with time , And transform it into the navigation coordinate system , You can get the speed in the navigation coordinate system 、 Information such as yaw angle and position .
2.GPS+IMU
In driverless systems ,GPS The update frequency of is generally 10Hz,IMU The update frequency of is generally 100Hz.
When two sensors work together , The frequency can be given 100Hz Positioning output of . The following figure is the schematic diagram of two sensor data fusion :
The information processing flow of the software running on the controller is similar to the following figure in terms of time dimension . stay 0~100ms In the cycle of , Use IMU Conduct 9 Estimation of secondary position , Wait for the new GPS When positioning data comes in , Then make corrections , In this way, high-frequency positioning result output can be realized .

Two 、IMU information acquisition
1.xsense_driver

Tips
[ERROR] [1551165884.109790]: Fatal: could not find proper MT device
Run the command :
sudo chmod 777 /dev/ttyUSB0 // Assign permissions to the serial port ,USB Transfer to serial port authorization command
Really not line USB Plug and unplug the port several times , At least that's what I did .
2.rostopic list

3.rostopic


imu data type :
The message header / Four yuan number / Quaternion residual / angular velocity / Angular velocity residual / Linear velocity / Linear velocity residual
4. Quaternion to Euler angle
imu There is no Euler angle in the output information , For the convenience of observation, I wrote one end of the code , Quaternion to Euler angle .
Can be used directly ROS Function of quaternion to Euler angle in
The code is as follows :
#include "ros/ros.h"
#include "geometry_msgs/Vector3.h"
#include "sensor_msgs/Imu.h"
#include "geometry_msgs/Quaternion.h"
#include "tf/transform_datatypes.h"
ros::Publisher rpy_publisher;
ros::Subscriber quat_subscriber;
void MsgCallback(const sensor_msgs::Imu msg)
{
tf::Quaternion quat;
quat = tf::Quaternion(msg.orientation.x,msg.orientation.y,msg.orientation.z,msg.orientation.w);
// the tf::Quaternion has a method to acess roll pitch and yaw
double roll, pitch, yaw;
tf::Matrix3x3(quat).getRPY(roll, pitch, yaw);
// the found angles are written in a geometry_msgs::Vector3
geometry_msgs::Vector3 rpy;
rpy.x = roll;
rpy.y = pitch;
rpy.z = yaw;
// this Vector is then published:
rpy_publisher.publish(rpy);
ROS_INFO("published rpy angles: roll=%f pitch=%f yaw=%f", rpy.x, rpy.y, rpy.z);
}
int main(int argc, char **argv)
{
ros::init(argc, argv, "talker");
ros::NodeHandle n;
rpy_publisher = n.advertise<geometry_msgs::Vector3>("rpy_angles", 1000);
quat_subscriber = n.subscribe("/imu/data", 1000, MsgCallback);
ROS_INFO("waiting for quaternion");
ros::spin();
return 0;
}
The Euler angle data are as follows :

4. function rqt
Because of the rotation on the plane , So only around Z Axis data changes , The other two axes are zero .

5. function rviz
Need to load :rviz_imu_plugin
This is a display sensor_msgs::Imu News rviz plug-in unit
adopt rviz You can display the pose at this time , But the change of displacement cannot be observed 
summary
This is the first blog , The learning process may also need a lot of summary , In the future, this will be a place to summarize !
边栏推荐
- [wechat applet] 6.1 applet configuration file
- ADSL
- [system. Currenttimemillis()] current timestamp: the number of milliseconds that have elapsed since the current system time was 0:00:00 on January 1, 1970
- Apprendre est une chose contre la nature humaine
- [LDA] LDA theme model notes - mainly Dirichlet
- ROS 中 boost::bind( ) 的使用
- Installation and use of mat
- PHPstudy建站提示hosts文件可能不存在或被阻止打开,同步hosts失败怎么解决
- Solution to the new database prompt on the pagoda panel that the database name cannot be greater than 16 bits
- Pta: self test -2 prime pair conjecture (20 points)
猜你喜欢

Assertion of selenium webdriver

IMU的学习记录

webdriver入门

ngork实现内网穿透--免费

Dataset and dataframe in sparksql

三维重建系统 | L3双视角运动恢复结构(SFM双目SFM)

Writing method of JUnit multithreading

JUnit test suite method sorting (method 2 is not easy to use)

Xshell 7 official website free download

Pta: self test -2 prime pair conjecture (20 points)
随机推荐
Swap numbers, XOR, operator correlation
FIRSTVT和LASTVT白话版
Dataset and dataframe in sparksql
宝塔面板新建数据库提示数据库名不能大于16位的解决方法
How to add WWW to the domain name
数组相关内容
[lambda operation jcf]
Jetpack architecture component learning (3) -- activity results API usage
C operator
ADSL
PTA:自测-3 数组元素循环右移问题 (20分)
C escape character
Alibaba, Tencent and pinduoduo set an example, and the new logic of industrial Internet is gradually emerging
MH32F103ARPT6软硬件兼容替代STM32F103RCT6
Qiming cloud sharing | demonstrate the switch through an example of the matter protocol to control the light on and off through the matter protocol
C main函数
Pointer related concepts
阿里、腾讯、拼多多垂范,产业互联网的新逻辑渐显
JUnit exception, a method that asserts that the exception information is not empty
Tensorrt based in-depth learning model deployment practice tutorial!