Rosanswers logo

Hi, I'm relatively new to ROS, and I'm using the catkin build system with ros-groovy. I am following the instructions on

https://github[dot]com/ros-drivers/rosserial (sorry, I can't post links)

in order to get rosserial for the arduino working. I followed all the steps in the readme. Specifically, I ran the following commands:

cd <ws>/src
git clone <https://github[dot]com/ros-drivers/rosserial>
cd <ws>
catkin_make install
source <ws>/install/setup.bash
cd <sketchbook>/libraries
rosrun rosserial_arduino make_libraries.py .

and make_libraries.py runs successfully (with no error messages). However, it does not generate the ros directory in the <sketchbook>/libraries/ros_lib folder. The consequence of this is that when my Arduino code attempts to load ros.h, the #include statement for ros/node_handle.h fails when I try to compile the "hello world" example in the Arduino IDE. Thus, I am unable to proceed further.

Here is the output of <sketchbook>/libraries/ros_lib$ ls after I run <sketchbook>/libraries/$ rosrun rosserial_arduino make_libraries.py .:

actionlib            gazebo           roscpp             stereo_msgs
actionlib_msgs       gazebo_msgs      roscpp_tutorials   tests
actionlib_tutorials  gazebo_plugins   rosgraph_msgs      tf
ArduinoHardware.h    geometry_msgs    ros.h              tf2_msgs
base_local_planner   laser_assembler  rospy_tutorials    theora_image_transport
bond                 move_base_msgs   rosserial_arduino  topic_tools
cmr_drive            navfn            rosserial_msgs     trajectory_msgs
costmap_2d           nav_msgs         sensor_msgs        turtle_actionlib
diagnostic_msgs      nodelet          shape_msgs         turtlesim
driver_base          pcl              smach_msgs         visualization_msgs
dynamic_reconfigure  polled_camera    std_msgs
examples             robot_pose_ekf   std_srvs

Note: cmr_drive contains custom message files.

This is my second attempt to do this. I tried once and then started from scratch, because I figured I must have screwed something up. I even tried copying the ros directory from elsewhere on the hard drive (I think I may have taken it from the apt-get version of rosserial that I installed in addition to the git clone version) but then that caused a bunch of strange errors. Namely, when I ran the code, I got an error saying Failed to create subscriber: unpack requires a string argument of length 4.

I realize that this has not been fully updated for the catkin build system and ROS groovy (since I see references to rosmake in several of the tutorials) but like I said, I'm unable to use the code with the Arduino at this point and it would be awesome if you guys could help.

EDIT: Thanks for taking the time to respond, fergs. I'm using Ubuntu 12.04 as well, x64 version.

The contents of ros_lib/tf are FrameGraph.h and tfMessage.h. I think I see the significance of this; my tf folder is totally different than the one that is supposed to get copied from the rosserial_client directory. It appears that there is some sort of naming conflict. The question is: why is this conflict arising? I don't know where that tf directory is coming from.

When I run make_libraries.py, the following occurs:


Exporting polled_camera


Exporting cmr_drive

DriveCommands, Exporting tf



Exporting robot_pose_ekf



Interestingly, there is no spacing between cmr_drive (my custom command) and the Exporting tf. Perhaps that is notable?

Originally posted by duffany1 on ROS Answers with karma: 173 on 2013-02-26

Post score: 0

Original comments

Comment by fergs on 2013-02-27:
If you remove cmd_drive package from your path, does make libraries succeed?

Comment by duffany1 on 2013-02-27:
Nope; it still doesn't generate the ros directory.

Comment by fergs on 2013-02-27:
Ok, so I've realized that I was looking in the wrong place, make_libraries is working OK since you have ros.h -- can you check that /install/share/rosserial_arduino/src/ros_lib has no ros or tf folders? If so, then the problem is in during catkin_make

Comment by fergs on 2013-02-27:
Ok, so I've realized that I was looking in the wrong place, make_libraries is working OK since you have ros.h -- can you check that /install/share/rosserial_arduino/src/ros_lib has no ros or tf folders?

Comment by duffany1 on 2013-02-28:
fergs, I got it to work; there was probably a mistake on my part. The problem was that I wasn't running the source command after running catkin_make install. I figured I didn't need to since I had that command already in my bashrc file... Sorry about any alarm I caused :/

Comment by fergs on 2013-02-28:
In the future, I would suggest only posting the exact commands you ran -- you said in your original post you had sourced install/setup.bash so I didn't point it out. Just glad to hear we don't have some very, very mysterious bug to sort out!

Comment by fergs on 2013-02-28:
Updated my answer to explain why failing to source install/setup.bash causes this.


1 Answer 1


Rosanswers logo

Be sure to run "source /install/setup.bash" otherwise you'll get ros_lib directory as it is in the rosserial_arduino source -- which is missing the files that are installed from rosserial_client.

Originally posted by fergs with karma: 13902 on 2013-02-26

This answer was ACCEPTED on the original site

Post score: 1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.