Skip to content

Commit

Permalink
Merge pull request #67 from suryaambrose/master
Browse files Browse the repository at this point in the history
Fix broken compilation with libqi-2.5

-std=gnu++11 is not mandatory as this flag will be added when importing libqi (ros-naoqi/libqi-release@c26f57e). This PR should therefore be enough to make naoqi_driver work with libqi2.3 and 2.5
  • Loading branch information
suryaambrose committed May 19, 2016
2 parents fdfc6f8 + 9f64731 commit 6a2faa4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists_catkin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ find_package(catkin COMPONENTS
find_package(OpenCV)
find_package(orocos_kdl)

add_definitions(-DLIBQI_VERSION=${naoqi_libqi_VERSION_MAJOR}${naoqi_libqi_VERSION_MINOR})

catkin_package(LIBRARIES naoqi_driver_module naoqi_driver)

if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
Expand Down
5 changes: 5 additions & 0 deletions include/naoqi_driver/tools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ enum DataType

} // naoqi

#if LIBQI_VERSION>24
QI_TYPE_ENUM(naoqi::Topics);
QI_TYPE_ENUM(naoqi::dataType::DataType);
#else
QI_TYPE_ENUM_REGISTER(naoqi::Topics);
QI_TYPE_ENUM_REGISTER(naoqi::dataType::DataType);
#endif

#endif
4 changes: 4 additions & 0 deletions src/external_registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ int main(int argc, char** argv)


// everything's correctly parsed - let's start the app!
#if LIBQI_VERSION>24
app.startSession();
#else
app.start();
#endif
boost::shared_ptr<naoqi::Driver> bs = boost::make_shared<naoqi::Driver>(app.session(), vm["namespace"].as<std::string>());

app.session()->registerService("ROS-Driver", bs);
Expand Down

0 comments on commit 6a2faa4

Please sign in to comment.