The FollowMeBot follows the user based on the color of his or her shirt. The device hosts a webcam on a servo to find the object and orient the robot. The color is chosen through the user interface with push buttons. Currently, the MATLAB code supports red and green detection. The purpose of FollowMeBot is to be able to follow the user in order to be helpful for daily tasks.
Dependencies: Rectangle Servo TextLCD mbed
Fork of FollowMeBot by
iRobot/iRobot.h@1:6c399fc35deb, 2013-11-18 (annotated)
- Committer:
- dhamilton31
- Date:
- Mon Nov 18 21:09:13 2013 +0000
- Revision:
- 1:6c399fc35deb
- Parent:
- iRobot.h@0:3ed56271dd2d
- Child:
- 3:de12b39ad805
how many things must I commit?!?
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dhamilton31 | 0:3ed56271dd2d | 1 | #ifndef __IROBOT__ |
dhamilton31 | 0:3ed56271dd2d | 2 | #define __IROBOT__ |
dhamilton31 | 0:3ed56271dd2d | 3 | |
dhamilton31 | 0:3ed56271dd2d | 4 | #include "mbed.h" |
dhamilton31 | 0:3ed56271dd2d | 5 | |
dhamilton31 | 0:3ed56271dd2d | 6 | class iRobot |
dhamilton31 | 0:3ed56271dd2d | 7 | { |
dhamilton31 | 0:3ed56271dd2d | 8 | |
dhamilton31 | 0:3ed56271dd2d | 9 | public: |
dhamilton31 | 0:3ed56271dd2d | 10 | |
dhamilton31 | 0:3ed56271dd2d | 11 | iRobot(PinName tx, PinName rx); |
dhamilton31 | 0:3ed56271dd2d | 12 | void start(); |
dhamilton31 | 0:3ed56271dd2d | 13 | void forward(); |
dhamilton31 | 0:3ed56271dd2d | 14 | void reverse(); |
dhamilton31 | 0:3ed56271dd2d | 15 | void left(); |
dhamilton31 | 0:3ed56271dd2d | 16 | void right(); |
dhamilton31 | 0:3ed56271dd2d | 17 | void stop(); |
dhamilton31 | 0:3ed56271dd2d | 18 | void playsong(); |
dhamilton31 | 0:3ed56271dd2d | 19 | void charger(); |
dhamilton31 | 1:6c399fc35deb | 20 | void changeSpeed(int speed); |
dhamilton31 | 1:6c399fc35deb | 21 | void receive_sensor(); |
dhamilton31 | 1:6c399fc35deb | 22 | char sensorCode(); |
dhamilton31 | 0:3ed56271dd2d | 23 | |
dhamilton31 | 0:3ed56271dd2d | 24 | private: |
dhamilton31 | 0:3ed56271dd2d | 25 | |
dhamilton31 | 0:3ed56271dd2d | 26 | // Create Command // Arguments |
dhamilton31 | 0:3ed56271dd2d | 27 | static const char Start = 128; |
dhamilton31 | 0:3ed56271dd2d | 28 | static const char SafeMode = 131; |
dhamilton31 | 0:3ed56271dd2d | 29 | static const char FullMode = 132; |
dhamilton31 | 0:3ed56271dd2d | 30 | static const char Drive = 137; // 4: [Vel. Hi] [Vel Low] [Rad. Hi] [Rad. Low] |
dhamilton31 | 0:3ed56271dd2d | 31 | static const char DriveDirect = 145; // 4: [Right Hi] [Right Low] [Left Hi] [Left Low] |
dhamilton31 | 0:3ed56271dd2d | 32 | static const char Demo = 136; // 2: Run Demo x |
dhamilton31 | 0:3ed56271dd2d | 33 | static const char Sensors = 142; // 1: Sensor Packet ID |
dhamilton31 | 0:3ed56271dd2d | 34 | static const char CoverandDock = 143; // 1: Return to Charger |
dhamilton31 | 0:3ed56271dd2d | 35 | static const char SensorStream = 148; // x+1: [# of packets requested] IDs of requested packets to stream |
dhamilton31 | 0:3ed56271dd2d | 36 | static const char QueryList = 149; // x+1: [# of packets requested] IDs of requested packets to stream |
dhamilton31 | 0:3ed56271dd2d | 37 | static const char StreamPause = 150; // 1: 0 = stop stream, 1 = start stream |
dhamilton31 | 0:3ed56271dd2d | 38 | static const char PlaySong = 141; |
dhamilton31 | 0:3ed56271dd2d | 39 | static const char Song = 140; |
dhamilton31 | 0:3ed56271dd2d | 40 | static const char BumpsandDrops = 7; |
dhamilton31 | 0:3ed56271dd2d | 41 | static const char Distance = 19; |
dhamilton31 | 0:3ed56271dd2d | 42 | static const char Angle = 20; |
dhamilton31 | 1:6c399fc35deb | 43 | /* Global variables with sensor packet info */ |
dhamilton31 | 1:6c399fc35deb | 44 | char Sensor_byte_count; |
dhamilton31 | 1:6c399fc35deb | 45 | char Sensor_Data_Byte; |
dhamilton31 | 1:6c399fc35deb | 46 | char Sensor_Data_Byte_Error; |
dhamilton31 | 1:6c399fc35deb | 47 | char Sensor_ID; |
dhamilton31 | 1:6c399fc35deb | 48 | char Sensor_Num_Bytes; |
dhamilton31 | 1:6c399fc35deb | 49 | char Sensor_Checksum; |
dhamilton31 | 0:3ed56271dd2d | 50 | |
dhamilton31 | 0:3ed56271dd2d | 51 | int speed_left; |
dhamilton31 | 0:3ed56271dd2d | 52 | int speed_right; |
dhamilton31 | 0:3ed56271dd2d | 53 | Serial device; |
dhamilton31 | 0:3ed56271dd2d | 54 | }; |
dhamilton31 | 0:3ed56271dd2d | 55 | |
dhamilton31 | 0:3ed56271dd2d | 56 | #endif |