# Rosserial with the Maple IDE

I'm trying to set up the new rosserial package to work with the leaflabs Maple board. I tried using the supplied rosserial_client but it seems that its still trying to refer to the ArduinoHardware.h file which confuses me since it is supposed to be the general implementation of the rosserial communication. I have a Arduino board as well and I tested it using the rosserial_arduino package and it works wonderfully but unfortunately the arduino processor isn't powerful enough to handle the wheel encoders I'm using. Has anybody already ported over to the maple board using rosserial? If so can somebody point me to the code. Or maybe shed some light on how to integrate the rosserial_client with the Maple IDE like what they did for the Arduino?

This is my current set of code for the rosserial_client, but I think there is an error with the read/write because the terminal just pops out the message "Lost sync with device, restarting... " after I initialize the node using "rosrun rosserial_python serial_node.py /dev/ttyUSB0".

I have also attempted the Serial2.write() function inplace of the print that I have now and get a different error, which is "Failed to parse subscriber. unpack requires a string argument of length 4" Any help/insight would be appreciated.

*#ifndef MAPLEHARDWARE_H_
#define MAPLEHARDWARE_H_

#include "WProgram.h"
#include <HardwareSerial.h>

class MapleHardware {
public:

MapleHardware(){
baud_ =  57600;
}

void init(){
Serial2.begin(baud_);
}

}
else{return -1;}
}

void write(uint8_t* data, int length){
for(int i=0; i<length; i++) Serial2.write(data[i]);
}

unsigned long time(){return millis();}

protected:
uint32 baud_;
};

#endif

edit retag close merge delete

Never mind I found the http://www.ros.org/wiki/rosserial_client/Tutorials/Porting%20ROSSerial%20Client which is what I was needing to understand. It just was not under the tutorials for the overall package just under the rosserial_client package.
( 2011-09-30 08:01:46 -0500 )edit
If that is a good "answer" to your question, please post it as an answer and one of the admins can come along and mark it as accepted.
( 2011-09-30 12:39:55 -0500 )edit

Sort by » oldest newest most voted

I found the http://www.ros.org/wiki/rosserial_client/Tutorials/Porting%20ROSSerial%20Client which is what I was needing to understand. It was not under the tutorials for the overall package, but instead just under the rosserial_client package.

more

When did you checkout the code? There was a ros.h accidently checked in until Sep 18th -- but there shouldn't now be any arduino-related code in rosserial_client, if you find something, please file a ticket to have it removed.

more