Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
build
include/whycon/config.h
papers
Calib_Results*
whycon.config
whycon.creator*
whycon.includes
whycon.files
doc
images
*.m
TODO
videos
wiki
.vscode/
21 changes: 0 additions & 21 deletions .gitlab-ci.yml

This file was deleted.

184 changes: 80 additions & 104 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,125 +1,101 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.8)
project(whycon)

# set some flags
add_definitions(-std=c++11)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELEASE} -Wall -g -O4 -march=native -Wfatal-errors")
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELEASE} -Wall -O0 -g -Wfatal-errors")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake-configs")
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# set some options
option(DISABLE_ROS "Do not build for ROS, but as standalone code" OFF)
option(ENABLE_FULL_UNDISTORT "Undistort the whole frame" OFF)
option(ENABLE_RANDOMIZED_THRESHOLD "Use rand() instead of binary-like search for threshold" OFF)
option(ENABLE_VERBOSE "Enable verbose console messages during detection" OFF)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/include/whycon/config.h)

#### ROS CONFIGURATION ####
if(NOT DISABLE_ROS)
find_package(catkin REQUIRED COMPONENTS
cv_bridge
roscpp
sensor_msgs
std_msgs
camera_info_manager
message_generation
geometry_msgs
message_filters
image_geometry
image_transport
angles
visualization_msgs
tf
nodelet
std_srvs
)

add_message_files(
FILES
Projection.msg
)

generate_messages(
DEPENDENCIES geometry_msgs
)

