Page 1 of 2
Pathfinding
Posted: Wed Sep 17, 2014 11:09 pm
by squiddon
Are there any pathfinding implementations (dijkstra, A*, etc) for ARGoS or shall I write my own?
Any code I'll produce I'll put on Github/BitBucket when I've completed my project.
Nick
Re: Pathfinding
Posted: Wed Sep 17, 2014 11:14 pm
by pincy
Hi Nick,
I don't have any ready-made implementation, but if you feel like contributing your own, go ahead! That would be really nice
Cheers,
Carlo
Re: Pathfinding
Posted: Fri Oct 10, 2014 11:01 am
by squiddon
Will do

Re: Pathfinding
Posted: Fri Nov 21, 2014 4:44 pm
by squiddon
Hi,
I ended up using boost's graph and astar implementation in the end (not enough time to implement my own, although I'd like to as a programming challenge).
However, I seem to be having troubles with my robot's movement towards a specified point. This is more than likely and issue with my own maths but was wondering if you might be able to help.
Here's the function:
https://gist.github.com/squiddon/ab9aab96e812421687dc
When robot starts at origin and the goal point is directly behind it the robot does a little shuffle (alternating velocity to left and right wheels) motion forward and never turns around. Wondering if you've encountered this behaviour before?
Nick
Re: Pathfinding
Posted: Fri Nov 21, 2014 5:04 pm
by squiddon
I think I've cracked it already, needed to play about with the min/max angle range.
Re: Pathfinding
Posted: Fri Nov 21, 2014 5:08 pm
by pincy
If I understood correctly, you want to go to a specific point in the environment stored in the variable m_sCurrentGoal.
The untested code, just out of my head, could be:
Code: Select all
void CSingleRobot::SetWheelSpeeds(const CCI_PositioningSensor::SReading& s_me_inworld,
const CVector2& c_target_inworld) {
// Get my rotation in the world
CRadians cZAngle, cYAngle, cXAngle;
s_me_inworld.Orientation.ToEulerAngles(cZAngle, cYAngle, cXAngle);
// Get position of target wrt robot
CVector2 cMeToTarget(
c_target_inworld.GetX() - s_me_inworld.Position.GetX(),
c_target_inworld.GetY() - s_me_inworld.Position.GetY());
cMeToTarget.Rotate(-cZAngle);
// Get direction angle
CRadians cAngle = cMeToTarget.Angle();
// Set wheel speed depending on angle
if(m_cGoStraightAngleRange.WithinMinBoundIncludedMaxBoundIncluded(cAngle)) {
// straight
m_pcWheels->SetLinearVelocity(m_fWheelVelocity, m_fWheelVelocity);
} else {
if(cAngle.GetValue() >= 0.0) {
// go left
m_pcWheels->SetLinearVelocity(0.0, m_fWheelVelocity);
} else {
// go right
m_pcWheels->SetLinearVelocity(m_fWheelVelocity, 0.0);
}
}
}
Re: Pathfinding
Posted: Fri Nov 21, 2014 5:09 pm
by pincy
NOTE: Your original code has a bug in wheel actuation (you rotate left when you should rotate right, and viceversa).
Re: Pathfinding
Posted: Fri Nov 21, 2014 7:58 pm
by squiddon
Good spot, although the behaviour seemed to work my end. My maths were definitely wrong.
Your function works perfectly, thanks very much

Re: Pathfinding
Posted: Fri Nov 21, 2014 8:16 pm
by pincy
Cool!

Unable to Increase length of Proximity sensor rays in Argos
Posted: Fri Nov 21, 2014 8:42 pm
by Waqar731
Hello!
I am trying to increase the length of rays shot by proximity sensor using Argos 2 Simulator.
Special thanks to all of you.