DAGU Playful Puppy Instruction Manual page 18

Hide thumbs Also See for Playful Puppy:
Table of Contents

Advertisement

Understanding the code (cont.)
The tab [IRtrack] is where the data from the compound eye is used to control the pan and tilt servos. If there are no
objects nearby then the head will slowly return to center position.
Basically the code adjust the pan servo to keep the left and right IR values equal. The tilt servo is adjusted to keep
the upper and lower IR values equal. This keeps the sensor facing directly at any nearby object.
The variables panscale and tiltscale are used to try and compensate for distance and the speed at which the
program runs. The constants, LRscalefactor and UDscalefactor can be changed in the [Constants.h] tab to
compensate for changes in the code that affect the speed of the code.
The code in the [Follow] tab is where the speed and direction of the legs are controlled. If the head has to
turn too far to track an object, the LShift and RShift walking speeds are adjusted to turn the body towards
the object being tracked. These speeds are then adjusted forward or backward to try and maintain
bestdistance from the object being tracked.
18

Advertisement

Table of Contents
loading

Related Products for DAGU Playful Puppy

Table of Contents