Commit 7b24969d authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

fix for ROS < NOETIC

parent 8d909c00
Pipeline #17059 passed with stage
in 3 minutes and 18 seconds
......@@ -56,10 +56,13 @@ ADD_PROJECT_DEPENDENCY(control_toolbox REQUIRED)
# Detect the controller interface version to switch code
if(controller_interface_FOUND)
if (${controller_interface_VERSION} VERSION_GREATER "0.2.5")
if(${controller_interface_VERSION} VERSION_GREATER "0.2.5")
add_definitions(-DCONTROLLER_INTERFACE_KINETIC)
endif(${controller_interface_VERSION} VERSION_GREATER "0.2.5")
endif(controller_interface_FOUND)
if(${controller_interface_VERSION} VERSION_GREATER "0.19.0")
add_definitions(-DCONTROLLER_INTERFACE_NOETIC)
endif()
endif()
endif()
# Detect if temperature sensor controller package is found
# if yes then it is a PAL Robotics Forked code.
......@@ -77,7 +80,7 @@ target_link_libraries(rcsot_controller
sot-core::sot-core
dynamic_graph_bridge::sot_loader
${control_toolbox_LIBRARIES})
if (temperature_sensor_controller_FOUND)
if(temperature_sensor_controller_FOUND)
target_compile_definitions(rcsot_controller PUBLIC TEMPERATURE_SENSOR_CONTROLLER)
message("temperature_sensor_controller_LIBRARIES: ${temperature_sensor_controller_LIBRARIES}")
target_include_directories(rcsot_controller SYSTEM PUBLIC ${temperature_sensor_controller_INCLUDE_DIRS})
......
......@@ -172,7 +172,11 @@ bool RCSotController::initInterfaces(lhi::RobotHW *robot_hw, ros::NodeHandle &,
lns = "hardware_interface";
// Check if construction finished cleanly
#ifdef CONTROLLER_INTERFACE_NOETIC
if (state_ != ControllerState::CONSTRUCTED) {
#else
if (state_ != CONSTRUCTED) {
#endif
ROS_ERROR("Cannot initialize this controller because it "
"failed to be constructed");
}
......@@ -319,8 +323,11 @@ bool RCSotController::initInterfaces(lhi::RobotHW *robot_hw, ros::NodeHandle &,
if (verbosity_level_ > 0)
ROS_INFO_STREAM("Initialization of sot-controller Ok !");
// success
#ifdef CONTROLLER_INTERFACE_NOETIC
state_ = ControllerState::INITIALIZED;
#else
state_ = INITIALIZED;
#endif
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment