当前位置: 首页 > news >正文

【李群李代数】李群控制器(lie-group-controllers)介绍——控制 SO(3) 空间中的系统的比例控制器Demo...

李群控制器SO(3)测试

测试代码是一个用于控制 SO(3) 空间中的系统的比例控制器。它通过计算控制策略来使当前状态逼近期望状态。该控制器使用比例增益 kp 进行参数化,然后进行一系列迭代以更新系统状态,最终检查状态误差是否小于给定的阈值。这个控制器用于姿态控制等应用。以下为测试源码:

#include <catch2/catch.hpp>
#include <manif/manif.h>
#include <LieGroupControllers/ProportionalController.h>
#include <LieGroupControllers/ProportionalDerivativeController.h>
using namespace LieGroupControllers;
int main()
{manif::SO3d desiredState, state;desiredState.setRandom();state.setRandom();std::cout << "当前姿态:\n"<<state.rotation() << std::endl;std::cout << "目标姿态:\r\n"<< desiredState.rotation() << std::endl;auto feedForward = Eigen::Vector3d::Zero();// 实例化控制器ProportionalControllerSO3d controller;constexpr double kp = 10;controller.setGains(kp);//设置控制器增益controller.setDesiredState(desiredState);//设置期望状态controller.setFeedForward(feedForward);//设置前馈//测试控制器constexpr double dT = 0.01;// 时间步长 秒  控制周期0.01sconstexpr std::size_t numberOfIteration = 1e3; // 迭代次数1000for (std::size_t i = 0; i < numberOfIteration; i++){controller.setState(state);// 设置当前状态controller.computeControlLaw(); // 计算控制策略auto controlOutput = controller.getControl();// 获取控制输出//传播系统的动态 Propagate the dynamics of the system.//首先,我们获取控制输出,这在这个特定情况下是惯性坐标系中的角速度 First of all we get the control output. In this particular case is the angular velocity// expressed in the inertial frame.// 然后使用 Manifold 左加运算符 Then the Manifold left plus operator is used// state = controlOutputDT  + state 应该理解为// state_k+1 = exp(omega * dT) * state_kmanif::SO3d::Tangent controlOutputDT = controlOutput.coeffs() * dT;std::cout << "第" << i << "次控制角度增量(瞬时控制角速度*dt):" << controlOutputDT << std::endl;state = controlOutputDT + state;}std::cout << "Test Over!调节时间10秒\n";std::cout << "最终姿态:\r\n" << state.rotation() << std::endl;std::cout << "姿态误差:\r\n" << desiredState.rotation() - state.rotation() << std::endl;// 检查误差//auto error = state.compose(desiredState.inverse()).log(); // 计算误差:  最终姿态坐标系在期望姿态坐标系中的姿态矩阵表示 取log//REQUIRE(error.coeffs().norm() < 1e-4); // 检查误差是否小于阈值
}

0605cd1a4d4f544b3e576356c04790ed.png

2792fe167dee8f04038401f452a35a36.png

LIE-GROUP-CONTROLLERS  

包含专为李群设计的控制器的纯头文件 C++ 库

库背后的一些理论  

The library aims to contain some controllers designed in lie groups. The library depends only on Eigen and manif.

该库旨在包含一些以李群理论为基础设计的控制器。 该库仅依赖于 Eigen 和 manif。

All the controllers defined in lie-group-controllers have in common that they inherit from a templated base class (CRTP). It allows one to write generic code abstracting the controller details. This follows the structure of manif and Eigen.

lie-group-controllers 中定义的所有控制器都有一个共同点,即它们都继承自模板化基类 (CRTP)。它允许人们编写抽象控制器细节的通用代码。这遵循 manif 和 Eigen 的结构。

The library implements two controllers:

该库实现了两个控制器:

Proportional Controller (P controller)

比例控制器(P控制器)

Proportional Derivative Controller (PD controller)

比例微分控制器(PD控制器)

控制器具有以下形式

平凡化                      比例控制器                             比例微分控制器

ac3813215d1fc9cc00cb1a46fb8984f0.png

