Skip to content

Commit

Permalink
rplidar2: fix compilation
Browse files Browse the repository at this point in the history
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.(fixes robotology#1689)
  • Loading branch information
Nicogene committed Jul 11, 2018
1 parent 39aff63 commit 30a74e4
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit 30a74e4

Please sign in to comment.