Project

General

Profile

Revision 386

Added a README for colonet. Removed some unused files. Some other minor cleanup.

View differences:

trunk/code/projects/colonet/followLeader/colonet_defs.h
1
/* Eugene Marinelli, Fan
2
 * 10/27/06
3
 *
4
 * Colonet Definitions - common definitions and structs used in all colonet
5
 * applications
6
 */
7

  
8
#ifndef COLONET_DEFS_H_
9
#define COLONET_DEFS_H_
10

  
11
// PacketGroup id for wireless library.
12
#define COLONET_PACKET_GROUP_ID 8
13
#define COLONET_RESPONSE_PACKET_FRAME_ID COLONET_PACKET_GROUP_ID
14

  
15
// Message types
16
typedef enum {COLONET_COMMAND = 13, COLONET_REQUEST = 14,
17
              COLONET_RESPONSE = 15} ColonetMessageType;
18

  
19
//Packet properties
20
#define PACKET_DATA_LEN 7
21

  
22
#define WL_DEFAULT_PAN 3332
23

  
24
#define SERIAL_PORT "/dev/ttyS0"
25
#define USB_PORT "/dev/ttyUSB0"
26

  
27
// Message dests
28
#define GLOBAL_DEST 200
29
//#define MAX_NUM_ROBOTS 7
30
#define COLONET_SERVER_RESPONSE_ADDR 201
31

  
32
#define USER_DEFINED_MSG_ID_START 0xF0
33
#define USER_DEFINED_MSG_ID_END 0xFF
34
#define USER_DEFINED_MSG_TOTAL 0x0F
35

  
36
/* This is the packet structure of the data buffer sent from the colonet
37
 * wireless library to the robots and from the robots to the colonet wireless
38
 * library. */
39
typedef struct {
40
  short client_id; // ID number of the client sending the packet.
41
                   // Size of short is common to robots and server.
42
  unsigned char msg_code; // Specific instruction for the robot -- see below.
43
  unsigned char data[PACKET_DATA_LEN];
44
} ColonetRobotServerPacket;
45

  
46
/* Message codes */
47
//BUZZER
48
#define BUZZER_INIT 0x00
49
#define BUZZER_SET_VAL 0x01
50
#define BUZZER_SET_FREQ 0x02
51
#define BUZZER_CHIRP 0x03
52
#define BUZZER_OFF 0x04
53

  
54
//LCD
55
#define LCD_INIT 0x05
56
#define LCD_CLEAR_SCREEN 0x06
57
#define LCD_PUTBYTE 0x07
58
#define LCD_PUTCHAR 0x08
59
#define LCD_PUTSTR 0x09
60
#define LCD_GOTOXY 0x0A
61
#define LCD_PUTINT 0x0B
62

  
63
//ORB
64
#define ORB_INIT 0x0C
65
#define ORB_SET 0x0D
66
#define ORB_SET_COLOR 0x0E
67
#define ORB_DISABLE 0x0F
68
#define ORB_ENABLE 0x10
69
#define ORB_SET_DIO 0x11
70
#define LED_INIT 0x12
71
#define LED_USER 0x13
72
#define ORB_SET_NUM_NS 0x14
73
#define ORB_SET_NUM 0x15
74
#define ORB_SEND 0x16
75

  
76
//MOTORS
77
#define MOTORS_INIT 0x17
78
#define MOTOR1_SET 0x18
79
#define MOTOR2_SET 0x19
80
#define MOTORS_OFF 0x1A
81
#define MOVE 0x1B
82
#define MOVE_AVOID 0x1C
83

  
84
//SHARP
85
#define READ_DISTANCE 0x24
86
#define LINEARIZE_DISTANCE 0x25
87
#define LOG_DISTANCE 0x26
88
#define ENABLE_IR 0x27
89
#define DISABLE_IR 0x28
90

  
91
//SERIAL
92
#define XBEE_INIT 0x29
93
#define XBEE_PUTC 0x2A
94
#define XBEE_GETC 0x2B
95

  
96
#define USB_INIT 0x2D
97
#define USB_PUTC 0x2E
98
#define USB_GETC 0x2F
99

  
100

  
101

  
102
//DELAY_MS
103
#define DELAY_MS 0x31
104

  
105
//ANALOG
106
#define ANALOG_INIT 0x32
107
#define SET_ADC_MUX 0x33
108
#define ENABLE_ANALOG 0x34
109
#define CALL_ANALOG8 0x35
110
#define CALL_ANALOG10 0x36
111
#define WHEEL 0x37
112
#define BATTERY 0x38
113

  
114
//BOM
115
#define GETMAXBOM 0x39
116
#define BOM_ON 0x3A
117
#define BOM_OFF 0x3B
118
#define OUTPUT_HIGH 0x3C
119
#define OUTPUT_LOW 0x3D
120

  
121
//DIO
122
#define DIGITAL_INPUT 0x3E
123
#define DIGITAL_OUTPUT 0x3F
124
#define BUTTON1_READ 0x41
125
#define BUTTON1_WAIT 0x42
126
#define BUTTON1_WAIT_LED 0x43
127
#define BUTTON2_READ 0x44
128
#define BUTTON2_WAIT 0x45
129
#define BUTTON2_WAIT_LED 0x46
130

  
131
//WL
132
#define WL_INIT 0x47
133
#define PARSE_BUFFER 0x48
134
#define WL_SEND 0x49
135

  
136
//BUMPER
137
#define DETECT_BUMP 0x50
138

  
139
//Other
140
#define PRINTF 0x51
141
#define KILL_ROBOT 0x52
142

  
143
/* End low-level robot commands */
144

  
145

  
146
///////////////////////////
147
//Colonet specific commands
148
//////////////////////////
149

  
150
#define REQUEST_BOM_MATRIX 0x90
151
//request: REQUEST_FROM_SERVER REQUEST_BOM_MATRIX
152
//response: RESPONSE_TO_CLIENT_REQUEST REQUEST_BOM_MATRIX <numRobots> <row by row, values separated by spaces>
153
// if you don't know a value in the matrix, put -1 in there
154

  
155
#define REQUEST_XBEE_IDS 0x91
156
//request: REQUEST_FROM_SERVER REQUEST_XBEE_IDS
157
//response: RESPONSE_TO_CLIENT_REQUEST REQUEST_XBEE_IDS <numRobots> <id0> <id1> ... <idNumRobots>
158

  
159

  
160

  
161
//Colonet Client commands
162
//TODO: renamed these to end in LENGTH
163
#define MAX_COMMAND_LEN 128
164
#define MAX_RESPONSE_LEN 1024
165

  
166
#define SEND_TO_ROBOT      0x00
167
#define REQUEST_FROM_SERVER 0x01
168
#define RESPONSE_TO_CLIENT_REQUEST 0x02
169

  
170

  
171
#endif
trunk/code/projects/colonet/ColonetGUI/index.html
1 1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
	  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 3

  
