Download Distributed Behavior-Based Control Pioneer Mobile Robots

Transcript
ayWriteIntPort(rotvel,-ayReadIntPort(avoidrotvel));
else ayWriteIntPort(rotvel, ayReadIntPort(avoidrotvel));
}
else ayWriteIntPort(rotvel, 0);
ayWriteIntPort(leftside,ayMAXINT);
ayWriteIntPort(rightside,ayMAXINT);
/* reset MinPorts */
}
2.2.3 Connections
After instantiating WanderHeadingControl as wander (with ayInitBehavior), we make the following connections:
ayConnect(USI, LeftFront, wander, leftside);
ayConnect(USI, Left, wander, leftside);
ayConnect(USI, Right, wander, rightside);
ayConnect(USI, RightFront, wander, rightside);
ayConnect(wander, rotvel, PBC, AngularVel);
/*see section 5.1*/
2.2.4 Resulting Behavior
We add all the code from this section to program straightline (Section 2.1) to produce program wanderer. The robot
will now scamper around the room fairly quickly, veering away from obstacles when at a distance, or slowing to turn
away if they are close. Though it may be necessary to tune the parameters for your environment, this behavior should
allow the robot to run around continuously for an arbitrary time, and appear interesting while doing so.
2.3 Minimal Coordinated Action - program moderndance.c
Now we take a slight detour to introduce some of Ayllu's features for multi-robot control. We will demonstrate the
simplicity of Ayllu's multi-robot communication and the flexibility of Ayllu's port-based communication through
implementation of a system in which two or more robots do a minimalist modern dance.
Intuition: Modern dance is easy! We needn't change any of the behaviors at all, just the connections. The idea is that
we leave the heading control (behavior wander) as it is, but change the connections so that sonar information from all
robots is fed into each robot's velocity-control behavior. This way, all robots will move with a velocity equal to the
global maximum safe velocity - that is, all robots will always move at the same velocity, determined by the sonar
readings of the robot closest to an obstacle. Thus, they will rotate as conditions dictate individually, but will speed up
and slow down as a group. With the right environment and the right music…
A Brief Tutorial
17