catkin_package(
INCLUDE_DIRS include
LIBRARIES whycon
CATKIN_DEPENDS cv_bridge roscpp sensor_msgs std_msgs message_runtime geometry_msgs
)
endif()

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(camera_info_manager REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(image_geometry REQUIRED)
find_package(image_transport REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(std_srvs REQUIRED)

### SYSTEM DEPENDENCIES ###
find_package(OpenCV REQUIRED)
message(STATUS "Using OpenCV version ${OpenCV_VERSION}")
find_package(Boost COMPONENTS program_options thread system REQUIRED)

find_package(PkgConfig)
pkg_check_modules(YAML_CPP yaml-cpp)

### TARGETS ###
include_directories(
${catkin_INCLUDE_DIRS} ${YAML_CPP_INCLUDE_DIRS} include
)
include_directories(include)

add_library(whycon SHARED src/lib/circle_detector.cpp src/lib/many_circle_detector.cpp src/lib/localization_system.cpp)
target_link_libraries(whycon ${OpenCV_LIBS} ${Boost_LIBRARIES})

if(NOT DISABLE_ROS)
add_executable(whycon-node src/ros/whycon_node.cpp src/ros/whycon_ros.cpp)
set_target_properties(whycon-node PROPERTIES OUTPUT_NAME whycon)

add_library(whycon_nodelet src/ros/whycon_nodelet.cpp src/ros/whycon_ros.cpp)

add_executable(set_axis src/ros/set_axis_node.cpp src/ros/set_axis.cpp)
#add_executable(triangulator src/ros/triangulator_node.cpp src/ros/triangulator.cpp)
add_executable(robot_pose_publisher src/ros/robot_pose_publisher.cpp src/ros/robot_pose_publisher_node.cpp)
add_executable(transformer src/ros/transformer.cpp src/ros/transformer_node.cpp)

add_dependencies(whycon-node whycon_generate_messages_cpp)
add_dependencies(whycon_nodelet whycon_generate_messages_cpp)
add_dependencies(set_axis whycon_generate_messages_cpp)
#add_dependencies(triangulator whycon_generate_messages_cpp)
add_dependencies(robot_pose_publisher whycon_generate_messages_cpp)
add_dependencies(transformer whycon_generate_messages_cpp)

target_link_libraries(whycon-node ${catkin_LIBRARIES} ${YAML_CPP_LIBRARIES} whycon)
target_link_libraries(whycon_nodelet ${catkin_LIBRARIES} ${YAML_CPP_LIBRARIES} whycon)
target_link_libraries(set_axis ${catkin_LIBRARIES} ${YAML_CPP_LIBRARIES} whycon)
target_link_libraries(transformer ${catkin_LIBRARIES} ${YAML_CPP_LIBRARIES} whycon)
#target_link_libraries(triangulator ${catkin_LIBRARIES} whycon)
target_link_libraries(robot_pose_publisher ${catkin_LIBRARIES} whycon)
else()
add_executable(whycon-main src/main.cpp)
set_target_properties(whycon-main PROPERTIES OUTPUT_NAME whycon)
target_link_libraries(whycon-main whycon)

add_executable(camera-calibrator src/camera_calibrator.cpp)
target_link_libraries(camera-calibrator ${OpenCV_LIBS})
endif()
target_link_libraries(whycon ${OpenCV_LIBS})

add_executable(whycon-node src/ros2/whycon_node.cpp src/ros2/whycon_ros.cpp)
set_target_properties(whycon-node PROPERTIES OUTPUT_NAME whycon)

ament_target_dependencies(whycon-node
rclcpp
camera_info_manager
sensor_msgs
geometry_msgs
tf2_geometry_msgs
tf2
cv_bridge
image_transport
image_geometry
std_srvs
)

target_link_libraries(whycon-node whycon)

### INSTALL ###

### Mark cpp header files for installation
if(NOT DISABLE_ROS)
install(DIRECTORY include/${PACKAGE_NAME}
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
## Mark executables and/or libraries for installation
install(TARGETS whycon whycon-node robot_pose_publisher #triangulator
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

## Mark executables and/or libraries for installation
install(FILES nodelets.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
else()
install(TARGETS whycon DESTINATION lib)
install(TARGETS whycon-main camera-calibrator DESTINATION bin)
install(DIRECTORY include/whycon DESTINATION include)
install(FILES cmake-configs/FindWhyCon.cmake DESTINATION share/cmake/Modules)
endif()

install(DIRECTORY include/
DESTINATION include/${PROJECT_NAME}
)
## Mark executables and/or libraries for installation
install(TARGETS
whycon
EXPORT export_${PROJECT_NAME}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
)

install(TARGETS whycon-node
DESTINATION lib/${PROJECT_NAME}
)

# Install launch files.
install(DIRECTORY
launch
DESTINATION share/${PROJECT_NAME}/
)

ament_export_dependencies(
cv_bridge
rclcpp
sensor_msgs
std_msgs
geometry_msgs
tf2_geometry_msgs
tf2
)

ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)

ament_export_include_directories(
include
)

ament_export_libraries(
whycon
)

ament_package()
22 changes: 0 additions & 22 deletions Doxyfile

This file was deleted.

58 changes: 12 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,73 +46,39 @@ Note that this .bib includes not only the references to the scientific works tha

## Installing WhyCon

The code can be compiled either as a ROS package (shared library) or in a standalone version.
The code can be compiled as a ROS 2 package

**NOTE**: while the standalone version includes a demo application, this demo is not actively maintained anymore and will probably be removed soon. The reference application is provided as a series of ROS nodes, which utilize the _WhyCon_ shared library. For an example of how to implement your own standalone application, see the ROS node.

Stable [releases](https://github.com/lrse/whycon/releases) are available periodically. Latest stable release can be downloaded by clicking [here](https://github.com/lrse/whycon/releases/latest).
Stable [releases](https://github.com/arunser/whycon2/releases) are available periodically. Latest stable release can be downloaded by clicking [here](https://github.com/arunser/whycon2/releases/latest).

For the latest development version (which should also work and may contain new experimental features) you can clone the repository directly.

### ROS
### ROS 2

Only LTS versions are targeted. At the moment, Indigo and Kinetic are targeted.
Only LTS versions are targeted. At the moment, only Humble is targeted.

#### Dependencies

It is recommended to install required dependencies using

rosdep install -y --from-path <path to whycon source package directory>

**NOTE**: it is recommended to use OpenCV 3 since it is actually latest stable version. In ROS Kinetic this is installed by default.
On ROS Indigo, you should install it by doing:

apt-get install ros-indigo-opencv3
sudo apt install ros-humble-usb-cam
sudo apt install ros-humble-image-view

#### Compilation

The main directory should be placed inside a catkin workspace source-space (e.g.: ~catkin_ws/src).
It can then be compiled simply by:

catkin_make

Or, if you are using catkin-tools

catkin build

### Standalone

**NOTE**: as previously mentioned, this version is not actively maintained and cannot provide support for it

The standalone version requires you to take care of installing the correct dependencies: OpenCV and Boost. If you are on Ubuntu, simply perform the following:

sudo apt-get install libopencv-dev libboost-all-dev

The installation process is really straightforward, as with any CMake based project.
Inside the main directory do:

mkdir build
cd build
cmake -DDISABLE_ROS=ON ..
make

The code can be installed to the system by doing:

make install

Note the default CMake location is `/usr/local`, but you can redefine this by invoking cmake in this way instead:
The main directory should be placed inside a colcon workspace source-space (e.g.: ~whycon_ws/src).
It can then be build using:

cd ~whycon_ws/
colcon build

cmake -DDISABLE_ROS=ON -DCMAKE_INSTALL_PREFIX=/usr ..

## Using WhyCon

Please refer to the [wiki](https://github.com/lrse/whycon/wiki).
Please refer to the [wiki](https://github.com/arunser/whycon2/wiki).

----

### Acknowledgements

The development of this work was supported by EU within its Seventh Framework Programme project ICT-600623 ``STRANDS''.
The Czech Republic and Argentina have given support through projects 7AMB12AR022, ARC/11/11 and 13-18316P.


38 changes: 0 additions & 38 deletions cite.bib

This file was deleted.

Loading