4 4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5
<head>
6
	<title>Colony Control Applet - Carnegie Mellon Robotics Club</title>
7
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
8
	<link rel="stylesheet" type="text/css" href="colonetstyle.css" />
9
</head>
5
  <head>
6
    <title>Colony Control Applet - Carnegie Mellon Robotics Club</title>
7
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
8
    <link rel="stylesheet" type="text/css" href="colonetstyle.css" />
9
  </head>
10 10

  
11
<body>
11
  <body>
12 12

  
13
<div class="top">
14
	<h1>Colonet: Robot Graph</h1>
15
	<p>Carnegie Mellon Robotics Club: Colony Project</p>
16
	<img src="http://roboclub8.frc.ri.cmu.edu/mainwiki/roboclublogo.png" height="125px" width="110px" alt="RoboClub Logo" />
17
</div>
13
    <div class="top">
14
      <h1>Colonet: Robot Graph</h1>
15
      <p>Carnegie Mellon Robotics Club: Colony Project</p>
16
      <img src="http://roboclub8.frc.ri.cmu.edu/mainwiki/roboclublogo.png" height="125px" width="110px" alt="RoboClub Logo" />
17
    </div>
18 18

  
19
<div class="app">
20
	<p>
19
    <div class="app">
20
      <p>
21 21
	<object
22
	    archive = "Colonet.jar"
23
		type = "application/x-java-applet"
24
		width = "950"
25
		height = "550"
26
		align = "bottom"
27
		codebase = "http://roboclub9.frc.ri.cmu.edu/colonet/" 
28
		name = "Colonet"
29
		title = "Colonet" >
30
		<param name = "code" value = "Colonet.class" />
31
		<param name = "cache_option" value = "No" />
22
	   archive = "Colonet.jar"
23
	   type = "application/x-java-applet"
24
	   width = "950"
25
	   height = "550"
26
	   align = "bottom"
27

  
28
	   name = "Colonet"
29
	   title = "Colonet" >
30
	  <param name = "code" value = "Colonet.class" />
31
	  <param name = "cache_option" value = "No" />
32 32
	</object>
33 33
	<br />
34 34
	Requires Java 5.
35 35
	<br />
36 36
	<br />
37
	</p>
38
</div>
37
      </p>
38
    </div>
39 39

  
40
<div class="bottom">
41
	<p><b>Colony Project Home page:</b><br />
40
    <div class="bottom">
41
      <p><b>Colony Project Home page:</b><br />
42 42
	<a href="http://www.robotcolony.org/">www.robotcolony.org</a></p>
43
	
44
	<p><b>Validator:</b><br />
43
      
44
      <p><b>Validator:</b><br />
45 45
	<a href="http://validator.w3.org/check?uri=referer">
46
	<img src="http://www.w3.org/Icons/valid-xhtml10-blue"
47
		 alt="Valid XHTML 1.0 Transitional"
48
		 height="31"
49
		 width="88" 
50
		 border="0"
51
		 />
46
	  <img src="http://www.w3.org/Icons/valid-xhtml10-blue"
