rpos::features::MotionPlanner类
路径规划功能特征,包括了动态路径规划功能和自动避障功能。
头文件
rpos/features/motion_planner.h
适用于
父类
继承自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);
/**
* 默认方式回充电桩, 可兼容2.x版本的固件。
*/
actions::MoveAction goHome();
/**
* 让机器人沿着路径移动(机器人会逐一走过路径中的节点,在节点之间尽量走圆滑的曲线,如果遇到障碍物,机器人会自动避开)。
*/
rpos::actions::MoveAction moveTo(const std::vector<rpos::core::Location>& locations, bool appending);
/**
* 让机器人移动到目标位置。
*/
rpos::actions::MoveAction moveTo(const rpos::core::Location& location, bool appending);
/**
* 让机器人沿着路径移动(机器人会逐一走过路径中的节点,在节点之间尽量走圆滑的曲线,如果遇到障碍物,机器人会自动避开)。
*/
rpos::actions::MoveAction moveTo(const std::vector<rpos::core::Location>& locations, const motion_planner::MoveOptions& options);
/**
* 让机器人移动到目标位置。
*/
rpos::actions::MoveAction moveTo(const rpos::core::Location& location, const motion_planner::MoveOptions& options);
/**
* 控制机器人朝向一个方向直线运动。
*/
rpos::actions::MoveAction moveBy(const rpos::core::Direction& direction);
/**
* 控制机器人朝向一个方向直线运动。
*/
rpos::actions::MoveAction moveBy(const rpos::core::Direction& direction, const motion_planner::MoveOptions& options);
/**
* 控制机器人朝向theta曲线运动。
*/
rpos::actions::MoveAction moveBy(float theta, const motion_planner::MoveOptions& options);
/**
* 控制机器人旋转到一个角度。
*/
rpos::actions::MoveAction rotateTo(const rpos::core::Rotation& orientation);
/**
* 控制机器人旋转到一个角度。
*/
rpos::actions::MoveAction rotateTo(const rpos::core::Rotation& orientation, const motion_planner::MoveOptions& options);
/**
* 控制机器人旋转一定的角度。
*/
rpos::actions::MoveAction rotate(const rpos::core::Rotation& rotation);
/**
* 控制机器人旋转一定的角度。
*/
rpos::actions::MoveAction rotate(const rpos::core::Rotation& rotation, const motion_planner::MoveOptions& options);
/**
* 请求机器人重定位。
*/
rpos::actions::MoveAction recoverLocalization(const core::RectangleF& area, const motion_planner::RecoverLocalizationOptions& options);
/**
* 利用充电桩机器人重定位
*/
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);
/**
* 获取机器人支持的所有运动策略。
* 运动策略包含了一系列影响机器行为的配置项。
*/
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);