Skip to content

Commit

Permalink
Merge pull request #1599 from fspindle/feat_hand_eye_calibration
Browse files Browse the repository at this point in the history
Hand-in-eye and hand-to-eye calibration tools
  • Loading branch information
fspindle authored Mar 4, 2025
2 parents cb13c30 + 577f226 commit e96f847
Show file tree
Hide file tree
Showing 116 changed files with 3,559 additions and 1,620 deletions.
4 changes: 3 additions & 1 deletion ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ ViSP 3.x.x (Version in development)
https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-pf-curve-fitting.html
. New tutorial: Rendering a 3D scene with Ogre
https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-ogre.html
. New tutorial: Camera eye-to-hand extrinsic calibration
https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-calibration-extrinsic-eye-to-hand.html
- Bug fixed
. [#1251] Bug in vpDisplay::displayFrame()
. [#1270] Build issue around std::clamp and optional header which are not found with cxx17
Expand Down Expand Up @@ -327,7 +329,7 @@ ViSP 3.4.0 (released February 26, 2021)
. [#801] Build issue with visp_java
. [#803] Segfault with MBT and when a circle disappears
. [#806] Error running the Java sample with intel-mkl 2020.2.254-1
. [#808] vpVirtuose.cpp doen't build with Visual 2019 (vc16)
. [#808] vpVirtuose.cpp doesn't build with Visual 2019 (vc16)
. [#812] Online doc formula rendering issue with Ghostscript on OSX
. [#817] vpIoTools::getFileExtension prints "Debug sepIndex: 0" to std::cout
. [#818] Model-based tracking issue using RGBD-data on Windows
Expand Down
2 changes: 1 addition & 1 deletion apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ if(MSVC)
endif()
endif()

visp_add_subdirectory(calibration REQUIRED_DEPS visp_core visp_gui visp_io visp_robot visp_sensor visp_vision )
visp_add_subdirectory(calibration REQUIRED_DEPS visp_core visp_gui visp_io visp_robot visp_sensor visp_vision)
99 changes: 57 additions & 42 deletions apps/calibration/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,49 +1,64 @@
cmake_minimum_required(VERSION 3.10)

project(apps-calibration)

find_package(VISP REQUIRED visp_vision visp_io OPTIONAL_COMPONENTS visp_gui visp_robot visp_sensor)

set(apps_cpp
visp-compute-chessboard-poses.cpp
visp-compute-hand-eye-calibration.cpp
)
#############################################################################
#
# ViSP, open source Visual Servoing Platform software.
# Copyright (C) 2005 - 2025 by Inria. All rights reserved.
#
# This software is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# See the file LICENSE.txt at the root directory of this source
# distribution for additional information about the GNU GPL.
#
# For using ViSP with software that can not be combined with the GNU
# GPL, please contact Inria about acquiring a ViSP Professional
# Edition License.
#
# See https://visp.inria.fr for more information.
#
# This software was developed at:
# Inria Rennes - Bretagne Atlantique
# Campus Universitaire de Beaulieu
# 35042 Rennes Cedex
# France
#
# If you have questions regarding the use of this file, please contact
# Inria at [email protected]
#
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# Description:
# ViSP overall configuration file.
#
#############################################################################

if(VISP_HAVE_FRANKA)
list(APPEND apps_cpp visp-acquire-franka-calib-data.cpp)
endif()

if(VISP_HAVE_UR_RTDE)
list(APPEND apps_cpp visp-acquire-universal-robots-calib-data.cpp)
endif()
cmake_minimum_required(VERSION 3.10)

file(GLOB apps_data "*.yaml" "*.py" "camera.xml" "*.jpg")
project(ViSP-apps)

foreach(cpp ${apps_cpp})
visp_add_app(${cpp})
endforeach()
find_package(VISP)

if(VISP_HAVE_REALSENSE2)
# Add specific build flag to turn off warnings coming from librealsense 3rd party and its dependencies
list(APPEND CXX_FLAGS_MUTE_WARNINGS "/wd4244")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "/wd4267")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-deprecated-copy")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-deprecated-declarations")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-ignored-qualifiers")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-overloaded-virtual")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-pessimizing-move")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-reorder")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-sign-compare")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-function")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-parameter")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unqualified-std-cast-call")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-missing-field-initializers")
if(MSVC)
if(NOT VISP_SHARED)
foreach(flag_var
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif()
if(${flag_var} MATCHES "/MDd")
string(REGEX REPLACE "/MDd" "/MTd" ${flag_var} "${${flag_var}}")
endif()
endforeach(flag_var)

visp_set_source_file_compile_flag(visp-acquire-franka-calib-data.cpp ${CXX_FLAGS_MUTE_WARNINGS})
visp_set_source_file_compile_flag(visp-acquire-universal-robots-calib-data.cpp ${CXX_FLAGS_MUTE_WARNINGS})
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcrtd.lib")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libcmtd.lib")
endif()
endif()

# Copy the data files to the same location than the target
foreach(data ${apps_data})
visp_copy_data(visp-compute-hand-eye-calibration.cpp ${data})
endforeach()
visp_add_subdirectory(hand-eye REQUIRED_DEPS visp_core visp_gui visp_io visp_robot visp_sensor visp_vision)
visp_add_subdirectory(intrinsic REQUIRED_DEPS visp_core visp_gui visp_io visp_vision)
48 changes: 48 additions & 0 deletions apps/calibration/hand-eye/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
cmake_minimum_required(VERSION 3.10)

project(apps-calibration-hand-eye)

find_package(VISP REQUIRED visp_vision visp_io OPTIONAL_COMPONENTS visp_gui visp_robot visp_sensor)

set(apps_cpp
visp-compute-apriltag-poses.cpp
visp-compute-chessboard-poses.cpp
visp-compute-eye-in-hand-calibration.cpp
visp-compute-eye-to-hand-calibration.cpp
)

if(VISP_HAVE_FRANKA)
list(APPEND apps_cpp visp-acquire-franka-calib-data.cpp)
endif()

if(VISP_HAVE_UR_RTDE)
list(APPEND apps_cpp visp-acquire-universal-robots-calib-data.cpp)
endif()

foreach(cpp ${apps_cpp})
visp_add_app(${cpp})
endforeach()

if(VISP_HAVE_REALSENSE2)
# Add specific build flag to turn off warnings coming from librealsense 3rd party and its dependencies
list(APPEND CXX_FLAGS_MUTE_WARNINGS "/wd4244")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "/wd4267")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-deprecated-copy")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-deprecated-declarations")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-ignored-qualifiers")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-overloaded-virtual")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-pessimizing-move")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-reorder")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-sign-compare")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-function")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-parameter")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unqualified-std-cast-call")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-missing-field-initializers")