where X and X are elements of a Lie group.  is the group operator. ψ represents an element in the Lie algebra of the Lie group whose coordinates are expressed in .

其中 X 和 Xᵈ 是李群的元素。∘ 是群算子。ψ 表示李群李代数中的一个元素,其坐标用ℝⁿ 表示。

The controllers support all the groups defined in manif. Namely:

控制器支持 manif.h 中定义的所有群。即:

ℝ(n): Euclidean space with addition.

SO(2): rotations in the plane.

SE(2): rigid motion (rotation and translation) in the plane.

SO(3): rotations in 3D space.

SE(3): rigid motion (rotation and translation) in 3D space.

ℝ(n):带加法的欧几里得空间。

SO(2):平面内的旋转。

SE(2):平面内的刚性运动(旋转和平移)。

SO(3):3D 空间中的旋转。

SE(3):3D 空间中的刚性运动(旋转和平移)。

SE_2(3):3D 空间中的扩展位姿(旋转、平移和速度),(据我所知)由文章https://arxiv.org/pdf/1410.1465.pdf引入。注意:此处的实现与文章中的开发略有不同。

Bundle<>:允许将流形束作为单个李群进行操作。在参考论文https://arxiv.org/abs/1812.01537的第四节中称为复合流形。

其他李群可以而且将会被添加,欢迎贡献。

Please you can find further information in

请您在以下位置找到更多信息:

Modern Robotics: Mechanics, Planning, and Control,
Kevin M. Lynch and Frank C. Park,
Cambridge University Press, 2017,
ISBN 9781107156302

基本使用

The library implements proportional and proportional derivative controllers on Lie groups. What follows are two simple snippets that you can follow to build and use such controllers. For sake of simplicity, only controllers in SO(3) are shown. The very same applies to the other Lie groups

该库在李群上实现比例和比例微分控制器。 下面是两个简单的片段,您可以按照它们来构建和使用此类控制器。为了简单起见,仅示出了SO(3)中的控制器。这同样适用于其他李群

比例控制器 SO(3)   

//设置随机初始状态和零前馈 
//set random initial state and zero feedforward
// manif::SO3d是一个三维旋转矩阵类,用于表示三维空间中的旋转
manif::SO3d desiredState, state;
desiredState.setRandom();
state.setRandom();//随机设置旋转矩阵的值
Eigen::Vector3d feedForward = Eigen::Vector3d::Zero();//创建一个零向量//创建控制器 create the controller.
ProportionalControllerSO3d controller;// 一个比例控制器,用于计算控制律// 如果您想使用正确的普通控制器In case you want to use the right trivialized controller
// ProportionalControllerTplSO3d<Trivialization::Right> controller;// 一个右平凡化的比例控制器, 它与上面提到的比例控制器类似,但使用了不同的数学方法来计算控制律//设置比例增益 set the proportional gain 
const double kp = 10;
controller.setGains(kp);// 设置比例增益//设置所需的状态、前馈和状态 set the desired state, the feed-forward, and the state
controller.setDesiredState(desiredState);// 设置期望状态
controller.setFeedForward(feedForward);// 设置前馈
controller.setState(state);// 设置状态//计算控制律 compute the control law
controller.computeControlLaw();
const auto& controlOutput = controller.getControl();

比例微分控制器SO(3)  

// set random initial state and zero feedforward设置了随机的初始状态和零前馈
manif::SO3d desiredState, state;
desiredState.setRandom();
state.setRandom();
manif::SO3d::Tangent stateDerivative = Eigen::Vector3d::Zero();
manif::SO3d::Tangent desiredStateDerivative = Eigen::Vector3d::Zero();
Eigen::Vector3d feedForward = Eigen::Vector3d::Zero();// create the controller.
ProportionalDerivativeControllerSO3d controller;//一个比例微分控制器,用于计算控制律// In case you want to use the right trivialized controller
// ProportionalDerivativeControllerTplSO3dcontroller;//如果您想使用正确的普通控制器.这是一个右平凡化的比例导数控制器。它与上面提到的比例导数控制器类似,但使用了不同的数学方法来计算控制律// set the proportional and the derivative gains
//设置比例增益和微分增益
constdouble kp =10;
constdouble kd =2* std::sqrt(kp);
controller.setGains(kp, kd);// set the desired state, its derivative, the feed-forward, and the state设置所需的状态、其微分、前馈和状态
controller.setDesiredState(desiredState, desiredStateDerivative);
controller.setFeedForward(feedForward);
controller.setState(state, stateDerivative);//计算控制律 compute the control law
controller.computeControlLaw();
constauto& controlOutput = controller.getControl();//获取控制输出

