/* Copyright (c) 2010, Dale Weber All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Hybrid Robotics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Project: Software for W.A.L.T.E.R., the Wheeled Autonomous Learning Terrain Exploring Roving Date: 15-May-2010 Version: 2.0.01 Author: Dale Weber (robotguy@hybotics.org) Controller: AXON by Society of Robots SSC-32 Servo Controller by Lynxmotion Sabertooth 2X5 motor controller by Dimension Engineering Power: 6V@2800 mAH batery for and servos 7.2V@2800 mAH battery for motors and motor controller 7.2V@2000 mAH battery for the electronics Notes: This software uses the Webbot framework, found at http://sourceforge.net/projects/webbotavrclib/ */ #ifndef CONTROL_H #define CONTROL_H // UART definitions #define SSC32 UART0 // Servo controller #define CONSOLE UART1 // Console (USB) #define ROBOCLAW UART2 // Motor controllers #define SABERTOOTH UART2 // Motor controllers #define XBEE UART3 // Wireless #define STATUS_LED B6 // Sensor maximum number and position definitions #define PING_MAX 8 // Maximum number of PING ultrasonic sensors #define GP2D12_MAX 8 // Maximum number of Sharp GP2D12 IR sensors #define PING_NR 1 // Actual number of PING ultrasonic sensors on WALTER #define GP2D12_NR 1 // Actual number of Sharp GP2D12 IR sensors on WALTER // Sensor positions on WALTER (8 points) #define SENS_CENTER 0 #define SENS_RFWHEEL 1 #define SENS_RIGHT 2 #define SENS_RRWHEEL 3 #define SENS_REAR 4 #define SENS_LRWHEEL 5 #define SENS_LEFT 6 #define SENS_LFWHEEL 7 // Number of servos #define SERVO_MAX 32 #define SERVO_NR 22 // Servo indexes into the servo array for the hybrid legs #define RFHip 0 #define RFKnee 1 #define RFTibia 2 #define RFSteer 3 #define RFankle 4 #define RRHip 5 #define RRKnee 6 #define RRTibia 7 #define RRSteer 8 #define RRAnkle 9 #define LFHip 10 #define LFKnee 11 #define LFTibia 12 #define LFSteer 13 #define LFAnkle 14 #define LRHip 15 #define LRKnee 16 #define LRTibia 17 #define LRSteer 18 #define LRAnkle 19 // Front pan/tilt servos #define SENS_PAN 20 #define SENS_TILT 21 // Will hold servo data in an array of this struct typedef struct servo_def { unsigned int pin; // Servo pin number (0 - 31) int offset; // uS offset from 1500uS for center position int homep; // Home position in uS int currpos; // Current position in uS (500 - 2500) int angle; // Angle of servo -90 to +90 degrees } SERVO; #endif