线程安全的坐标变换缓存
更多...
#include <rmvl/lpss/transform.hpp>
线程安全的坐标变换缓存
- 坐标关系组成单父节点、无环的森林,其中,互不连通的树允许分别维护;
- 静态边保存单个变换,查询时不受时间限制,动态边按时间保存历史;
- 查询时间为零时使用整条路径上所有动态边的最新公共时间,全静态路径返回零时间;
- 动态变换使用平移线性插值和单位四元数 SLERP,不允许向缓存区间外外推。
◆ Buffer() [1/3]
| rm::lpss::tf::Buffer::Buffer |
( |
std::chrono::nanoseconds | cache_duration = std::chrono::seconds(10) | ) |
|
|
explicit |
构造坐标变换缓存,默认保留最近 10 秒的动态历史
◆ Buffer() [2/3]
| rm::lpss::tf::Buffer::Buffer |
( |
Buffer && | | ) |
|
|
noexcept |
◆ ~Buffer()
| rm::lpss::tf::Buffer::~Buffer |
( |
| ) |
|
◆ Buffer() [3/3]
| rm::lpss::tf::Buffer::Buffer |
( |
const Buffer & | | ) |
|
|
delete |
◆ cacheDuration()
| std::chrono::nanoseconds rm::lpss::tf::Buffer::cacheDuration |
( |
| ) |
const |
|
noexcept |
◆ can()
| bool rm::lpss::tf::Buffer::can |
( |
std::string_view | target_frame, |
|
|
std::string_view | source_frame, |
|
|
const msg::Time & | time = {} ) const |
◆ clear()
| void rm::lpss::tf::Buffer::clear |
( |
| ) |
|
|
noexcept |
◆ lookup()
| LookupResult rm::lpss::tf::Buffer::lookup |
( |
std::string_view | target_frame, |
|
|
std::string_view | source_frame, |
|
|
const msg::Time & | time = {} ) const |
查询 source 坐标系到 target 坐标系的变换
- 参数
-
| [in] | target_frame | 目标坐标系 |
| [in] | source_frame | 源坐标系 |
| [in] | time | 查询时间;零时间表示最新公共时间 |
- 返回
- 查询结果,成功时得到 \(T_{target,source}\)
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ set() [1/2]
批量插入动态坐标变换
- 返回
- 首个失败状态;所有变换都会尝试插入
◆ set() [2/2]
插入一条坐标变换
- 参数
-
| [in] | transform | 父子坐标变换,方向为 \(T_{parent,child}\) |
- 返回
- 插入状态;同一时间的动态样本会被新值替换
◆ setCacheDuration()
| void rm::lpss::tf::Buffer::setCacheDuration |
( |
std::chrono::nanoseconds | cache_duration | ) |
|
|
noexcept |
设置动态历史缓存时长;负值按零处理,并立即裁剪现有历史
◆ setStatic() [1/2]
| Status rm::lpss::tf::Buffer::setStatic |
( |
const msg::TF & | transforms | ) |
|
批量插入静态坐标变换
- 返回
- 首个失败状态;所有变换都会尝试插入
◆ setStatic() [2/2]
◆ size()
| std::size_t rm::lpss::tf::Buffer::size |
( |
| ) |
const |
|
noexcept |