依赖库  

manif  https://github.com/artivis/manif/tree/devel 

Eigen3 https://gitlab.com/libeigen/eigen/-/tree/3.4.1?ref_type=heads 

cmake

构建库  

git clone https://github.com/GiulioRomualdi/lie-group-controllers.git
cd lie-group-controllers
mkdir build && cd build
cmake ../
cmake --build .
[sudo] cmake --build . --target install

 If you want to enable tests set the BUILD_TESTING option to ON.

在您的项目中使用李群控制器  

在您的项目中使用李群控制器

lie-group-controllers 提供原生 CMake 支持,使该库可以在 CMake 项目中轻松使用。请添加到您的 CMakeLists.txt

project(foo)
find_package(LieGroupControllers REQUIRED)
add_executable(${PROJECT_NAME} src/foo.cpp)
target_link_libraries(${PROJECT_NAME}LieGroupControllers::LieGroupControllers)

manif可用操作

manif 是一个李理论库,用于针对机器人应用的状态估计。它被开发为带有 Python 3 包装器的纯标头 C++11 库。        

Available Operations  

https://github.com/artivis/manif/tree/devel

Operation

Code

Base Operation

Inverse

7b2d8d7465c56f697c12259603782c48.png

X.inverse()

Composition

38bec0880cad2f4fde2270c1a57e0125.png

X * Y                  
X.compose(Y)

Hat

9386baf0ace62c6fef678be358c4f0c6.png

w.hat()

Act on vector

b7b5c94b6c9cf516a4c929eb21e5eaa4.png

X.act(v)

Retract to group element

5d3554c4ad5fccf7a3b760293a11c620.png

w.exp()

Lift to tangent space

e143d7704c7b36e40d51d512f2f0c4bc.png

X.log()

Manifold Adjoint

7020866e7cfc25590682d7371667ed6c.png

X.adj()

Tangent adjoint

8076bd99f55f300ad49238d34fc95eba.png

w.smallAdj()

Composed Operation

Manifold right plus

4c979af5bb9f20a2fd66a20eba5054d0.png

X + w                  
X.plus(w)                  
X.rplus(w)

Manifold left plus

fb05b91f1e3cc62ca6508e39c06795a1.png

w + X                  
w.plus(X)                  
w.lplus(X)

Manifold right minus

110e4c0634bc0c6c3e02231cd71175d6.png

X - Y                  
X.minus(Y)                  
X.rminus(Y)

Manifold left minus

518bdbdb43057bf09c376e25aa6084f3.png

X.lminus(Y)

Between

3737a0e002e8dee137fdbdff7e40536d.png

X.between(Y)

Inner Product

50ce559da178943bb1cdecf1a2d5e63d.png

w.inner(t)

Norm

a31f2fec875817d021e9b4e9405e7326.png

w.weightedNorm()                  
w.squaredWeightedNorm()

e33fd604c9a8d3071907e5f14a2aef32.png

参考网址:
https://github.com/ami-iit/lie-group-controllers  李群控制器源网址

https://www.youtube.com/watch?v=nHOcoIyJj2o&ab_channel=InstitutdeRob%C3%B2ticaiInform%C3%A0ticaIndustrial%2CCSIC-UPC  (视频)机器人专家的李理论Lie theory for the roboticist

https://arxiv.org/abs/1812.01537  机器人状态估计的微观李理论

相关文章:

【李群李代数】李群控制器(lie-group-controllers)介绍——控制 SO(3) 空间中的系统的比例控制器Demo...

