State Validity Checking(状态有效性检测?)
State Validity Checking
的功能:描述对于状态空间所给定的某个状态是否有效
OMPL本身不包含State Validity Checking
, 因为这个检测过程或者说检测的方法是和实际的问题紧密联系的,从下面的这段话中可以看出,State Validity Checking
这个过程很像是碰撞检测
OMPL itself does not include code for state validity checking. This is intentional, since defining this notion depends on the type of problems to be solved. For instance, OMPL.app defines state validity checking in terms of collision checking between loaded CAD models. The ROS interface to OMPL in MoveIt defines state validity checking to be collision checking between the robot model and sensed objects in the environment. If planning for protein folding, the state validity check has to do with the evaluation of energy functions.
OPML中提供了两个抽象类,来帮助用户定义状态有效性检测
In order to allow the user to specify the notion of state validity, OMPL defines two abstract classes:
1.ompl::base::StateValidityChecker
2.ompl::base::MotionValidator
这些抽象类提供了许多属性,用户可以根据需要去配置ompl::base::SpaceInformation从而实现State Validity Checking
类对象。
These classes abstract away properties specific to the systems we are planning for. For instance, OMPL does not need to represent robot or obstacle geometry. The user can specify which implementations to use when configuring ompl::base::SpaceInformation. The instances of ompl::base::StateValidityChecker and ompl::base::MotionValidator need to be thread safe.
规划器可以通过StateValidityChecker::isValid() 来评价状态的有效性,如果用户没有去定义State Validity Checking
系统会默认一个 AllValidStateValidityChecker,表示所有状态都是可用的,这也是一个类对象。
The ompl::base::StateValidityChecker class defines the ompl::base::StateValidityChecker::isValid() function, which allows planners to evaluate the validity of a state. If the user does not specify this class, an instance of ompl::base::AllValidStateValidityChecker is assumed. This will consider all states to be valid.
官方提供的一个代码片段
从这段代码中可以看出:StateValidityChecker 是为 SpaceInformation 服务的,也就是状态有效检测是用来检测状态空间的。用户要需要自己定义 检测的规则,这可以通过两种方式实现:
- 通过实现 继承自StateValidityChecker的类对象。
- 通过直接实现 检测函数