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

Fix compilation error when using ViSP without deprecated #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
12 changes: 12 additions & 0 deletions robot/sample-vpRobotCamera.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include <visp3/core/vpConfig.h>

#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
#include <visp3/robot/vpRobotCamera.h>

#ifdef ENABLE_VISP_NAMESPACE
Expand Down Expand Up @@ -28,3 +31,12 @@ int main()
robot.getPosition(cMw); // Position of the camera wrt the world frame
std::cout << "New position of the camera cMw:\n" << cMw << std::endl;
}
#else
#include <iostream>

int main()
{
std::cout << "This example requires compiling ViSP with the deprecated functions." << std::endl;
return EXIT_SUCCESS;
}
#endif
12 changes: 6 additions & 6 deletions sensor/sample-vpRealSense-4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

// Using a thread to display the pointcloud with PCL produces a segfault on OSX
#if( ! defined(__APPLE__) && ! defined(__MACH__) ) // Not OSX
# if (defined(VISP_HAVE_PTHREAD) || defined(_WIN32)) // Threading available
# if (defined(VISP_HAVE_PTHREAD) || defined(_WIN32)) && VISP_BUILD_DEPRECATED_FUNCTIONS // vpThread and vpMutex available
# define USE_THREAD
# endif
#endif
Expand All @@ -63,8 +63,13 @@
# include <pcl/visualization/pcl_visualizer.h>
#endif

#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif

#ifdef VISP_HAVE_PCL
#ifdef USE_THREAD

// Shared vars
typedef enum
{
Expand All @@ -75,11 +80,6 @@ typedef enum
t_CaptureState s_capture_state = capture_waiting;
vpMutex s_mutex_capture;


#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif

vpThread::Return displayPointcloudFunction(vpThread::Args args)
{
pcl::PointCloud<pcl::PointXYZRGB>::Ptr pointcloud_ = *((pcl::PointCloud<pcl::PointXYZRGB>::Ptr *) args);
Expand Down