李群控制器SO(3)测试 测试代码是一个用于控制 SO(3) 空间中的系统的比例控制器。它通过计算控制策略来使当前状态逼近期望状态。该控制器使用比例增益 kp 进行参数化&#xff0c;然后进行一系列迭代以更新系统状态&#xff0c;最终检查状态误差是否小于给定的阈值。这个控制器用…...

DP读书:鲲鹏处理器 架构与编程(六)PCI Express 总线

处理器与服务器&#xff1a;PCI Express 总线 PCI Express 总线1. PCI Express 总线的特点a. 高速差分传输b. 串行传输c. 全双工端到端连接d. 基于多通道的数据传输方式e. 基于数据包的传输 2. PCI Express 总线的组成与拓扑结构a. 根复合体b. PCI Express桥c. 功能单元 3. PCI…...

Pyqt5-开源工具分解功能(文本拖拽)

开源第四篇:功能实现之拖拽功能与配置文件。 写这个功能的初衷,是因为,每次调试我都要手动敲命令,太麻烦了,想偷个懒,所以直接给这功能加上了,顺便衍生出了另一个想法,配置文件自动填写相关数据。 先看个简单的拖拽功能: 很明显吧,还是比较便捷的。所以我们本章,就在…...

Java版B/S架构 智慧工地源码,PC、移动、数据可视化智慧大屏端源码

智慧工地是什么&#xff1f;智慧工地主要围绕绿色施工、安全管控、劳务管理、智能管理、集成总控等方面&#xff0c;帮助工地解决运营、管理方面各个难点痛点。在互联网的加持下促进项目现场管理的创新与发展&#xff0c;实现工程管理人员与工程施工现场的整合&#xff0c;构建…...

无涯教程-PHP - Session选项

从PHP7 起&#xff0c; session_start()()函数接受一系列选项&#xff0c;以覆盖在 php.ini 中设置的会话配置指令。这些选项支持 session.lazy_write &#xff0c;默认情况下此函数为on&#xff0c;如果会话数据已更改&#xff0c;则会导致PHP覆盖任何会话文件。 添加的另一个…...

The Age of Data and AI: Challenges and Opportunities

Simply put Abstract: This paper examines the impact of the “Age of Data” on the field of artificial intelligence (AI). With the proliferation of digital technologies and advancements in data collection, storage, and processing, organizations now have ac…...

WPF 项目中 MVVM模式 的简单例子说明

一、概述 MVVM 是 Model view viewModel 的简写。MVVM模式有助于将应用程序的业务和表示逻辑与用户界面清晰分离。 几个概念的说明&#xff1a; model :数据&#xff0c;界面中需要的数据&#xff0c;最好不要加逻辑代码view : 视图就是用户看到的UI结构 xaml 文件viewModel …...

基于nginx禁用访问ip

一、背景 网络安全防护时&#xff0c;禁用部分访问ip,基于nginx可快速简单实现禁用。 二、操作 1、创建 conf.d文件夹 在nginx conf 目录下创建conf.d文件夹 Nginx 扩展配置文件一般在conf.d mkdir conf.d 2、新建blocksip.conf文件 在conf.d目录新建禁用ip的扩展配置文…...

【第三阶段】kotlin语言的内置函数let

