Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

double x() const、double& x()

x属性

示例
Code Block
languagecpp
firstline0
linenumberstrue
Location location;
std::cout<<location.x()<<std::endl; // output 0
location.x() = 10;
std::cout<<location.x()<<std::endl; // output 10

double y() const、double& y()

...

将rpos::core::Action的对象转换成子类的对象

示例
Code Block
languagecpp
firstline0
linenumberstrue
rpos::core::Action someAction = robotPlatform.startSomeAction();
rpos::actions::MoveAction moveAction = someAction.cast<rpos::actions::MoveAction>;

rpos::core::ActionStatus枚举

ActionStatus枚举列举了动作的状态

头文件

rpos/core/action.h

枚举项

ActionStatusWaitingForStart

动作正在等待开始

ActionStatusRunning

动作正在进行

ActionStatusFinished

动作已经完成

ActionStatusPaused

动作已经暂停

ActionStatusStopped

动作已经停止(取消)

ActionStatusError

动作执行过程中出现错误

rpos::core::Feature类

Feature类表示一个特征,即一个特定的功能集合。

头文件

rpos/core/feature.h

构造器

Feature(const Feature&)

拷贝构造函数

运算符

Feature& operator=(const Feature&)

赋值运算符

rpos::core::RectangleF类

RectangleF类表示一个矩形,其坐标参数的类型为float

头文件

rpos/core/geometory.h

构造器

RectangleF()构造器

创建一个x、y、width、height都为0的矩形。

RectangleF(Vector2f position, Vector2f size)

创建一个位置和大小为指定值的矩形

RectangleF(float x, float y, float width, float height)

创建一个位置和大小为指定值的矩形

RectangleF(const RectangleF&)

拷贝构造函数

运算符

RectangleF& operator=(const RectangleF&)

赋值运算符

方法

const Vector2f& position()、Vector2f& position()

矩形的位置(左上角)

const Vector2f& size()、Vector2f& size()

矩形的大小

float x() const、float& x()

矩形左上角的x坐标

float y() const、float& y()

矩形左上角的y坐标

float width() const、float& width()

矩形的宽度

float height() const、float& height()

矩形的高度

float left() const

矩形左侧的x坐标

float right() const

矩形右侧的x坐标(right=x+width)

float top() const

矩形顶部的y坐标

float bottom() const

矩形底部的y坐标(bottom=y+height)

bool contains(const Vector2i& point)

判断点是否在矩形的范围内

bool empty()

判断矩形是否是全空的(即width() < epsilon或height()<epsilon)

bool contains(const RectangleF& dest)

判断目标矩形是否完全在本矩形的区域内

void unionOf(const RectangleF& dest)

计算本矩形和目标矩形重合的部分,并将本矩形设定为该重合部分矩形

rpos::core::Vector2f类

二维向量,元素数据类型为float型

头文件

rpos/core/geometry.h

构造器

Vector2f()

构造一个新的向量,其x、y的值是不确定的

Vector2f(float x, float y)

构造一个x、y为指定的值的向量

Vector2f(const Vector2f&)

拷贝构造函数

运算符

Vector2f& operator=(const Vector2f&)

赋值运算符

方法

float x() const、float& x()

二维向量的x分量

float y() const、float& y()

二维向量的y分量

rpos::core::Vector2i类

二维向量,元素数据类型为int型

头文件

rpos/core/geometry.h

构造器

Vector2i()

构造一个新的向量,其x、y的值是不确定的

Vector2i(float x, float y)

构造一个x、y为指定的值的向量

Vector2i(const Vector2i&)

拷贝构造函数

运算符

Vector2i& operator=(const Vector2i&)

赋值运算符

方法

int x() const、int& x()

二维向量的x分量

int y() const、int& y()

二维向量的y分量

rpos::core::LaserPoint类

激光雷达测距的单点数据,包括了距离、角度、是否有效等信息

头文件

rpos/core/laser_point.h

构造器

LaserPoint()

创建一个新的LaserPoint对象

LaserPoint(float distance, float angle, bool valid)

创建一个距离、角度、有效性为指定值的LaserPoint对象

LaserPoint(const LaserPoint&)

拷贝构造函数

运算符

LaserPoint& operator=(const LaserPoint&)

赋值运算符

方法

float distance() const、float& distance()

距离数据(单位:米)

float angle() const、float& angle()

本次测量的角度(单位:弧度)

bool valid() const、bool& valid()

本次测量是否有效

rpos::core::RobotPlatform类

机器人平台是一系列设备组合而成的整体,提供一系列的特征从而提供功能。RobotPlatform类是所有机器人平台的基类。

头文件

rpos/core/robot_platform.h

构造器

RobotPlatform(const RobotPlatform&)

拷贝构造函数

运算符

RobotPlatform& operator=(const RobotPlatform&)

赋值运算符

方法

std::vector<Feature> getFeatures()


获得该机器人平台提供的所有特征

template<class RobotPlatformT> RobotPlatformT cast()

将RobotPlatform对象转换成子类对象,示例请参考rpos::core::Action::cast<>

rpos::robot::heading::HeadingMode枚举

HeadingMode枚举表示机器人移动时头朝向的方式。

头文件

rpos/features/motion_planner/move_heading.h

枚举项

HeadingModeAuto

机器人按照自己的方式随意行走

HeadingModeFixAngle

机器人行走时头与前进方向成固定角度

HeadingModeCircleMotion

机器人行走时头始终朝向某个物体或者某点

HeadingModeDirection

机器人行走时头始终朝向某个固定的方向

rpos::robot::heading::RobotHeading类

RobotHeading类表示机器人在行走的时候的头朝向某个物体或者方向的设置。

头文件

rpos/features/motion_planner/move_heading.h

构造器

RobotHeading()构造器

构造函数

RobotHeading(HeadingMode headingMode, rpos::core::Pose pose)构造器

构造函数

运算符

RobotHeading& operator=(const RobotHeading&)运算符

赋值运算符。

方法

const rpos::core::Pose& RobotHeading::pose() const

获取机器人行走时头朝向的角度或者物体的位置,头朝向与位置或者角度的对应关系如下:

朝向
HeadingModeAutoPose值不可用
HeadingModeFixAngle或者HeadingModeDirectionPose的Rotation参数可用
HeadingModeCircleMotionPose的Location参数可用

const HeadingMode& RobotHeading::headingMode() const

...