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

Arduino rosserial problem compilation

asked 2013-07-02 05:13:51 -0600

monidiaz gravatar image

updated 2013-07-05 05:13:30 -0600

Hello , i'm trying to compile the examples for Arduino, for example the Hello_World (or whatever) and i got this error:

HelloWorld.pde:-1: error: ‘ros’ has not been declared
HelloWorld.pde:-1: error: expected constructor, destructor, or type conversion before ‘nh’
HelloWorld.pde:-1: error: ‘std_msgs’ has not been declared
HelloWorld.pde:-1: error: expected constructor, destructor, or type conversion before ‘str_msg’
HelloWorld.pde:-1: error: ‘ros’ has not been declared
HelloWorld.pde:-1: error: expected constructor, destructor, or type conversion before ‘chatter’
HelloWorld.cpp: In function ‘void setup()’:
HelloWorld.pde:-1: error: ‘nh’ was not declared in this scope
HelloWorld.pde:-1: error: ‘chatter’ was not declared in this scope
HelloWorld.cpp: In function ‘void loop()’:
HelloWorld.pde:-1: error: ‘str_msg’ was not declared in this scope
HelloWorld.pde:-1: error: ‘chatter’ was not declared in this scope
HelloWorld.pde:-1: error: ‘nh’ was not declared in this scope

i'm working on ROS Electric, I really Need Help!

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2013-07-02 13:13:36 -0600

updated 2013-07-02 13:17:58 -0600

The ros_lib should be installed in your Arduino "sketchbook/libraries". You will have to make the libraries folder and the sketchbook should automatically be generated in the home directory after the Arduino IDE is opened once. Using this command mkdir -p ~/sketchbook/libraries and then cd ~/sketchbook/libraries to should get you into the right folder. To install the ros_lib in the sketchbook use rosrun rosserial_arduino make_libraries.py . As davinci said this is in the setup.

edit flag offensive delete link more

Comments

it's dosn't work :/ when i ran rosrun rosserial_arduino make_libraries.py i got this error [rosrun] Couldn't find executable named make_libraries.py below /opt/ros/electric/stacks/rosserial/rosserial_arduino

monidiaz gravatar image monidiaz  ( 2013-07-03 05:00:23 -0600 )edit

Try installing rosserial from source.

tonybaltovski gravatar image tonybaltovski  ( 2013-07-03 06:19:39 -0600 )edit
1

answered 2013-07-02 06:32:04 -0600

davinci gravatar image

Did you follow all the steps in the setup? And copied the libraries? Seems that it can't find your libraries.

edit flag offensive delete link more

Comments

yes, i did't por that i don't know what it's going wrong.

monidiaz gravatar image monidiaz  ( 2013-07-02 06:34:55 -0600 )edit

suppose that the opt/ros/electric/stacks/rosserial/rosserial_arduino/libraries/ros_lib it's copied on the sketchbook folder

monidiaz gravatar image monidiaz  ( 2013-07-02 06:35:58 -0600 )edit

Question Tools

Stats

Asked: 2013-07-02 05:13:51 -0600

Seen: 1,646 times

Last updated: Jul 05 '13