rplidar_ros fails to build MacOS X
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/env.sh', '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/env.sh 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.
Sincerely,
Alessandro