Hello Professor,
I'm trying to implement a logic where a footbot can avoid an obstacle without losing focus of its target destination.
Do you mean going to a target while avoiding obstacles?
Yes, this is exactly what i'm trying to achieve
My robots initially use PSO to get their next step to move to, this logic works well, the robots also moves towards the direction of the points generated by the PSO logic
Are the target points specific locations, or they only designate direction?
Specific locations X,Y on the arena
however when they hit a wall/barrier/obstacle they simply just move the other way of the collision vector generated from the obstacle.
I guess here a code snippet would be helpful to understand what you're calculating more precisely.
I've changed and removed lots of code parts in hope i reach a solution, currently i only implement the following, but the behaviour has changed where the robots just keeps hitting the obstacle (wall in my case).
Code: Select all
CVector3 globalPosition3d = m_pcPositioningS->GetReading().Position;
CVector2 globalPosition2d (globalPosition3d.GetX(), globalPosition3d.GetY());
CQuaternion globalDirection3d = m_pcPositioningS->GetReading().Orientation;
CRadians globalZAngle, globalYAngle, globalXAngle;
globalDirection3d.ToEulerAngles(globalZAngle, globalYAngle, globalXAngle);
CVector2 direction = current.position - globalPosition2d;
direction.Rotate(-globalZAngle + );
SetWheelSpeedsFromVector(direction);
bool collision;
CVector2 collisionPath = DiffusionVector(collision);
if(collision)
{
LOG << "Collision\n";
CVector2 newDirection = direction - collisionPath;
newDirection.Rotate(-CRadians::PI_OVER_SIX);
SetWheelSpeedsFromVector(newDirection);
}
Control Theory Courses like the one from Georgia tech has a very neat FSM that explains and describes a solution to the problem, but i was looking for a simpler way to actually do it.
Can you link the specific solution you're referring to?
https://www.youtube.com/watch?v=U-TWPT0 ... r&index=46
thanks a lot