1.使用普通方法对集合的第一个元素相加 fun main() {//使用普通方法对集合的第一个元素相加var list listOf(1,2,3,4,5)var value1list.first()var resultvalue1value1println(result) }执行结果 2.使用let内置函数对集合的第一个元素相加 package Stage3fun main() {//使用…...

【C++入门到精通】C++入门 —— 模版(template)

阅读导航 前言一、模版的概念二、函数模版1. 函数模板概念2. 函数模板定义格式3. 函数模板的原理4. 函数模版的实例化&#x1f6a9;隐式实例化&#x1f6a9;显式实例化 5. 函数模板的匹配原则 三、类模板1. 类模板的定义格式2. 类模板的实例化 四、非类型模板参数1. 概念2. 定义…...

ARM汇编【3】:LOAD/STORE MULTIPLE PUSH AND POP

LOAD/STORE MULTIPLE 有时一次加载&#xff08;或存储&#xff09;多个值更有效。为此&#xff0c;我们使用LDM&#xff08;加载多个&#xff09;和STM&#xff08;存储多个&#xff09;。这些指令有一些变化&#xff0c;基本上只在访问初始地址的方式上有所不同。这是…...

Python之Qt输出UI

安装PySide2 输入pip install PySide2安装Qt for Python&#xff0c;如果安装过慢需要翻墙&#xff0c;则可以使用国内清华镜像下载&#xff0c;输入命令pip install --user -i https://pypi.tuna.tsinghua.edu.cn/simple PySide2&#xff0c;如下图&#xff0c; 示例Demo i…...

【1day】复现泛微OA某版本SQL注入漏洞

目录 一、漏洞描述 二、影响版本 三、资产测绘 四、漏洞复现 一、漏洞描述 泛微e-cology是一款由泛微网络科技开发的协同管理平台,支持人力资源、财务、行政等多功能管理和移动办公。泛微OA存在SQL注入漏洞,攻击者利用Web应用程序对用户输入验证上的疏忽,在输入的数据…...

安卓系列机型-禁止卸载某个APP 防止误卸载软件 无需root权限

安卓系列机型-禁止安装某软件 防止“沉迷游戏的小孩”操作解析_安卓机器的博客-CSDN博客 上一期讲了如何禁止安装某个app。今天讲下如何禁止卸载某app。正好相反的操作。任何操作有利有弊。主要看使用者如何对待使用。 &#x1f494;&#x1f494;&#x1f494;以腾讯的一款游…...

【算法系列篇】二分查找——这还是你所知道的二分查找算法吗?

文章目录 前言什么是二分查找算法1.二分查找1.1 题目要求1.2 做题思路1.3 Java代码实现 2.在排序数组中查找元素的第一个和最后一个位置2.1 题目要求2.2 做题思路2.3 Java代码实现 3.搜索插入位置3.1 题目要求3.2 做题思路3.3 Java代码实现 4.x的平方根4.1 题目要求4.2 做题思路…...

【前端从0开始】JavaSript——分支流程控制

流程控制 在任何一门程序设计语言中&#xff0c;都需要支持满足程序结构 化所需要的三种流程控制: ●顺序控制 ●分支控制&#xff08;条件控制&#xff09; ●循环控制 顺序控制&#xff1a;在程序流程控制中&#xff0c;最基本的就是顺序控制。程序会按照自上而下的顺序执行…...

Linux权限

Linux中一切皆文件&#xff0c;那么文件就应该有相对于的类型&#xff0c;而在Linux当中&#xff0c;类型不是直接看后缀来决定的。 -普通文件、文本、可执行、归档文件等d目录b块设备、block、磁盘c字符设备、键盘、显示器p管道文件s网络socket文件l链接文件 link 然后后面的九…...

PMP如何备考?学习方式这里有

预习阶段&#xff1a;强烈建议跟着习课视频学习&#xff08;自己看书真的很难看懂&#xff09;&#xff0c;初步了解PMBOK&#xff0c;有个大致印象&#xff1b; 精讲阶段&#xff1a;这个时候就需要静下心来深入了解各个知识模块&#xff0c;不仅是看PMBOK&#xff0c;还要尽…...

【Java转Go】快速上手学习笔记(四)之基础篇三

目录 泛型内置泛型的使用切片泛型和泛型函数map泛型泛型约束泛型完整代码 接口反射协程特点WaitGroupgoroutine的调度模型&#xff1a;MPG模型 channel介绍语法&#xff1a;举例&#xff1a;channel遍历基本使用和协程一起使用案例一案例二 select...casemain.go 完整代码 文件…...

vue中form和table标签过长

form标签过长 效果&#xff1a; 代码&#xff1a; <el-form-item v-for"(item,index) in ticketEditTable1" :label"item.fieldNameCn" :propitem.fieldName :key"item.fieldNameCn" overflow"":rules"form[item.fieldName…...

8k长序列建模,蛋白质语言模型Prot42仅利用目标蛋白序列即可生成高亲和力结合剂

蛋白质结合剂&#xff08;如抗体、抑制肽&#xff09;在疾病诊断、成像分析及靶向药物递送等关键场景中发挥着不可替代的作用。传统上&#xff0c;高特异性蛋白质结合剂的开发高度依赖噬菌体展示、定向进化等实验技术&#xff0c;但这类方法普遍面临资源消耗巨大、研发周期冗长…...

1688商品列表API与其他数据源的对接思路

将1688商品列表API与其他数据源对接时&#xff0c;需结合业务场景设计数据流转链路&#xff0c;重点关注数据格式兼容性、接口调用频率控制及数据一致性维护。以下是具体对接思路及关键技术点&#xff1a; 一、核心对接场景与目标 商品数据同步 场景&#xff1a;将1688商品信息…...

MODBUS TCP转CANopen 技术赋能高效协同作业

在现代工业自动化领域&#xff0c;MODBUS TCP和CANopen两种通讯协议因其稳定性和高效性被广泛应用于各种设备和系统中。而随着科技的不断进步&#xff0c;这两种通讯协议也正在被逐步融合&#xff0c;形成了一种新型的通讯方式——开疆智能MODBUS TCP转CANopen网关KJ-TCPC-CANP…...

【android bluetooth 框架分析 04】【bt-framework 层详解 1】【BluetoothProperties介绍】

1. BluetoothProperties介绍 libsysprop/srcs/android/sysprop/BluetoothProperties.sysprop BluetoothProperties.sysprop 是 Android AOSP 中的一种 系统属性定义文件&#xff08;System Property Definition File&#xff09;&#xff0c;用于声明和管理 Bluetooth 模块相…...

Linux-07 ubuntu 的 chrome 启动不了

文章目录 问题原因解决步骤一、卸载旧版chrome二、重新安装chorme三、启动不了&#xff0c;报错如下四、启动不了&#xff0c;解决如下 总结 问题原因 在应用中可以看到chrome&#xff0c;但是打不开(说明&#xff1a;原来的ubuntu系统出问题了&#xff0c;这个是备用的硬盘&a…...

MySQL中【正则表达式】用法

MySQL 中正则表达式通过 REGEXP 或 RLIKE 操作符实现&#xff08;两者等价&#xff09;&#xff0c;用于在 WHERE 子句中进行复杂的字符串模式匹配。以下是核心用法和示例&#xff1a; 一、基础语法 SELECT column_name FROM table_name WHERE column_name REGEXP pattern; …...

大学生职业发展与就业创业指导教学评价

这里是引用 作为软工2203/2204班的学生&#xff0c;我们非常感谢您在《大学生职业发展与就业创业指导》课程中的悉心教导。这门课程对我们即将面临实习和就业的工科学生来说至关重要&#xff0c;而您认真负责的教学态度&#xff0c;让课程的每一部分都充满了实用价值。 尤其让我…...

Linux离线(zip方式)安装docker

目录 基础信息操作系统信息docker信息 安装实例安装步骤示例 遇到的问题问题1&#xff1a;修改默认工作路径启动失败问题2 找不到对应组 基础信息 操作系统信息 OS版本&#xff1a;CentOS 7 64位 内核版本&#xff1a;3.10.0 相关命令&#xff1a; uname -rcat /etc/os-rele…...

从面试角度回答Android中ContentProvider启动原理

Android中ContentProvider原理的面试角度解析&#xff0c;分为​​已启动​​和​​未启动​​两种场景&#xff1a; 一、ContentProvider已启动的情况 1. ​​核心流程​​ ​​触发条件​​&#xff1a;当其他组件&#xff08;如Activity、Service&#xff09;通过ContentR…...

Cilium动手实验室: 精通之旅---13.Cilium LoadBalancer IPAM and L2 Service Announcement

Cilium动手实验室: 精通之旅---13.Cilium LoadBalancer IPAM and L2 Service Announcement 1. LAB环境2. L2公告策略2.1 部署Death Star2.2 访问服务2.3 部署L2公告策略2.4 服务宣告 3. 可视化 ARP 流量3.1 部署新服务3.2 准备可视化3.3 再次请求 4. 自动IPAM4.1 IPAM Pool4.2 …...