This sounds very naive and trivial, but, im honestly having trouble making a footbot move along a vector, in other words, i have the robot location based on
Code: Select all
CVector3 position = m_pcPositioningS->GetReading().Position;
Code: Select all
CVector2 target(12,8);
Code: Select all
CVector2 diff (target - position)
Code: Select all
SetWheelSpeedsFromVector(diff)
so i thought that i should be adding this diff vector to the current location could work, and couple of robots actually moved towards the target, others went in other ways.
Code: Select all
SetWheelSpeedsFromVector(diff + position);
Code: Select all
CQuaternion q = m_pcPositioningS->GetReading().Orientation;
CRadians cZAngle, cYAngle, cXAngle;
q.ToEulerAngles(cZAngle, cYAngle, cXAngle);
Real newX = position.GetX() + diff.GetX() * cos(cZAngle);
Real newY = position.GetY() + diff.GetY() * sin(CZAngle);
SetWheelSpeedsFromVector(CVector2(newX, newY);
so my question is, how can i make them all move towards a specific location?