47
	       alt="Valid XHTML 1.0 Transitional"
48
	       height="31"
49
	       width="88" 
50
	       border="0"
51
	       />
52 52
	</a>
53 53
	<a href="http://jigsaw.w3.org/css-validator/validator?uri=http://roboclub1.frc.ri.cmu.edu/gui/colonetstyle.css">
54
  	<img style="border:0;width:88px;height:31px"
55
       src="http://www.w3.org/Icons/valid-css-blue" 
56
       alt="Valid CSS!" />
54
	  <img style="border:0;width:88px;height:31px"
55
	       src="http://www.w3.org/Icons/valid-css-blue" 
56
	       alt="Valid CSS!" />
57 57
	</a><br />
58
	</p>
59
	
60
</div>
58
      </p>
59
      
60
    </div>
61 61

  
62

  
63

  
64
</body>
65
</html>
62
  </body>
63
</html>
trunk/code/projects/colonet/ColonetGUI/Makefile
1

  
2 1
# Colonet GUI Makefile
3 2
# Gregory Tress
4 3
#
......
17 16
JCFLAGS = -g -d $(DIR) -target 1.5
18 17
JCWARN = -Xlint:deprecation,unchecked,fallthrough,path,finally
19 18

  
20

  
21 19
# Java file compilation instructions
22 20

  
23 21
default: $(DIR)/Colonet.class $(DIR)/ColonetServerInterface.class
......
36 34
clean:
37 35
	$(RM) $(DIR)/*.class
38 36
	$(RM) $(DIR)/*.jar
39

  
40

  
trunk/code/projects/colonet/ColonetServer/Makefile
40 40
	@echo "---finish creating object files---"
41 41
	@echo ""
42 42
	@echo "---link files---"
43
	$(CC) $(CFLAGS) $(COLONETOBJECTS) $(COLONETCPPOBJECTS) $(LOGGINGOBJECTS) $(LIBRARY_DIRS_FOR_GCC) -lpthread -lcolonet_wireless -lwireless  $(INCLUDE_DIRS_FOR_GCC) -o $@
43
	$(CC) $(CFLAGS) $(COLONETOBJECTS) $(COLONETCPPOBJECTS) $(LOGGINGOBJECTS) $(LIBRARY_DIRS_FOR_GCC) -lpthread -lcolonet_wireless -lwireless_colonet  $(INCLUDE_DIRS_FOR_GCC) -o $@
44 44
	@echo "---finish linking files---"
45 45
	@echo ""
46 46
	@echo "---finish compilation---"
trunk/code/projects/colonet/utilities/robot_slave/Makefile
14 14
USE_WIRELESS = 1
15 15

  
16 16
# com1 = serial port. Use lpt1 to connect to parallel port.
17
AVRDUDE_PORT = /dev/ttyUSB1
17
#AVRDUDE_PORT = /dev/ttyUSB1
18
AVRDUDE_PORT = /dev/ttyUSB0
19

  
18 20
#
19 21
#
20 22
###################################
trunk/code/projects/colonet/README
1
Eugene Marinelli
2
1/29/07
3

  
4
How to run Colonet.
5

  
6
Part I - Robot setup.
7
  1) Go to colony/trunk/code/projects/libwireless/lib and run "make".
8
  2) Go to colony/trunk/code/projects/colonet/lib/colonet_dragonfly and run "make".
9
  3) Put a robot in programming mode and plug it into the computer.
10
  4) Go to colony/trunk/code/projects/colonet/utilities/robot_slave and run "make program".
11
  Now the robot is ready.
12

  
13
Part II - Server setup.
14
  1) Go to colony/trunk/code/projects/libwireless/lib and run "make colonet".
15
  2) Go to colony/trunk/code/projects/colonet/lib/colonet_wireless and run "make".
16
  3) Go to colony/trunk/code/projects/colonet/ColonetServer and run "make".
17
  4) In the same directory, run "./ColonetServer".
18
  Now the server is ready.
19

  
20
Part III - Client (GUI) setup.
21
  1) Go to colony/trunk/code/projects/colonet/ColonetGUI and run "make".
22
  2) In the same directory, run "sudo make install" to copy the program to the www directory.
23
  3) In your browser, to go http://server_hostname/colonet, where server_hostname is the hostname of the computer that
24
     the server is running and the GUI app is hosted.
25
  Now the client is ready.
trunk/code/projects/libwireless/lib/Makefile
6 6

  
7 7
# Target file name (without extension).
8 8
TARGET = libwireless
9
COLONET_TARGET = libwireless_colonet
9 10

  
10 11
############################
11 12

  
......
181 182

  
182 183
colonet:
183 184
	g++ -Wall -Wshadow -Wextra *.c -g -I. -c
184
	ar rcs $(TARGET).a $(OBJ)
185
	ar rcs $(COLONET_TARGET).a $(OBJ)
185 186

  
186 187
# Eye candy.
187 188
# AVR Studio 3.x does not check make's exit code but relies on

Also available in: Unified diff