ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

rplidar_ros fails to build MacOS X

asked 2019-01-14 12:38:29 -0500

cr055 gravatar image

updated 2019-01-14 12:39:14 -0500

Dear ROS community,

while trying to build the rplidar_ros package in the catkin_ws I get the following error:

Scanning dependencies of target rplidarNodeClient
Scanning dependencies of target rplidarNode
[ 11%] Building CXX object CMakeFiles/rplidarNodeClient.dir/src/client.cpp.o
[ 33%] Building CXX object CMakeFiles/rplidarNode.dir/sdk/src/arch/macOS/net_serial.cpp.o
[ 33%] Building CXX object CMakeFiles/rplidarNode.dir/src/node.cpp.o
[ 44%] Building CXX object CMakeFiles/rplidarNode.dir/sdk/src/arch/macOS/net_socket.cpp.o
[ 55%] Building CXX object CMakeFiles/rplidarNode.dir/sdk/src/arch/macOS/timer.cpp.o
[ 66%] Building CXX object CMakeFiles/rplidarNode.dir/sdk/src/hal/thread.cpp.o
[ 77%] Building CXX object CMakeFiles/rplidarNode.dir/sdk/src/rplidar_driver.cpp.o
In file included from /Users/alessandrodortenzio/catkin_ws/src/rplidar_ros/sdk/src/rplidar_driver.cpp:41:
/Users/alessandrodortenzio/catkin_ws/src/rplidar_ros/./sdk/src/hal/locker.h:102:21: error: use of undeclared
      identifier 'pthread_mutex_timedlock'
            switch (pthread_mutex_timedlock(&_lock,&wait_time))
1 error generated.
make[2]: *** [CMakeFiles/rplidarNode.dir/sdk/src/rplidar_driver.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 88%] Linking CXX executable /Users/alessandrodortenzio/catkin_ws/devel_isolated/rplidar_ros/lib/rplidar_ros/rplidarNodeClient
[ 88%] Built target rplidarNodeClient
make[1]: *** [CMakeFiles/rplidarNode.dir/all] Error 2
make: *** [all] Error 2
<== Failed to process package 'rplidar_ros':
  Command '['/Users/alessandrodortenzio/catkin_ws/install_isolated/', 'make', '-j4', '-l4']' returned non-zero exit status 2

Reproduce this error by running:
==> cd /Users/alessandrodortenzio/catkin_ws/build_isolated/rplidar_ros && /Users/alessandrodortenzio/catkin_ws/install_isolated/ make -j4 -l4

By looking online I have found out that the methods causing the errors are not available in the OS X environment. Although, on the rplidar github page they have listed the OS X as a supported operative system.

My question is, what am I doing wrong? Is there any workaround for this error?

Thanks in advance for your time.



edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-01-15 18:12:22 -0500

cr055 gravatar image

I have solved it by adding a definition in the CMakeLists.txt "add_definitions(-D_MACOS)". I was actually compiling some linux libraries.

Although the package has compiled successfully, I still have troubles in having the rplidar running.

When I plug it into the USB port I can see it in the device list, but it doesn't show up in the /dev/tty list.

Any idea?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-01-14 12:38:29 -0500

Seen: 229 times

Last updated: Jan 15 '19