I am using the RS collision detection functionality in a path planning problem. Collision-free configurations are generated in the working space and each configuration is joined to create a path. The collision detection events are used to determine the collision-free configurations and paths.
At the moment, an event is raised for each collision event (CollisionStarted and CollisionEnded). To check whether a configuration is collision-free, I count the number of CollisionStarted and CollisionEnded events (because a collision event is raised for each robot link specified in the collision set)
int count = new int[2];
count[0] = no of CollisionStarted events
count[1] = no of CollisionEnded events
if(count[0] == count[1])
{
//configuration is collision free
}
else
{
//configuration is not collision free
}
My problem/query is this:
I am looking for a simplified version of the collision detector as the above logic causes some ambiguities when used for checking the path between 2 collision-free configurations.
I am only interested in if the collision is TRUE or FALSE.
If any CollisionStarted event is raised, then:
bool collision = TRUE;
If there are no collision events raised, then:
bool collision = FALSE
Is this possible to achieve with the present collision detector?
Thanks in advance,
Neil