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

rosserial_arduino helloworld error

asked 2014-02-03 08:22:16 -0500

Charel gravatar image

Hi, could use some help to make rosserial_arduino work and have an arduino work with ROS for me. Have followed all the instructions, tested it on 2 different Arduino's but got the error below and I am out of ideas what I might be doing wrong. I am working on Fuerte, did get Fuerte branch from github (kforce giving errors), was able to rosbuild without errors, have copied ros_lib to sketchbook as instructed. But when compiling the helloword sketch I keep getting error below. Any clues? Thanks

  In file included from HelloWorld.pde:6:
/home/turtelbot/sketchbook/libraries/ros_lib/ros.h:38:29: error: ros/node_handle.h: No such file or directory
In file included from /home/turtelbot/sketchbook/libraries/ros_lib/ros.h:39,
                 from HelloWorld.pde:6:
/home/turtelbot/sketchbook/libraries/ros_lib/ArduinoHardware.h:38:22: error: WProgram.h: No such file or directory
In file included from /home/turtelbot/sketchbook/libraries/ros_lib/ros.h:39,
                 from HelloWorld.pde:6:
/home/turtelbot/sketchbook/libraries/ros_lib/ArduinoHardware.h: In member function ‘long unsigned int ArduinoHardware::time()’:
/home/turtelbot/sketchbook/libraries/ros_lib/ArduinoHardware.h:73: error: ‘millis’ was not declared in this scope
In file included from HelloWorld.pde:6:
/home/turtelbot/sketchbook/libraries/ros_lib/ros.h: At global scope:
/home/turtelbot/sketchbook/libraries/ros_lib/ros.h:49: error: expected initializer before ‘<’ token
HelloWorld:9: error: ‘NodeHandle’ in namespace ‘ros’ does not name a type
HelloWorld:11: error: ‘std_msgs’ has not been declared
HelloWorld:11: error: expected constructor, destructor, or type conversion before ‘str_msg’
HelloWorld:12: error: ‘Publisher’ in namespace ‘ros’ does not name a type
HelloWorld.pde: In function ‘void setup()’:
HelloWorld:18: error: ‘nh’ was not declared in this scope
HelloWorld:19: error: ‘chatter’ was not declared in this scope
HelloWorld.pde: In function ‘void loop()’:
HelloWorld:24: error: ‘str_msg’ was not declared in this scope
HelloWorld:25: error: ‘chatter’ was not declared in this scope
HelloWorld:26: error: ‘nh’ was not declared in this scope
edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
1

answered 2014-02-09 06:24:06 -0500

Charel gravatar image

I gave up on Fuerte. Have it now running, using Groovy with Catkin. Now it works for both my Arduino Uno and Arduino ATMega.

edit flag offensive delete link more
0

answered 2015-02-18 15:53:44 -0500

The first line gives the answer.

When you download the Git repository the arduino library folder does not include the node_handle.h file (which is silly!)

Go to the serial client file and copy the 'ros' file and paste the into 'ros_lib' in the arduino library file. That should help the compiler find the file.

I found this thread because I had the same error. I did the above and I was able to solve the "‘NodeHandle’ in namespace ‘ros’ does not name a type" error.

Unfortunately... there are other missing files to gather...

edit flag offensive delete link more

Comments

the "missing files" are supposed to get copied during the build step (make_libraries.py)

fergs gravatar image fergs  ( 2015-03-13 01:38:38 -0500 )edit
0

answered 2014-02-06 20:14:18 -0500

fergs gravatar image

The WProgram.h issue is because the fuerte branch of rosserial is quite old, and is not updated for Arduino 1.0 or later. The other errors may or may not be related, but I'd suggest downgrading Arduino and seeing what errors continue to be present.

edit flag offensive delete link more

Comments

Thanks for your reply! good idea, tested it on Arduino ide 1.0 but same error. Is there somewhere a Fuerte branch that is maintained for more recent Arduino versions?

Charel gravatar image Charel  ( 2014-02-07 22:47:43 -0500 )edit

The fuerte branch is *not* updated for 1.0, hence you need to use Arduino 0022, or earlier. To my knowledge there is not a more recent fuerte branch.

fergs gravatar image fergs  ( 2014-02-08 09:42:22 -0500 )edit

Tested it with Adruino 0022 and some earlier versions, also errors. Gave up on Fuerte.

Charel gravatar image Charel  ( 2014-02-09 06:21:00 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-02-03 08:22:16 -0500

Seen: 1,299 times

Last updated: Feb 09 '14