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

rosserial_arduino and Arduino IDE 1.0 rc2

asked 2011-11-03 09:50:48 -0500

mcsmith gravatar image

updated 2014-01-28 17:10:42 -0500

ngrennan gravatar image

I'm a newbie to ROS, rosserial and Arduino. Nonetheless, I'm trying my hand at doing some development. When I tried to compile the rosserial_arduino example for HelloWorld using the Arduino IDE (1.0 rc2), it wouldn't compile as a result of the renaming of "Wprogram.h" to "Arduino.h". I solved the problem by editing ArduinoHardware.h to replace:

#include <Wprogram.h>

with:

#if ARDUINO>=100
#include <Arduino.h> // Arduino 1.0
#else
#include <Wprogram.h> // Arduino 0022
#endif

Hopefully (1) this is the preferred solution and (2) it gets propagated into the rosserial package.

edit retag flag offensive close merge delete

Comments

This is cool, man. Thanks a lot!

AzureViolin gravatar image AzureViolin  ( 2012-03-20 19:08:11 -0500 )edit

4 Answers

Sort by ยป oldest newest most voted
0

answered 2011-11-03 12:11:38 -0500

fergs gravatar image

Thanks for the patch -- in the future, feel free to file a ticket on our Kforge Trac: https://kforge.ros.org/rosserial/trac

edit flag offensive delete link more

Comments

Is there a plan to push this fix out in the debs? Still seems to be broken in ros-fuerte-rosserial.

mikepurvis gravatar image mikepurvis  ( 2012-08-16 04:56:47 -0500 )edit
0

answered 2012-12-05 06:12:33 -0500

DrBot gravatar image

My workaround was much simpler. In the .../ardiuno_1.0.?/hardware/arduino/cores/arduino directory: cp Arduino.h WProgram.h after this the string test compiled. I have no idea if it will actually work with ROS, but a step forward.

edit flag offensive delete link more
0

answered 2012-06-24 23:49:18 -0500

Kiara gravatar image

Thanks a lot! This has been very useful :)

edit flag offensive delete link more
0

answered 2012-08-16 05:31:51 -0500

Here's a workaround which allows you to use the rosserial_arduino debs unmodified:

  • In your package, add a file called hack/WProgram.h, with these contents:

#include "Arduino.h"

  • In CMakelists.txt, somewhere before the final macro call, add:

include_directories(hack ${ARDUINO_SDK_PATH}/hardware/arduino/variants/standard)

This should let you compile the package with cmake, and should be a forward-friendly fix for once rosserial is updated.

edit flag offensive delete link more

Comments

This isn't very helpful to me. I have no idea where to add the hack file, how to modify Cmake and how to recompile the package. The information about getting ROS and IDE 1.0 is confusing and contradictory. Not everyone re-compiles from source everyday.

DrBot gravatar image DrBot  ( 2012-12-05 05:53:01 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2011-11-03 09:50:48 -0500

Seen: 879 times

Last updated: Dec 05 '12