visp_set_source_file_compile_flag(visp-acquire-franka-calib-data.cpp ${CXX_FLAGS_MUTE_WARNINGS})
visp_set_source_file_compile_flag(visp-acquire-universal-robots-calib-data.cpp ${CXX_FLAGS_MUTE_WARNINGS})
endif()

# Copy the data folder to the same location than the target
visp_copy_dir(visp-compute-eye-in-hand-calibration.cpp "${CMAKE_CURRENT_SOURCE_DIR}" data-eye-in-hand)
visp_copy_dir(visp-compute-eye-to-hand-calibration.cpp "${CMAKE_CURRENT_SOURCE_DIR}" data-eye-to-hand)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Chessboard
9 x 6
square size: 0.0236 m
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
<!--Projection model type-->
<type>perspectiveProjWithDistortion</type>
<!--Pixel ratio-->
<px>605.146728515625</px>
<py>604.79150390625</py>
<px>607.5931396484375</px>
<py>607.574951171875</py>
<!--Principal point-->
<u0>325.53253173828125</u0>
<v0>244.95083618164062</v0>
<u0>323.46282958984375</u0>
<v0>243.25529479980469</v0>
<!--Undistorted to distorted distortion parameter-->
<kud>-0</kud>
<!--Distorted to undistorted distortion parameter-->
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows: 6
cols: 1
data:
- [0.335091]
- [-0.0321497]
- [0.30857]
- [-3.01226]
- [0.0236777]
- [-0.451343]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows: 6
cols: 1
data:
- [0.404004]
- [-0.0991073]
- [0.313698]
- [-2.80794]
- [0.243946]
- [0.0128115]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows: 6
cols: 1
data:
- [0.496836]
- [-0.0964562]
- [0.303913]
- [-2.69624]
- [0.424041]
- [0.544602]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows: 6
cols: 1
data:
- [0.572877]
- [-0.0239745]
- [0.322465]
- [-2.88599]
- [0.0945806]
- [0.968856]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows: 6
cols: 1
data:
- [0.531347]
- [0.107708]
- [0.395596]
- [2.08624]
- [-1.84015]
- [-0.328587]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows: 6
cols: 1
data:
- [0.422618]
- [0.122676]
- [0.398295]
- [2.27722]
- [1.49913]
- [-0.180671]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows: 6
cols: 1
data:
- [0.376289]
- [0.164592]
- [0.366096]
- [2.30108]
- [-1.98969]
- [0.408048]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows: 6
cols: 1
data:
- [0.386433]
- [-0.0703535]
- [0.286561]
- [-0.319244]
- [2.44944]
- [0.612203]
2 changes: 2 additions & 0 deletions apps/calibration/hand-eye/data-eye-to-hand/apriltag-data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
36h11 Ariltag
size: 0.048 m
30 changes: 30 additions & 0 deletions apps/calibration/hand-eye/data-eye-to-hand/franka_camera.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<root>
<!--This file stores intrinsic camera parameters used
in the vpCameraParameters Class of ViSP available
at https://visp.inria.fr/download/ .
It can be read with the parse method of
the vpXmlParserCamera class.-->
<camera>
<!--Name of the camera-->
<name>Camera</name>
<!--Size of the image on which camera calibration was performed-->
<image_width>640</image_width>
<image_height>480</image_height>
<!--Intrinsic camera parameters computed for each projection model-->
<model>
<!--Projection model type-->
<type>perspectiveProjWithDistortion</type>
<!--Pixel ratio-->
<px>607.5931396484375</px>
<py>607.574951171875</py>
<!--Principal point-->
<u0>323.46282958984375</u0>
<v0>243.25529479980469</v0>
<!--Undistorted to distorted distortion parameter-->
<kud>-0</kud>
<!--Distorted to undistorted distortion parameter-->
<kdu>0</kdu>
</model>
</camera>
</root>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows: 6
cols: 1
data:
- [0.719437]
- [-0.0332613]
- [0.412152]
- [3.05894]
- [0.00390122]
- [0.105226]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows: 6
cols: 1
data:
- [0.693433]
- [-0.132825]
- [0.411058]
- [-2.94386]
- [-0.642218]
- [-0.107763]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows: 6
cols: 1
data:
- [0.656645]
- [-0.0758066]
- [0.484879]
- [1.88619]
- [-0.381533]
- [-0.288699]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows: 6
cols: 1
data:
- [0.7954]
- [-0.096865]
- [0.54849]
- [0.830429]
- [0.265711]
- [0.195103]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows: 6
cols: 1
data:
- [0.785352]
- [-0.0604423]
- [0.570643]
- [0.137215]
- [0.330229]
- [0.00245722]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows: 6
cols: 1
data:
- [0.828885]
- [-0.115107]
- [0.50431]
- [1.40563]
- [0.487777]
- [0.296895]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows: 6
cols: 1
data:
- [0.771604]
- [-0.0188359]
- [0.502333]
- [-1.43407]
- [0.133107]
- [-0.256991]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows: 6
cols: 1
data:
- [0.808104]
- [-0.105606]
- [0.481443]
- [1.82284]
- [-0.0661053]
- [0.362562]
Loading

0 comments on commit e96f847

Please sign in to comment.