Skip to content

Commit

Permalink
Merge pull request #1792 from Nicogene/fixRplidar2
Browse files Browse the repository at this point in the history
Fix rplidar2 compilation
  • Loading branch information
drdanz authored Jul 12, 2018
2 parents 39aff63 + 638445f commit 03a276c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ before_script:
# OpenCV on travis is built with C++98 ABI.
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then if [ "$CC" == "clang" ]; then export YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -DYARP_USE_OPENCV=OFF"; fi; fi

# Build rplidar2 on linux
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -D-DENABLE_yarpmod_rpLidar2=ON"; fi

# Avoid building Qt5 guis twice on macOS.
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -DYARP_DISABLE_OSX_BUNDLES=ON"; fi

Expand Down
6 changes: 6 additions & 0 deletions doc/release/v3_0_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ Bug Fixes
* Fixed double free during the closure. It has been introduced by #1685
(commit 02abf63).

### Devices

#### rplidar2

* Fixed compilation (#1689).

Contributors
------------

Expand Down
6 changes: 5 additions & 1 deletion extern/rplidar/sdk/src/rplidar_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,11 @@ u_result RPlidarDriverSerialImpl::grabScanData(rplidar_response_measurement_node
{
switch (_dataEvt.wait(timeout))
{
case rp::hal::Event::EVENT_TIMEOUT:
// This static cast is necessary for the compilation
// because the return value of "wait(..)"
// is unsigned but EVENT_TIMEOUT = -1. We will keep
// it until they will fix the bug in the sdk.
case static_cast<ulong> (rp::hal::Event::EVENT_TIMEOUT):
count = 0;
return RESULT_OPERATION_TIMEOUT;
case rp::hal::Event::EVENT_OK:
Expand Down
3 changes: 2 additions & 1 deletion src/devices/rpLidar2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
yarp_prepare_plugin(rpLidar2
CATEGORY device
TYPE RpLidar2
INCLUDE rpLidar2.h)
INCLUDE rpLidar2.h
DEPENDS "NOT APPLE")

if(NOT SKIP_rpLidar2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
Expand Down

0 comments on commit 03a276c

Please sign in to comment.