三维空间的刚体运动主要学习点如下:
2.1 点与坐标系
2.2 旋转矩阵
2.3 旋转向量与欧拉角
2.4 四元数
2.5 相似、仿射和射影变换
2.6 实践:Eigen矩阵运算
2.7 实践:Eigen几何模块
对于三维空间刚体整体知识的学习,可参考https://blog.csdn.net/weixin_38593194/article/details/85234607
详细讲述了关于刚体运动学的知识,在此就不重复引了。
本文主要补充三维空间刚体运动中的一些基础知识点,包括线性代数(工程矩阵)和c++11新特性等相关知识。
Eigen是常用的c++矩阵运算库,支持线性代数等矩阵的运算。
1、线性方程Ax=b(A为方阵),分析讨论x解的情况。
A——系数矩阵;A|b——增广矩阵;R(.)——矩阵的秩
2、高斯消元法的原理
三角分解
OR分解
满秩分解
补充:
1.Hermite 标准形:若 B∈ Cr(r>=1) 满足
⑴ B 的后m-r行元素均为零;
⑵ B 中有 r 列,设为c1,…,cr列,构成Im的前 r 个列.
称 B 为拟 Hermite 标准形.
2.置换矩阵:划分单位矩阵In=(e1,e2,…,en),称P1=(ej1,ej2,…,ej3)为置换矩阵,其中j1,j2,…,jn是1,2,…,n的一个排列.
c++11是对目前c++语言的扩展和修正,增加了许多新特性,包括:lambda表达式,类型推导关键字auto、decltype,和模板的大量改进。
1、自动类型推导
auto a; // 错误,auto是通过初始化表达式进⾏类型推导,如果没有初始化表达式,就⽆法确定a
的类型
auto i = 1;
auto d = 1.0;
auto str = "Hello World";
auto ch = 'A';
auto func = less();
vector iv;
auto ite = iv.begin();
auto p = new foo() // 对⾃定义类型进⾏类型推导
2、模板
如果不使用auto就必须声明Product这一模板参数:
template
void processProduct(const Creator& creator) {
Product* val = creator.makeObject();
// do somthing with val
}
如果使用auto,则可以这样写:
template
void processProduct(const Creator& creator) {
auto val = creator.makeObject();
// do somthing with val
}
从一个表达式或变量中得到类型。
int x = 3;
decltype(x) y = x;
把上文中加工产品的例子的产品作为返回值:
template
auto processProduct(const Creator& creator) ->
decltype(creator.makeObject()) {
auto val = creator.makeObject();
// do somthing with val
}
为了解决原来C++中NULL的二义性问题而引进的一种新的类型。
void F(int a){
cout<
map m{{"a", 1}, {"b", 2}, {"c", 3}};
for (auto p : m){
cout<
可以用于创建并定义匿名的函数对象,以简化编程
工作。Lambda的语法如下:
[函数对象参数](操作符重载函数参数)->返回值类型{函数体}
vector iv{5, 4, 3, 2, 1};
int a = 2, b = 1;
for_each(iv.begin(), iv.end(), [b](int &x){cout<<(x + b)<int{return x * (a + b);});
1、tuple 可以传入多个不同类型
auto t1 = make_tuple(1, 2.0, "C++ 11");
auto t2 = make_tuple(1, 2.0, "C++ 11", {1, 0, 2});
2、实现print
template
void Print(Head head, typename... tail) {
cout<< head <
在C++11中,可以使用以下语法来替换:
int arr[3]{1, 2, 3};
vector iv{1, 2, 3};
map{{1, "a"}, {2, "b"}};
string str{"Hello World"};