Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Include new Panda3D #1388

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
a30f2bc
start panda3D cmake and integration
SamFlt Apr 16, 2024
5084153
Initial version of the Panda3D find cmake
SamFlt Apr 16, 2024
8a63d3e
Add VISP_HAVE_PANDA3D_FLAG
SamFlt Apr 16, 2024
ddb7f8e
Creating base panda3d classes, along with simple tutorial
SamFlt Apr 16, 2024
195105f
Basic rendering
SamFlt Apr 16, 2024
cb30042
working on RendererSet
SamFlt Apr 17, 2024
740203d
debugging lens projection matrix
SamFlt Apr 17, 2024
8e48284
normal and depth render working
SamFlt Apr 17, 2024
1201841
Normal rendering, workin on RGB rendering
SamFlt Apr 18, 2024
93280c1
Debugging RGB renderer
SamFlt Apr 18, 2024
49af00a
working rgb renderer
SamFlt Apr 18, 2024
968d252
Testing Camera space normals
SamFlt Apr 19, 2024
f21fd2f
Display all potential renders in tutorial, improve assert guards, man…
SamFlt Apr 19, 2024
64b3f6e
fix color ordering
SamFlt Apr 19, 2024
dcbe0b2
Disable auto_shader
SamFlt Apr 19, 2024
a37defc
Copy data folder
fspindle Apr 22, 2024
351ebd3
Better display positionning and click to quit
fspindle Apr 22, 2024
c5ed022
Improve Panda3d detection and version retrieval
fspindle Apr 22, 2024
0cc3133
Introduce copyright and remove empty lines
fspindle Apr 22, 2024
c66fc3b
Fix doxygen warnings
fspindle Apr 22, 2024
6e6895d
Improve warnings filter in cmake, fix depth and normal shaders to use…
SamFlt Apr 22, 2024
e24e134
Use ViSP frame for object and camera positioning instead of Panda3D f…
SamFlt Apr 22, 2024
fd89ed9
add small model, add argument parsing
SamFlt Apr 22, 2024
858afb6
document using ViSP convention for setting and retrieving object and …
SamFlt Apr 22, 2024
984c775
Working on adding resizable buffers
SamFlt Apr 22, 2024
ca6b537
Add step by step option
SamFlt Apr 22, 2024
1d88517
Add an interface to add lights to the scene
SamFlt Apr 23, 2024
7bb7029
fix argument parsing for model name
SamFlt Apr 23, 2024
4c7295c
Update tutorial model
SamFlt Apr 23, 2024
5f8113b
Debugging color rendering with different formats
SamFlt Apr 23, 2024
c3edefe
Add path to detect Panda from .dmg installation
fspindle Apr 23, 2024
8a7b365
Mute warning with Panda 1.10.14 SDK on macOS
fspindle Apr 23, 2024
c84a1e6
Fix build on macOS
fspindle Apr 23, 2024
83a6723
Fix segfault when -model option is not used (meaning default model is…
fspindle Apr 23, 2024
0612dca
debug light positioning, add failsafes on buffer setup
SamFlt Apr 23, 2024
0089620
Add another check on texture size when converting to vpImage
SamFlt Apr 23, 2024
d61af18
Add texture information debug print, Try and reparse uint texture dat…
SamFlt Apr 24, 2024
1953020
Add debug logging on panda/gl side
SamFlt Apr 24, 2024
186cf90
revert shaders to version 120
SamFlt Apr 24, 2024
e5fb416
Debugging on macos x86, some issues with p3d attribs
SamFlt Apr 24, 2024
6afe3ec
switch shaders to 330
SamFlt Apr 24, 2024
0caeea8
Enable build on windows
SamFlt Apr 24, 2024
34bf478
Improve usability
SamFlt Apr 25, 2024
36713ca
Remove cmake debug message that brings an issue on macOS
fspindle Apr 25, 2024
d16a322
Start work on RGB shader
SamFlt Apr 26, 2024
69a8f78
cook torrance seems to be working
SamFlt Apr 27, 2024
99916e0
more work on cook torrance model, weighting diffuse and specular terms
SamFlt Apr 29, 2024
1f55836
Fix cook torrance model, Add light contrib map example in tutorial
SamFlt Apr 29, 2024
0cb2f04
fix light contrib conversion
SamFlt Apr 29, 2024
ebfbdc8
Support for basic filters on output textures
SamFlt Apr 29, 2024
2e68182
fix texture rendering
SamFlt Apr 30, 2024
a066aa3
Add some documentation, grouping panda3D related classes
SamFlt May 2, 2024
be943e8
Add canny and gaussian blur filters
SamFlt May 3, 2024
52e571c
Merge branch 'feat_panda3d' of github.com:SamFlt/visp into feat_panda3d
SamFlt May 3, 2024
4f84919
Fix canny display, directional lighting, documentation and class goru…
SamFlt May 3, 2024
2971eb2
fix texture inversion
SamFlt May 3, 2024
5f6db92
change camera normal frame to be more coherent, update tutorial model
SamFlt May 3, 2024
626ed6a
setup tutorial
SamFlt May 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Expand Up @@ -623,6 +623,7 @@ VP_OPTION(USE_DIRECTSHOW DIRECTSHOW "" "Include dshow support" "
VP_OPTION(USE_OPENMP OpenMP "" "Include openmp support" "" ON)
VP_OPTION(USE_EIGEN3 Eigen3 QUIET "Include eigen3 support" "" ON IF NOT WINRT AND NOT IOS)
VP_OPTION(USE_COIN3D "Coin3D;MyCoin3D" "" "Include coin3d support" "" ON IF OPENGL_FOUND AND NOT WINRT AND NOT IOS)
VP_OPTION(USE_PANDA3D "MyPanda3D" "" "Include Panda3D support" "" ON IF NOT IOS)
VP_OPTION(USE_YARP YARP QUIET "Include yarp support" "YARP_DIR" ON IF NOT WINRT AND NOT IOS)
VP_OPTION(USE_OGRE OGRE QUIET "Include Ogre support" "OGRE_DIR" ON IF NOT WINRT AND NOT IOS)
VP_OPTION(USE_OIS OIS QUIET "Include Ogre/ois support" "OIS_DIR" ON IF USE_OGRE AND NOT WINRT AND NOT IOS)
Expand Down Expand Up @@ -1082,6 +1083,7 @@ VP_SET(VISP_HAVE_SOWIN TRUE IF (BUILD_MODULE_visp_ar AND USE_SOWIN))
VP_SET(VISP_HAVE_SOXT TRUE IF (BUILD_MODULE_visp_ar AND USE_SOXT))
VP_SET(VISP_HAVE_SOQT TRUE IF (BUILD_MODULE_visp_ar AND USE_SOQT))
VP_SET(VISP_HAVE_QT TRUE IF (BUILD_MODULE_visp_ar AND USE_QT))
VP_SET(VISP_HAVE_PANDA3D TRUE IF (BUILD_MODULE_visp_ar AND USE_PANDA3D))

VP_SET(VISP_HAVE_ZBAR TRUE IF (BUILD_MODULE_visp_detection AND USE_ZBAR))
VP_SET(VISP_HAVE_DMTX TRUE IF (BUILD_MODULE_visp_detection AND USE_DMTX))
Expand Down Expand Up @@ -1720,13 +1722,15 @@ status(" \\- Use Coin3D:" USE_COIN3D THEN "yes (ver ${COIN3D_VE
status(" \\- Use SoWin:" USE_SOWIN THEN "yes" ELSE "no")
status(" \\- Use SoXt:" USE_SOXT THEN "yes" ELSE "no")
if(USE_SOQT AND SoQt_FOUND)
status(" \\- Use SoQt:" USE_SOQT AND SoQt_FOUND THEN "yes (ver ${SoQt_VERSION})" ELSE "no")
status(" \\- Use SoQt:" USE_SOQT AND SoQt_FOUND THEN "yes (ver ${SoQt_VERSION})" ELSE "no")
else()
status(" \\- Use SoQt:" USE_SOQT THEN "yes" ELSE "no")
endif()
status(" \\- Use Qt5:" USE_SOQT AND SoQt_FOUND THEN "yes" ELSE "no")
status(" \\- Use Qt4:" USE_QT AND DESIRED_QT_VERSION MATCHES 4 THEN "yes" ELSE "no")
status(" \\- Use Qt3:" USE_QT AND DESIRED_QT_VERSION MATCHES 3 THEN "yes" ELSE "no")
status(" Panda3D:" USE_PANDA3D THEN "yes (ver ${Panda3D_VERSION_STRING})" ELSE "no")

status("")
status(" Media I/O: ")
status(" Use JPEG:" USE_JPEG THEN "yes (ver ${JPEG_LIB_VERSION})" ELSE "no")
Expand Down
96 changes: 96 additions & 0 deletions cmake/FindMyPanda3D.cmake
@@ -0,0 +1,96 @@
#############################################################################
#
# ViSP, open source Visual Servoing Platform software.
# Copyright (C) 2005 - 2024 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 visp@inria.fr
#
# 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:
# Try to find OpenCV framework.
#
# Panda3D_FOUND
# Panda3D_INCLUDE_DIRS
# Panda3D_LIBRARIES
#
#############################################################################

set(PANDA3D_INCLUDE_SEARCH_PATHS
$ENV{Panda3D_DIR}/include
$ENV{Panda3D_DIR}/built/include
${Panda3D_DIR}/include
${Panda3D_DIR}/built/include
/usr/include/panda3d
/usr/local/include/panda3d
/Library/Developer/Panda3D/include
)

set(PANDA3D_LIBRARIES_SEARCH_PATHS
$ENV{Panda3D_DIR}/lib
$ENV{Panda3D_DIR}/built/lib
$ENV{Panda3D_DIR}/bin
${Panda3D_DIR}/lib
${Panda3D_DIR}/built/lib
${Panda3D_DIR}/bin
/usr/lib/panda3d
/usr/local/lib/panda3d
/usr/lib/x86_64-linux-gnu/panda3d
/Library/Developer/Panda3D/lib
)

set(PANDA3D_LIBS
panda p3framework pandaexpress
p3dtoolconfig p3dtool p3direct
#pandaegg
#p3ffmpeg p3interrogatedb p3tinydisplay p3vision
#pandaai pandafx pandaphysics pandaskel
)

# Fetch all libraries
set(Panda3D_LIBRARIES "")
set(ALL_LIBS_FOUND TRUE)
foreach(lib_name ${PANDA3D_LIBS})
find_library(Panda3D_${lib_name}_LIBRARY NAMES "lib${lib_name}" ${lib_name} PATHS ${PANDA3D_LIBRARIES_SEARCH_PATHS})
if(NOT Panda3D_${lib_name}_LIBRARY)
set(ALL_LIBS_FOUND FALSE)
else()
list(APPEND Panda3D_LIBRARIES ${Panda3D_${lib_name}_LIBRARY})
endif()

mark_as_advanced(Panda3D_${lib_name}_LIBRARY)
endforeach()

find_path(Panda3D_INCLUDE_DIRS panda.h PATHS ${PANDA3D_INCLUDE_SEARCH_PATHS})
message(${Panda3D_INCLUDE_DIRS})
include(FindPackageHandleStandardArgs)
# Handle the QUIETLY and REQUIRED arguments and set the Panda3D_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(Panda3D DEFAULT_MSG ALL_LIBS_FOUND Panda3D_INCLUDE_DIRS)

if(Panda3D_FOUND)
vp_parse_header2(Panda3D "${Panda3D_INCLUDE_DIRS}/pandaVersion.h" PANDA_VERSION_STR)
endif()

mark_as_advanced(Panda3D_INCLUDE_DIRS)
1 change: 1 addition & 0 deletions cmake/templates/VISPConfig.cmake.in
Expand Up @@ -240,6 +240,7 @@ set(VISP_HAVE_OPENCV_NONFREE "@VISP_HAVE_OPENCV_NONFREE@")
set(VISP_HAVE_OPENCV_VERSION "@VISP_HAVE_OPENCV_VERSION@")
set(VISP_HAVE_OPENGL "@VISP_HAVE_OPENGL@")
set(VISP_HAVE_OPENMP "@VISP_HAVE_OPENMP@")
set(VISP_HAVE_PANDA3D "@VISP_HAVE_PANDA3D@")
set(VISP_HAVE_PARPORT "@VISP_HAVE_PARPORT@")
set(VISP_HAVE_PCL "@VISP_HAVE_PCL@")
set(VISP_HAVE_PIONEER "@VISP_HAVE_PIONEER@")
Expand Down
3 changes: 3 additions & 0 deletions cmake/templates/vpConfig.h.in
Expand Up @@ -283,6 +283,9 @@
// Defined if OpenGL library available.
#cmakedefine VISP_HAVE_OPENGL

// Defined if Panda3D is available
#cmakedefine VISP_HAVE_PANDA3D

// Defined if Qt library available (either Qt-3 or Qt-4).
#cmakedefine VISP_HAVE_QT

Expand Down
1 change: 1 addition & 0 deletions doc/config-doxygen.in
Expand Up @@ -2409,6 +2409,7 @@ PREDEFINED = @DOXYGEN_SHOULD_SKIP_THIS@ \
HAVE_OPENCV_VIDEO \
HAVE_OPENCV_VIDEOIO \
VISP_HAVE_OPENGL \
VISP_HAVE_PANDA3D \
VISP_HAVE_PARPORT \
VISP_HAVE_PCL \
VISP_HAVE_PIONEER \
Expand Down
21 changes: 21 additions & 0 deletions doc/mainpage.dox.in
Expand Up @@ -376,6 +376,27 @@ in different ways. This will motivate us to continue the efforts.
\defgroup group_ar_renderer Renderer
Renderer interfaces.
*/
/*!
\ingroup group_ar_renderer
\defgroup group_ar_renderer_panda3d Panda3D Renderer
Modular renderers based on the Panda3D framework.
*/
/*!
\ingroup group_ar_renderer_panda3d
\defgroup group_ar_renderer_panda3d_3d 3D scene renderers
Classes that render a 3D scene.
*/
/*!
\ingroup group_ar_renderer_panda3d
\defgroup group_ar_renderer_panda3d_filters Image processing
Shader-based image processing and filtering.
*/
/*!
\ingroup group_ar_renderer_panda3d
\defgroup group_ar_renderer_panda3d_lighting Lighting related classes
Light and Lightable implementations.
*/

/*!
\ingroup module_ar
\defgroup group_ar_simulator Simulator
Expand Down
6 changes: 6 additions & 0 deletions doc/tutorial/rendering/tutorial-panda3d.dox
@@ -0,0 +1,6 @@
/**
\page tutorial-panda3d Rendering a 3D scene with Panda3D
\tableofcontents

\section tutorial-panda3d-intro Introduction
*/
8 changes: 8 additions & 0 deletions doc/tutorial/tutorial-users.dox
Expand Up @@ -11,6 +11,8 @@ This page references all the tutorials to use and contribute to ViSP.

- \subpage tutorial_calib

- \subpage tutorial_rendering

- \subpage tutorial_tracking

- \subpage tutorial_detection
Expand Down Expand Up @@ -85,6 +87,12 @@ This page introduces the user to the way to calibrate a camera.
- \subpage tutorial-calibration-extrinsic <br>This tutorial explains how to get the camera eye-in-hand extrinsic transformation when the camera is mounted on a robot end-effector.
*/

/*! \page tutorial_rendering 3D rendering and augmented reality
This page gives an introduction to using the 3D rendering tools integrated into ViSP.

- \subpage tutorial-panda3d <br>This tutorial gives an overview of the rendering capabilities of the Panda3D wrapper.
*/

/*! \page tutorial_tracking Tracking
This page introduces the user to the way to track objects in images.

Expand Down
21 changes: 21 additions & 0 deletions modules/ar/CMakeLists.txt
Expand Up @@ -173,6 +173,15 @@ if(USE_COIN3D)
endif()
endif()

if(USE_PANDA3D)
if(Panda3D_INCLUDE_DIRS)
list(APPEND opt_incs ${Panda3D_INCLUDE_DIRS})
endif()
if(Panda3D_LIBRARIES)
list(APPEND opt_libs ${Panda3D_LIBRARIES})
endif()
endif()

vp_add_module(ar visp_core)
vp_glob_module_sources()

Expand All @@ -181,5 +190,17 @@ if(USE_OGRE)
vp_set_source_file_compile_flag(src/ogre-simulator/vpAROgre.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register)
endif()

if(USE_PANDA3D)
set(PANDA3D_CXX_FLAGS -Wno-unused-parameter -Wno-unused-variable -Wno-extra -Wno-reorder-ctor)
set(PANDA3D_MODULE_SOURCES
vpPanda3DBaseRenderer.cpp vpPanda3DGeometryRenderer.cpp
vpPanda3DRGBRenderer.cpp vpPanda3DRenderParameters.cpp
vpPanda3DRendererSet.cpp vpPanda3DPostProcessFilter.cpp vpPanda3DCommonFilters.cpp
)
foreach(panda_src_name ${PANDA3D_MODULE_SOURCES})
vp_set_source_file_compile_flag(src/panda3d-simulator/${panda_src_name} ${PANDA3D_CXX_FLAGS})
endforeach()
endif()

vp_module_include_directories(${opt_incs})
vp_create_module(${opt_libs})