Skip to content

Commit

Permalink
Merge pull request #12 from jmirabel/master
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
jmirabel authored Jan 30, 2020
2 parents cdd3d34 + 79bef28 commit fcea7cd
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 16 deletions.
34 changes: 19 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ INCLUDE(cmake/cxx11.cmake)
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})

OPTION(COMPILE_AND_INSTALL_BINARIES "Set this to OFF to install only message and service files" ON)

## Compile as C++11, supported in ROS Kinetic and newer
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
if(NOT COMPILER_SUPPORTS_CXX11)
Expand All @@ -36,7 +38,7 @@ find_package(catkin REQUIRED COMPONENTS

find_package(OpenCV REQUIRED)

ADD_REQUIRED_DEPENDENCY(visp)
ADD_REQUIRED_DEPENDENCY("visp >= 3.2.0")

add_message_files(
FILES
Expand All @@ -60,23 +62,25 @@ generate_messages(

catkin_package()

add_subdirectory(src/tracker_object)
##add_subdirectory(src/extrinsic_calibration)
add_subdirectory(tests)
if(COMPILE_AND_INSTALL_BINARIES)
add_subdirectory(src/tracker_object)
##add_subdirectory(src/extrinsic_calibration)
add_subdirectory(tests)

SET(${PROJECT_NAME}_HEADERS
include/agimus_vision/extrinsic_calibration/extrinsic_calibration.hpp
include/agimus_vision/extrinsic_calibration/node.hpp

SET(${PROJECT_NAME}_HEADERS
include/agimus_vision/extrinsic_calibration/extrinsic_calibration.hpp
include/agimus_vision/extrinsic_calibration/node.hpp
include/agimus_vision/tracker_object/detector.hpp
include/agimus_vision/tracker_object/detector_apriltag.hpp
include/agimus_vision/tracker_object/detector_chessboard.hpp
include/agimus_vision/tracker_object/node.hpp
)

include/agimus_vision/tracker_object/detector.hpp
include/agimus_vision/tracker_object/detector_apriltag.hpp
include/agimus_vision/tracker_object/detector_chessboard.hpp
include/agimus_vision/tracker_object/node.hpp
)
catkin_install_python(PROGRAMS scripts/simulate.py scripts/calibrate_real_joint.py scripts/publish_real_joint.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
endif(COMPILE_AND_INSTALL_BINARIES)

install(DIRECTORY objects launch config data
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

catkin_install_python(PROGRAMS scripts/simulate.py scripts/calibrate_real_joint.py scripts/publish_real_joint.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
1 change: 1 addition & 0 deletions src/tracker_object/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ target_include_directories(${PROJECT_NAME}_tracker_object_lib SYSTEM PUBLIC
${catkin_INCLUDE_DIRS}
${OPENCV_INCLUDE_DIRS}
)
PKG_CONFIG_USE_DEPENDENCY(${PROJECT_NAME}_tracker_object_lib visp)

target_link_libraries(${PROJECT_NAME}_tracker_object_lib
${catkin_LIBRARIES}
Expand Down
1 change: 0 additions & 1 deletion src/tracker_object/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ void Node::imageProcessing()

if( _broadcast_topic )
_publisherVision.publish( cMo_msg );
cMo_msg.child_frame_id += _broadcast_tf_postfix;
if( _broadcast_tf )
broadcaster.sendTransform( cMo_msg );
}
Expand Down
10 changes: 10 additions & 0 deletions src/tracker_object/tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,17 @@ ModelBased::ModelBased(int trackerType,
{
tracker().setTrackerType(trackerType);
if (!configFile.empty())
#if VISP_VERSION_INT >= VP_VERSION_INT(3,2,1)
tracker().loadConfigFile(configFile);
#else
#define _STRINGIFY(x) #x
#define _TOSTRING(x) _STRINGIFY(x)
std::cerr << "Cannot load ViSP config file " << configFile << " because "
"installed ViSP version (" _TOSTRING(VISP_VERSION) ") is inferior to 3.2.1."
<< std::endl;
#undef _TOSTRING
#undef _STRINGIFY
#endif

// camera calibration params
tracker().setCameraParameters(cam);
Expand Down

0 comments on commit fcea7cd

Please sign in to comment.