rpos::features::MotionPlanner类

路径规划功能特征,包括了动态路径规划功能和自动避障功能。

头文件

rpos/features/motion_planner.h

适用于

  • Slamware

父类

继承自rpos::core::Feature

构造器

/**
* 该构造器仅限SDK内部使用。
*/
MotionPlanner(boost::shared_ptr<detail::MotionPlannerImpl>);   
/**
* 拷贝构造函数。
*/
MotionPlanner(const MotionPlanner&);   

运算符

/**
* 赋值运算符。
*/ 
MotionPlanner& operator=(const MotionPlanner&);   

方法

/**
* 回充电桩。
*/
actions::MoveAction goHome(const rpos::features::motion_planner::GoHomeOptions& options);
名称 类型 说明
options const features::motion_planner::GoHomeOptions& 回桩选项
返回 actions::MoveAction 运动行为
/**
* 默认方式回充电桩, 可兼容2.x版本的固件。
*/
actions::MoveAction goHome();
/**
* 让机器人沿着路径移动(机器人会逐一走过路径中的节点,在节点之间尽量走圆滑的曲线,如果遇到障碍物,机器人会自动避开)。
*/ 
rpos::actions::MoveAction moveTo(const std::vector<rpos::core::Location>& locations, bool appending);   
名称 类型 说明
locations const std::vector<rpos::core::Location>& 期望机器人经过的点
appending bool 如果机器人正在执行其他的移动动作,该参数决定新的点是追加或是替换既有节点
/**
* 让机器人移动到目标位置。
*/
rpos::actions::MoveAction moveTo(const rpos::core::Location& location, bool appending);   
名称 类型 说明
location const rpos::core::Location& 期望机器人经过的点。
appending bool 如果机器人正在执行其他的移动动作,该参数决定新的点是追加或是替换既有节点。
/**
* 让机器人沿着路径移动(机器人会逐一走过路径中的节点,在节点之间尽量走圆滑的曲线,如果遇到障碍物,机器人会自动避开)。
*/
rpos::actions::MoveAction moveTo(const std::vector<rpos::core::Location>& locations, const motion_planner::MoveOptions& options);   
名称 类型 说明
locations const std::vector<rpos::core::Location>& 期望机器人经过的点。
options const motion_planner::MoveOptions& 运动参数。
/**
* 让机器人移动到目标位置。
*/
rpos::actions::MoveAction moveTo(const rpos::core::Location& location, const motion_planner::MoveOptions& options);   
名称 类型 说明
location const rpos::core::Location& 期望机器人经过的点。
options const motion_planner::MoveOptions& 运动参数。
/**
* 控制机器人朝向一个方向直线运动。
*/
rpos::actions::MoveAction moveBy(const rpos::core::Direction& direction);   
名称 类型 说明
direction const rpos::core::Direction 期望机器人运动方向。
/**
* 控制机器人朝向一个方向直线运动。
*/
rpos::actions::MoveAction moveBy(const rpos::core::Direction& direction, const motion_planner::MoveOptions& options);   
名称 类型 说明
direction const rpos::core::Direction& 期望机器人运动方向。
options const motion_planner::MoveOptions& 运动参数。
/**
* 控制机器人朝向theta曲线运动。
*/
rpos::actions::MoveAction moveBy(float theta, const motion_planner::MoveOptions& options);
/**
* 控制机器人旋转到一个角度。
*/
rpos::actions::MoveAction rotateTo(const rpos::core::Rotation& orientation);   
名称 类型 说明
orientation const rpos::core::Rotation& 期望机器人运动之后头朝向角度。
/**
* 控制机器人旋转到一个角度。
*/
rpos::actions::MoveAction rotateTo(const rpos::core::Rotation& orientation, const motion_planner::MoveOptions& options);   
名称 类型 说明
orientation const rpos::core::Rotation& 期望机器人运动之后头朝向角度。
options const motion_planner::MoveOptions& 运动参数。
/**
* 控制机器人旋转一定的角度。
*/
rpos::actions::MoveAction rotate(const rpos::core::Rotation& rotation);   
名称 类型 说明
rotation const rpos::core::Rotation& 期望机器人旋转的角度。
/**
* 控制机器人旋转一定的角度。
*/
rpos::actions::MoveAction rotate(const rpos::core::Rotation& rotation, const motion_planner::MoveOptions& options);  
名称 类型 说明
rotation const rpos::core::Rotation& 期望机器人旋转的角度。
options const motion_planner::MoveOptions& 运动参数。
/**
* 请求机器人重定位。
*/
rpos::actions::MoveAction recoverLocalization(const core::RectangleF& area, const motion_planner::RecoverLocalizationOptions& options);   
名称 类型 说明
area const core::RectangleF& 请求重定位的矩形区域。
options const motion_planner::MoveOptions& 运动参数。
/**
* 利用充电桩机器人重定位
*/
rpos::actions::MoveAction recoverLocalizationByDock();
/**
* 启动一个机器人速度设置的行动,通过返回的对象可以设置机器人线速度和角速度。
*/
rpos::actions::VelocityControlMoveAction velocityControl();   
/**
* 获得机器人当前正在进行的移动动作。您可以使用Action::isEmpty()方法判断它是否存在。当机器人当前没有正在进行的动作时,当Action::isEmpty()将会返回true。
*/
rpos::actions::MoveAction getCurrentAction();   
/**
* 使用机器人内置的寻路算法寻找前往指定目的地的路径。
*/
rpos::features::motion_planner::Path searchPath(const rpos::core::Location& location);   
名称 类型 说明
location const core::Location& 目标定位置。
/**
* 获取机器人支持的所有运动策略。
* 运动策略包含了一系列影响机器行为的配置项。
*/
std::vector<std::string> enumSupportedMotionStrategies();   
/**
* 设置运动策略
*/
bool setMotionStrategy(const std::string& strategy);   
/**
* 获取当前运动策略
*/
std::string getCurrentMotionStrategy();   
/**
* 判断一个位置是否被障碍物占据, 传入kinds参数为1表示判断是否是动态障碍物,2表示判断静态障碍物,3表示任意一种。
enum CheckOccupiedKinds
{
    CheckOccupiedKindsLocal = 1,
    CheckOccupiedKindsGlobal = 2,
};
*/
bool checkOccupied(const rpos::core::Pose& pose, rpos::features::motion_planner::CheckOccupiedKinds kinds);