Right now I'm trying to get ROS (Robot Operating System) to communicate with the Maple board. ROS has a serialization/deserialization package already set up. Unfortunately for the moment its only set up for Arduino. This page http://www.ros.org/wiki/rosserial_client/Tutorials/Porting%20ROSSerial%20Client gives the rough outline of what I need to communicate with the package they have set up. I looked through what they did for the Arduino board thinking it would be a semi easy port over to the maple but I would like to use the SerialUSB port to do the communication. I started off looking into the usb_serial.h file and got this set of code. Sorry ahead of time for not having a link to the code instead of straight code. The compiler is not giving me errors anymore, but the connection still doesn't work like it should (yes I know that issue is vague) I'm curious as to what I should use to initialize the USBSerial class as far as getting the usb port to open for this classes use.
#ifndef MAPLEHARDWARE_H_
#define MAPLEHARDWARE_H_
#include "WProgram.h"
#include <usb_serial.h>
class MapleHardware {
public:
MapleHardware(){}
void init(){
iostream->begin();
}
int read(){return iostream->read();};
void write(uint8_t* data, int length){
for(int i=0; i<length; i++) iostream->write(data[i]);
}
unsigned long time(){return millis();}
protected:
USBSerial* iostream;
};
#endif