Skip to content
Snippets Groups Projects
Commit dcb01844 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Fix enum and case validity check in graph helper.

parent ee08e3a1
No related branches found
No related tags found
No related merge requests found
......@@ -88,14 +88,14 @@ namespace hpp {
};
enum GraspingCase {
NoGrasp = 0,
GraspOnly = 1 << 0,
WithPreGrasp = 1 << 1
NoGrasp = 1 << 0,
GraspOnly = 1 << 1,
WithPreGrasp = 1 << 2
};
enum PlacementCase {
NoPlace = 1 << 2,
PlaceOnly = 1 << 3,
WithPrePlace = 1 << 4
NoPlace = 1 << 3,
PlaceOnly = 1 << 4,
WithPrePlace = 1 << 5
};
struct Rule {
......
......@@ -118,7 +118,10 @@ namespace hpp {
static const bool pregrasp = (gCase & WithPreGrasp);
static const bool intersec = !((gCase & NoGrasp) || (gCase & NoPlace));
static const bool preplace = (gCase & WithPrePlace);
static const bool valid = !(gCase == (NoGrasp | NoPlace));
static const bool valid =
( (gCase & WithPreGrasp) || (gCase & GraspOnly) || (gCase & NoGrasp) )
&& ( (gCase & WithPrePlace) || (gCase & PlaceOnly) || (gCase & NoPlace) )
&& !(gCase == (NoGrasp | NoPlace));
static const std::size_t nbWaypoints = (pregrasp?1:0) + (intersec?1:0) + (preplace?1:0);
static const std::size_t Nnodes = 2 + nbWaypoints;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment