Project

General

Profile

Revision 89

Did a lot of work on slam, the robot/computer should be able to read back all of the information from IR and the BOM's right now. No testing yet. Waiting for freshman... Mwa ha ha. Next step is the hard part, working on the actual mapping algorithm. Hopefully some freshman will know OpenGL or something.

View differences:

robot_main.c
1
#include <dragonfly_lib.h>
2
#include <wireless.h>
3
#include <wl_token_ring.h>
4
#include <smart_run_around_fsm.h>
1
#include "dragonfly_lib.h"
2
#include "wireless.h"
3
#include "wl_token_ring.h"
4
#include "smart_run_around_fsm.h"
5
#include "slam_defs.h"
5 6

  
6 7
#define BOM_POST_DELAY 50
7
#define SLAM_PACKET_GROUP 11
8
#define CONTROL_PACKET_TYPE 'C'
9
#define REQUEST_PACKET_TYPE 'R'
10
#define ROBOT_RESPONSE 'I'
8
#define PACKET_BUFFER_SIZE 101 
11 9

  
12
//REQUEST_PACKET_ORGANIZATION
13
#define REQUEST_PACKET_SIZE 50
14
#define IR_1_LOC 0
15
#define IR_2_LOC 1
16
#define IR_3_LOC 2
17
#define IR_4_LOC 3
18
#define IR_5_LOC 4
19
#define BOM_START_LOC 5
20

  
21 10
void bom_pre(void);
22 11
void bom_post(void);
23 12

  
......
27 16
void receive_handle(char type, int source, unsigned char* packet, int length);
28 17
void unregister(void);
29 18

  
30
int  make_request_packet(char* packet);
19
int make_request_packet(char** packet);
31 20

  
32 21
int IR[5];
33 22

  
......
85 74
void receive_handle(char type, int source, unsigned char* packet, int length){
86 75
  int i; 
87 76
  if(type==REQUEST_PACKET_TYPE){
88
    //Send a message back to our computer overlord.
77
    
78
    /*Send a message back to our computer overlord.*/
89 79
    char buf[PACKET_BUFFER_SIZE]; 
90 80
    int len = make_request_packet(&buf);
91 81
    char packet[len];

Also available in: Unified diff