conversations.from: human
conversations.value: What could be a title for a book about Raspberry, Tim, England with the genre: Computers & Technology, Hardware & DIY?
conversations.from: assistant
conversations.value: A title for this book could be 'Raspberry Pi Cookbook for Python Programmers'
conversations.from: human
conversations.value: What is the first five paragraphs for this book? End with the sentence 'py` file in the same directory.'.
conversations.from: assistant
conversations.value: Raspberry Pi Cookbook for Python Programmers
  Stop frame (or stop motion) animation is the process of taking a series of still images of items, while making very small movements (typically of an easily moveable object such as a doll or plasticine model) in each frame. When the frames are assembled into a video, the small movements combine to produce an animation.
  Traditionally, such animations were made by taking hundreds or even thousands of individual photos on a film camera (such as a Cine Super 8 movie camera) and then sending the film off to be developed and playing back the results some weeks later. Despite the inspiring creations by Nick Park at Aardman Animations, including Wallace and Gromit (which are full-length, stop frame animation films), this was a hobby that was a little out of reach for most.
  In the modern digital age, we can take multiple images quickly and easily with the luxury of reviewing the results almost instantly. Now anyone can try their hand at their own animated masterpieces with very little cost or effort.
  We will extend our original **Camera GUI** with some extra features that will allow us to create our own stop frame animations. It will allow us to take images and try them out in a sequence before generating a finished video for us.
  The software setup for this example will be the same as the previous time-lapse example. Again, we will need `mencoder` to be installed and we need the `cameraGUI.py` file in the same directory.
conversations.from: human
conversations.value: What is five more paragraphs?
conversations.from: assistant
conversations.value: An improvement to this setup would be to mount the sonic sensor on top of a servo, thereby allowing you to make a sensor sweep of the robot's surroundings. By making multiple sweeps, taking distance measurements, and tracking the angle of the servo, you could build an internal map of the robot's surroundings.
  In order to navigate your robot around the environment, you will need to keep track of which way your robot is facing. You can estimate the angle that your robot turns at by measuring the angle that it turned at in a fixed time period. For wheeled robots, you can also measure the rotation of each wheel using a rotary encoder (a device that provides a count of the wheel's rotations). However, as you make the robot take multiple turns, the direction the robot is facing becomes more and more uncertain as differences in the surfaces and the grip of the wheels or legs cause differences in the angles that the robot is turning at.
  Fortunately, we can use an electronic version of a compass; it allows us to determine the direction that the robot is facing by providing an angle from the magnetic North. If we know which direction the robot is facing, we can receive commands requesting a particular angle and ensure that the robot moves towards it. This allows the robot to perform controlled movements and navigate as required.
  When given a target angle, we can determine which direction we need to turn towards, until we reach it.
  You need a magnetometer device such as the PiBorg's **XLoBorg** module (which is a combined I2C magnetometer and accelerometer). In this example, we focus on the magnetometer (the smaller chip on the left) output only. The XLoBorg module looks as shown in the following image:
conversations.from: human
conversations.value: What is the last five paragraphs?
conversations.from: assistant
conversations.value: The following hardware is used in the remaining sections to expand the available inputs/outputs, avoid obstacles, and determine the direction of the robot:
  In most cases, the latest version of the software available should be used (versions are listed just in case there is a compatibility issue in a later release). The list of software used is as follows:
  Details of additional commands are listed by running `sudo apt-get` and `sudo apt-cache`. Alternatively, they are listed by reading the manual pages using the `man` command, the `man apt-get` command, and the `man apt-cache` command.
  For example, to check the version of Pi3D installed on your system, use `pip-3.2 freeze | grep pi3d`.
  To replace the installed version of Pi3D with Version 1.6a, use `sudo pip-3.2 uninstall pi3d` and `sudo pip-3.2 install pi3d==1.6a`.