I am using OSX 10.7.3 with Arduino IDE 1.0
When I followed the directions to install rosserial from source, I did: hg clone https://kforge.ros.org/rosserial/hg rosserial. Everything compiled and I copied the ros_lib folder to my Arduino/Library folder. However when I try to compile any of the included example program (e.g., Hello World), it fails with the following error:
In file included from /Users/kevin/Documents/Arduino/libraries/ros_lib/ros.h:39,
from HelloWorld.cpp:6:
/Users/kevin/Documents/Arduino/libraries/ros_lib/ArduinoHardware.h:38:22: error: WProgram.h: No such file or directory
In file included from /Users/kevin/Documents/Arduino/libraries/ros_lib/ros.h:39,
from HelloWorld.cpp:6:
/Users/kevin/Documents/Arduino/libraries/ros_lib/ArduinoHardware.h: In member function 'long unsigned int ArduinoHardware::time()':
/Users/kevin/Documents/Arduino/libraries/ros_lib/ArduinoHardware.h:73: error: 'millis' was not declared in this scope
A quick look at the release notes for Arduino says:
The WProgram.h file, which provides declarations for the Arduino API, has been renamed to Arduino.h. To create a library that will work in both Arduino 0022 and Arduino 1.0, you can use an #ifdef that checks for the ARDUINO constant, which was 22 and is now 100. For example:
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
Am I grabbing out dated code from the wrong CVS??? This change to Arduino was made a while ago, so I don't understand how I am the first to find it. Thanks!
[UPDATE 1]
I loaded the "hello world" sketch onto my Arduino, but now it crashes with :
[kevin@TARDIS ~]$ rosrun rosserial_python serial_node.py /dev/cu.usbserial-A4001lNd
Traceback (most recent call last):
File "/Users/kevin/ros_sandbox/rosserial/rosserial_python/nodes/serial_node.py", line 40, in <module>
from rosserial_python import SerialClient
File "/Users/kevin/ros_sandbox/rosserial/rosserial_python/src/rosserial_python/__init__.py", line 1, in <module>
from SerialClient import *
File "/Users/kevin/ros_sandbox/rosserial/rosserial_python/src/rosserial_python/SerialClient.py", line 42, in <module>
from serial import *
ImportError: No module named serial
Am I missing a dependency?
[UPDATE 2]
I figured out I needed to do:
pip install pyserial
But now it fails with:
[kevin@TARDIS rosserial]$ rosrun rosserial_python serial_node.py /dev/cu.usbserial-A4001lNd
[INFO] [WallTime: 1330658506.244201] ROS Serial Python Node
[INFO] [WallTime: 1330658506.251605] Connected on /dev/cu.usbserial-A4001lNd at 57600 baud
[INFO] [WallTime: 1330658508.750410] Note: publish buffer size is 280 bytes
[INFO] [WallTime: 1330658508.750905] Setup publisher on chatter [std_msgs/String]
[INFO] [WallTime: 1330658512.739698] Packet Failed : Failed to read msg data
[INFO] [WallTime: 1330658517.747113] Packet Failed : Failed to read msg data
[INFO] [WallTime: 1330658519.745485] Packet Failed : Failed to read msg data
[INFO] [WallTime: 1330658526.749475] Packet Failed : Failed to read msg data
[INFO] [WallTime: 1330658529.758370] Packet Failed : Failed to read msg data
Traceback (most recent call last):
File "/Users/kevin/ros_sandbox/rosserial/rosserial_python/nodes/serial_node.py", line 58, in <module>
client.run()
File "/Users/kevin/ros_sandbox/rosserial/rosserial_python/src/rosserial_python/SerialClient.py", line 280, in run
checksum = sum(map(ord,header) ) + sum(map(ord, msg)) + ord(chk)
TypeError: ord() expected a character, but string of length 0 found
So what is this?
We've been aware that this needs to change in rosserial for a while; see https://kforge.ros.org/rosserial/trac/ticket/49 and apply the patch there.
Asked: 2012-02-28 21:35:30 -0500
Seen: 1,087 times
Last updated: Mar 01 '12
rosserial_arduino compiling problems on OS X
Error building geometry stack in OSX
Compilation error building Rviz on OSX Lion
ROS install errors on Lion using Homebrew
Building Ogre fails on Osx Lion
Rosmake rosconsole fail on OSx Lion
netpbm fails to install when installing with Homebrew on OS X
ROS Answers is licensed under Creative Commons Attribution 3.0 Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.