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

Unable to compile workspace for unsolved reference to serial::Serial::waitReadable

asked 2016-03-18 06:38:51 -0500

McKracken82 gravatar image

updated 2016-03-21 14:14:36 -0500

ahendrix gravatar image

Hi to all,

I'm kind of new to ROS and I'm having a problem while compiling the catkin workspace on my laptop. I'm using ROS Indigo on Ubuntu 14.04, and I'm trying to compile the irobotcreate2ros package (https://github.com/MirkoFerrati/irobotcreate2ros).

It requires the packages serial and joy to be installed. The problem is that when I compile the workspace, I received the following error:

CMakeFiles/basic_commands.dir/src/irobotcreate2/OpenInterface.cpp.o: In function irobot::OpenInterface::getSensorPackets(int):

OpenInterface.cpp:(.text+0xf3c): undefined reference to serial::Serial::waitReadable()

CMakeFiles/basic_commands.dir/src/irobotcreate2/OpenInterface.cpp.o: In function irobot::OpenInterface::streamSensorPackets():

OpenInterface.cpp:(.text+0x12a5): undefined reference to serial::Serial::waitReadable()

collect2: error: ld returned 1 exit status

make[2]: [/home/myhome/Projects/ros/indigo/catkin_ws/devel/lib/irobotcreate2/basic_commands] Error 1

make[1]: [irobotcreate2ros/CMakeFiles/basic_commands.dir/all] Error 2

make[1]: Waiting for unfinished jobs....

CMakeFiles/irobotcreate2_lightweight.dir/src/irobotcreate2/OpenInterface.cpp.o: In function irobot::OpenInterface::getSensorPackets(int):

OpenInterface.cpp:(.text+0xf3c): undefined reference to serial::Serial::waitReadable()

CMakeFiles/irobotcreate2_lightweight.dir/src/irobotcreate2/OpenInterface.cpp.o: In function irobot::OpenInterface::streamSensorPackets():

OpenInterface.cpp:(.text+0x12a5): undefined reference to serial::Serial::waitReadable()

collect2: error: ld returned 1 exit status

make[2]: [/home/myhome/Projects/ros/indigo/catkin_ws/devel/lib/irobotcreate2/irobotcreate2_lightweight] Error 1

make[1]: [irobotcreate2ros/CMakeFiles/irobotcreate2_lightweight.dir/all] Error 2

CMakeFiles/irobotcreate2.dir/src/irobotcreate2/OpenInterface.cpp.o: In function irobot::OpenInterface::getSensorPackets(int):

OpenInterface.cpp:(.text+0xf3c): undefined reference to serial::Serial::waitReadable()

CMakeFiles/irobotcreate2.dir/src/irobotcreate2/OpenInterface.cpp.o: In function irobot::OpenInterface::streamSensorPackets():

OpenInterface.cpp:(.text+0x12a5): undefined reference to serial::Serial::waitReadable()

collect2: error: ld returned 1 exit status

make[2]: [/home/myhome/Projects/ros/indigo/catkin_ws/devel/lib/irobotcreate2/irobotcreate2] Error 1

make[1]: [irobotcreate2ros/CMakeFiles/irobotcreate2.dir/all] Error 2

make: [all] Error 2

Invoking "make" failed

This makes me think that probably the compiler is not able to find the serial package. Now:

  1. The problem with serial is only related to the waitReadable() function, as if I comment it from the code, the rest of serial references do not rise any compilation error, and the process ends without problem (I've the right configuration of CMake. I know also because I'm using the same CMakeFile I used on other machines, that is the one provided within the package).
  2. I compiled this package (irobotcreate2ros) on other machines without problem, so maybe there's a wrong version of serial installed on my laptop. I went digging around on the internet, and I found that previous version of serial (http://rosindex.github.io/p/serial/), e.g. until v1.1.7, didn't have any waitReadable() method. I then checked which version was installed, and it says 1.2.1.
  3. To be completely sure, I also went through the code of serial.h in /opt/ros/indigo/include/serial/ to see if there was the waitReadable() method, and it's there (although there ...
(more)
edit retag flag offensive close merge delete

Comments

Would you edit your question adding the relevant parts of your CMakeLists.txt?

joq gravatar image joq  ( 2016-03-18 12:40:39 -0500 )edit
1

I usually see this kind of problem when you have an older version of the library hanging around on your system somewhere but you've compiled your code against the newer headers. For example: https://github.com/wjwwood/serial/iss...

William gravatar image William  ( 2016-03-18 13:03:08 -0500 )edit

I've added the CMakeList file. William, I think that's the problem. I realized I've different version of libserial.so around the system, but I'm not getting where catkin is getting the serial package when compiling, nor the libserial.so to link with. I've moved them around, but nothing changed.

McKracken82 gravatar image McKracken82  ( 2016-03-21 14:06:27 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-03-22 12:21:49 -0500

McKracken82 gravatar image

I found the problem. There was a version of serial inside one of the package in my workspace (it's a shared workspace), so that the proper version of serial was overridden by this one. I created a new workspace, and the irobotcreate2ros package compiled perfectly.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-03-18 06:38:51 -0500

Seen: 347 times

Last updated: Mar 22 '16