ChassisController(global)chassischassis::Posturechassis::Velocitychassis::controllerchassis::controller::IChassisControllerchassis::locchassis::loc::IChassisLocchassis::motionchassis::motion::IChassisMotionapiapi
文档稀疏- 符号
- 69
- 已记录
- 49
- 类型
- 5
- 继承关系
- 0
- 源码分支
main
20 / 69 个公开 API 符号没有说明。
共 5 个类型
类型目录
底盘位姿。
x/y 所处的世界坐标系由具体定位后端决定,但单位和旋向约定在整个模块内保持一致。
底盘速度。
x 轴指向车头前方 y 轴指向车体左侧 z 轴向上,逆时针旋转为正 这里约定的是“车体坐标系常用正方向”:
业务层直接持有的控制器基类。
Motion 负责真正把速度命令下发到轮组 Loc 负责反馈底盘当前状态 Controller 基类负责控制权申请/释放,保证同一时刻只有一个控制器真正驱动底盘 Controller 同时依赖 Motion 和 Loc: 基类保留 acquireControl / releaseControl / enable / disable / stop 这些最基本控制语义, 其他控制能力由子类扩展。 不同 Controller 也可能拆出多个独立更新入口,因此基类不统一要求单一 update()。
构造与析构
2
chassis::controller::IChassisController::IChassisController (motion::IChassisMotion &chassis_motion, loc::IChassisLoc &chassis_loc)
Controller 在构造时就必须绑定现成的 Motion 和 Loc。
Core/IChassisController.hpp:117~IChassisController
函数公开虚函数
virtual chassis::controller::IChassisController::~IChassisController ()
上游未提供说明。
Core/IChassisController.hpp:27定位层基类。
世界系位姿 车体系速度 世界系速度 它对外统一暴露: 同时封装了一组常用坐标变换,避免每个控制器或业务模块都重复写一遍旋转公式。 在接入层里,某些 Loc 后端可能要等到校准完成或首次外部结果到达后才真正构造, 因此业务代码里常会把 Loc 指针先置空,并在周期调用前先检查是否已经构造完成。 update(dt) update() updateLidar(...) 注意:本基类同样不统一规定 update() 形式。不同 Loc 后端可能需要、、等不同入口,具体调用方式由 接入方根据具体实现自行安排。
成员函数
12BodyPosture2WorldPosture
函数公开const
Posture chassis::loc::IChassisLoc::BodyPosture2WorldPosture (const Posture &posture_in_body) const
把“相对当前车体”的位姿换算回世界系。
Core/IChassisLoc.hpp:84BodyVelocity2WorldVelocity
函数公开const
Velocity chassis::loc::IChassisLoc::BodyVelocity2WorldVelocity (const Velocity &velocity_in_body) const
使用当前朝向,把车体系速度转换为世界系速度。
Core/IChassisLoc.hpp:60CurrentPostureRelativeTo
函数公开const
Posture chassis::loc::IChassisLoc::CurrentPostureRelativeTo (const Posture &base_in_world) const
便捷函数:计算“当前位置相对于某个世界系基准位姿”的相对位姿。
Core/IChassisLoc.hpp:129RelativePosture2WorldPosture
函数公开静态
static Posture chassis::loc::IChassisLoc::RelativePosture2WorldPosture (const Posture &base_in_world, const Posture &posture_in_base)
已知某个基准位姿在世界系中的位置,把“相对基准”的位姿展开到世界系。
Core/IChassisLoc.hpp:98WorldPosture2BodyPosture
函数公开const
Posture chassis::loc::IChassisLoc::WorldPosture2BodyPosture (const Posture &posture_in_world) const
把世界系位姿换算成“以当前车体为参考”的相对位姿。
Core/IChassisLoc.hpp:66WorldPosture2RelativePosture
函数公开静态
static Posture chassis::loc::IChassisLoc::WorldPosture2RelativePosture (const Posture &base_in_world, const Posture &posture_in_world)
已知某个基准位姿在世界系中的位置,把世界系位姿改写成“相对基准”的位姿。
Core/IChassisLoc.hpp:112WorldVelocity2BodyVelocity
函数公开const
Velocity chassis::loc::IChassisLoc::WorldVelocity2BodyVelocity (const Velocity &velocity_in_world) const
使用当前朝向,把世界系速度转换为车体系速度。
Core/IChassisLoc.hpp:54forwardGetVelocity
函数受保护const
auto chassis::loc::IChassisLoc::forwardGetVelocity () const
受保护转发:读取 Motion 给出的车体系反馈速度。
Core/IChassisLoc.hpp:138postureInWorld
函数公开纯虚函数const
virtual Posture chassis::loc::IChassisLoc::postureInWorld () const =0
返回世界坐标系位姿。
Core/IChassisLoc.hpp:51
static Velocity chassis::loc::IChassisLoc::rotateVelocity (const Velocity &inp, const float theta)
二维平面旋转速度向量。角度单位仍是度,内部会转换成弧度。
Core/IChassisLoc.hpp:141velocityInBody
函数公开纯虚函数const
virtual Velocity chassis::loc::IChassisLoc::velocityInBody () const =0
返回车体坐标系速度。
Core/IChassisLoc.hpp:46velocityInWorld
函数公开纯虚函数const
virtual Velocity chassis::loc::IChassisLoc::velocityInWorld () const =0
返回世界坐标系速度。
Core/IChassisLoc.hpp:48底盘动作系统,仅负责:
把底层轮组组织成统一的“底盘速度输入 / 反馈”模型 执行正逆解算 管理底层执行器的使能状态 它不直接暴露给业务层发送速度命令;真正对外的控制入口应是 Controller。 这里的 Motion 只抽象“全向底盘平面运动”本身。若某些特殊底盘还带有升降、 伸缩等与平面运动独立的自由度,这些自由度不应直接并入本接口,而应在其他 模块中独立抽象后,再与本仓库提供的底盘运动能力组合。 注意:本基类故意不定义统一的 update() 约束。不同 Motion 实现可能需要 不同参数、不同频率、甚至不同名字的更新入口,调用者应按具体实现自行调度。
成员函数
9
virtual void chassis::motion::IChassisMotion::applyVelocity (const Velocity &velocity)=0
上游未提供说明。
Core/IChassisMotion.hpp:88currentController
函数公开const
controller::IChassisController * chassis::motion::IChassisMotion::currentController () const
当前持有该 Motion 控制权的 Controller。
Core/IChassisMotion.hpp:79
virtual void chassis::motion::IChassisMotion::disable ()=0
关闭底层执行器。
Core/IChassisMotion.hpp:39
virtual bool chassis::motion::IChassisMotion::enable ()=0
使能底层执行器,返回是否成功进入可工作状态。
Core/IChassisMotion.hpp:37
virtual bool chassis::motion::IChassisMotion::enabled () const =0
查询底层执行器是否已经处于使能状态。
Core/IChassisMotion.hpp:41forwardGetVelocity
函数公开纯虚函数
virtual Velocity chassis::motion::IChassisMotion::forwardGetVelocity ()=0
正向解算得到当前底盘在车体坐标系下的反馈速度。
Core/IChassisMotion.hpp:53
virtual bool chassis::motion::IChassisMotion::isReady () const =0
是否就位
enabled() isReady() 只表示执行器已经上电/使能;进一步表示该 Motion 已经可以被当成完整底盘使用。像舵轮校准、机构变形、自检这类过程, 都可能出现“enabled 但 not-ready”。
Core/IChassisMotion.hpp:50
virtual void chassis::motion::IChassisMotion::releaseController (controller::IChassisController *ctrl)
释放控制权;只有当前持有者自己可以释放。
Core/IChassisMotion.hpp:72tryAcquireController
函数公开虚函数
virtual bool chassis::motion::IChassisMotion::tryAcquireController (controller::IChassisController *ctrl)
尝试让某个 Controller 获取该 Motion 的控制权。
同一时刻只允许一个 Controller 真正向 Motion 下发速度命令, 用来避免多个控制器并发写目标。
Core/IChassisMotion.hpp:61