ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Rosserial with the Maple IDE

asked 2011-09-30 07:18:42 -0500

D_mangus gravatar image

updated 2011-11-07 06:44:02 -0500

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 /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.


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

class MapleHardware {

    baud_ =  57600; 

void init(){

int read(){
  numUnread = Serial2.available();

  if (numUnread > 0) {
  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();}

uint32 baud_;
int numUnread;

edit retag flag offensive close merge delete


Never mind I found the 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.
D_mangus gravatar image D_mangus  ( 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.
Eric Perko gravatar image Eric Perko  ( 2011-09-30 12:39:55 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2011-10-07 06:12:41 -0500

D_mangus gravatar image

I found the 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.

edit flag offensive delete link more

answered 2011-10-07 10:24:43 -0500

fergs gravatar image

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.

edit flag offensive delete link more

Question Tools


Asked: 2011-09-30 07:18:42 -0500

Seen: 675 times

Last updated: Nov 07 '11