![]() |
RMVL
2.5.0-dev
Robotic Manipulation and Vision Library
|
机器人规划模块,提供 URDF 解析、正/逆运动学求解、轨迹规划等运动学功能 更多...
#include <rmvl/lpss/robot.hpp>
Public 成员函数 | |
| RobotPlanner (std::string_view urdf_path, std::string_view mesh_path={}) | |
| 构造机器人规划对象 | |
| RobotPlanner (RobotPlanner &&) noexcept | |
| RobotPlanner & | operator= (RobotPlanner &&) noexcept |
| ~RobotPlanner () | |
| void | load (std::string_view urdf_path, std::string_view mesh_path={}) |
| 重新加载机器人模型 | |
| void | update (const msg::JointState &joint_state) |
| 更新关节状态,并根据正运动学重新计算 TF 树 | |
| const msg::JointState & | joints () const noexcept |
| 获取当前关节状态 | |
| const msg::URDF & | urdf () const noexcept |
| 获取当前 URDF 消息 | |
| const msg::TF & | tf () const noexcept |
| 获取当前 TF 消息 | |
| msg::JointTrajectory | plan (const msg::JointState &target) const |
| 关节空间点到点规划 | |
| msg::JointTrajectory | plan (std::string_view frame, const msg::Pose &target) const |
| 笛卡尔空间点到点规划 | |
| msg::JointTrajectory | plan (std::string_view frame, const std::vector< msg::Pose > &waypoints) const |
| 笛卡尔空间多段途经点规划 | |
| msg::Pose | linkpose (std::string_view link_name) const |
| 获取指定连杆相对于基坐标系的位姿(正运动学) | |
| void | setMaxVelocityScalingFactor (double factor) |
| 设置最大速度缩放因子 | |
| double | getMaxVelocityScalingFactor () const noexcept |
| 获取当前最大速度缩放因子 | |
| void | setMaxAccelerationScalingFactor (double factor) |
| 设置最大加速度缩放因子 | |
| double | getMaxAccelerationScalingFactor () const noexcept |
| 获取当前最大加速度缩放因子 | |
Protected 属性 | |
| std::unique_ptr< Impl > | _impl {} |
机器人规划模块,提供 URDF 解析、正/逆运动学求解、轨迹规划等运动学功能
| rm::lpss::RobotPlanner::RobotPlanner | ( | std::string_view | urdf_path, |
| std::string_view | mesh_path = {} ) |
构造机器人规划对象
构造时以零位初始化所有关节状态,并生成对应的 TF 树
| [in] | urdf_path | 机器人 URDF 文件路径 |
| [in] | mesh_path | 机器人网格文件路径前缀(可选),一般用于解析 URDF 中的 mesh 路径 |
|
noexcept |
| rm::lpss::RobotPlanner::~RobotPlanner | ( | ) |
|
noexcept |
获取当前最大加速度缩放因子
|
noexcept |
获取当前最大速度缩放因子
|
noexcept |
获取当前关节状态
| msg::Pose rm::lpss::RobotPlanner::linkpose | ( | std::string_view | link_name | ) | const |
获取指定连杆相对于基坐标系的位姿(正运动学)
| [in] | link_name | 目标连杆名称 |
| void rm::lpss::RobotPlanner::load | ( | std::string_view | urdf_path, |
| std::string_view | mesh_path = {} ) |
重新加载机器人模型
解析新的 URDF 文件,重新构建运动学树,并以零位重新初始化所有关节状态和 TF 树
| [in] | urdf_path | 机器人 URDF 文件路径 |
| [in] | mesh_path | 机器人网格文件路径前缀(可选),一般用于解析 URDF 中的 mesh 路径 |
|
noexcept |
| msg::JointTrajectory rm::lpss::RobotPlanner::plan | ( | const msg::JointState & | target | ) | const |
关节空间点到点规划
| [in] | target | 目标关节状态(仅使用 position 字段) |
| msg::JointTrajectory rm::lpss::RobotPlanner::plan | ( | std::string_view | frame, |
| const msg::Pose & | target ) const |
笛卡尔空间点到点规划
| [in] | frame | 目标连杆名称(末端执行器所在连杆) |
| [in] | target | 目标位姿(位置 + 四元数姿态) |
| msg::JointTrajectory rm::lpss::RobotPlanner::plan | ( | std::string_view | frame, |
| const std::vector< msg::Pose > & | waypoints ) const |
笛卡尔空间多段途经点规划
| [in] | frame | 目标连杆名称(末端执行器所在连杆) |
| [in] | waypoints | 途经位姿列表,按顺序依次到达 |
| void rm::lpss::RobotPlanner::setMaxAccelerationScalingFactor | ( | double | factor | ) |
设置最大加速度缩放因子
轨迹规划时所有关节的最大加速度将乘以该系数,值域 \((0,1]\)。
| [in] | factor | 加速度缩放因子,将被截断到 \((0,1]\)范围 |
| void rm::lpss::RobotPlanner::setMaxVelocityScalingFactor | ( | double | factor | ) |
设置最大速度缩放因子
轨迹规划时所有关节的最大速度将乘以该系数,值域 \((0,1]\)。
| [in] | factor | 速度缩放因子,将被截断到 \((0,1]\)范围 |
|
noexcept |
获取当前 TF 消息
| void rm::lpss::RobotPlanner::update | ( | const msg::JointState & | joint_state | ) |
更新关节状态,并根据正运动学重新计算 TF 树
| [in] | joint_state | 新的关节状态(名称、位置、速度、力矩) |
|
noexcept |
获取当前 URDF 消息
|
protected |