You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error Details
Hello.
When compiling pcl with VC++, I get a C2061 syntax error in pcl/io/low_level_io.h(58,17) regarding the identifier 'SSIZE_T'.
Here is the error code.
C:\devel\vcpkg\packages\pcl_x64-windows\include\pcl/io/low_level_io.h(58,17): error C2061: 構文エラー: 識別子 'SSIZE_T'
To Reproduce
OS: [Windows 11]
Compiler: [CMake]
PCL Version [1.13.1]
PCL Type: [Installed with VCPKG]
My development environment is Windows 11, Visual Studio Community 2019.
And I use Cmake for compilation.
First of all, vcpkg was installed in the C:/devel directory and pcl was installed via vcpkg.
As a result, pcl was installed in C:/devel/vcpkg/packages/pcl_x64-windows.
I'm trying to install pcl as an external library in choreonoid's sample package vnoid.
I have written choreonoid/ext/vnoid/src/CmakeList.txt as follows:
=================choreonoid/ext/vnoid/src/CmakeList.txt==============
With that compilation, configure and generate succeeded.
Next, I wrote the following program to obtain a 3D point cloud and attempted to build it.
=================choreonoid/ext/vnoid/src/mycamera.cpp==============
#include"mycamera.h"namespacecnoid {
namespacevnoid {
MyCamera::MyCamera() {
timeStep = 1.0;
}
voidMyCamera::Init(SimpleControllerIO* io) {
// enable camera
cameras << io->body()->devices();
for (size_t i = 0; i < cameras.size(); ++i) {
Device* camera = cameras[i];
io->enableInput(camera);
OPD("Device type: %s, ", camera->typeName());
OPD("id: %s, ", camera->id());
OPD("name: %s.\n", camera->name());
}
timeCounter = 0.0;
timeStep = io->timeStep();
}
voidMyCamera::TerrainAnalysis() {
//// sample code of image saving/* for (size_t i = 0; i < cameras.size(); i++) { RangeCamera* camera = cameras[i]; std::string filename = camera->name() + ".png"; camera->constImage().save(filename); OPD("The image of %s", camera->name()); OPD("has been saved to \"%s\".\n", filename); }*///// here is the program of getting point cloud data// get cameras// when there are several camerasfor (size_t i = 0; i < cameras.size(); i++) {
RangeCamera* camera = cameras[i];
}
// only one camera
RangeCamera* camera = cameras[0];
// Get an image of the current sceneconst Image& RangeImage = camera->constImage();
// Save an image of current scene
RangeImage.save("pointcloud.png");
// width and height of this imageconstint width = RangeImage.width();
constint height = RangeImage.height();
// get color data of this imageconstunsignedchar* pixels = RangeImage.pixels();
// point cloud variable declaration
pcl::PointCloud<pcl::PointXYZRGB> cloud;
// initialize point cloud
cloud.width = width;
cloud.height = height;
cloud.is_dense = false;
cloud.points.resize(cloud.width * cloud.height);
// Stores values (coordinates, color) for each point in a point cloud
std::size_t i = 0;
for (constauto& e : camera->constPoints()) {
// X, Y, Z
cloud[i].x = e(0);
cloud[i].y = e(1);
cloud[i].z = e(2);
// color(R, G, B)
cloud[i].r = pixels[3 * i + 0];
cloud[i].g = pixels[3 * i + 1];
cloud[i].b = pixels[3 * i + 2];
++i;
}
// save the point cloud datapcl::io::savePCDFileBinaryCompressed("pointcloud.pcd", cloud);
OPD("save pointcloud\n");
}
} // namespace vnoid
} // namespace cnoid
=========================================================
However, it could not be built correctly because of the error described at the beginning of this article.
I would appreciate any insight into this error.
The text was updated successfully, but these errors were encountered:
Yes this is strange.
I also use Visual Studio 2019 to compile mycamera.cpp.
Cross-compilation with Cmake was performed to remember dependencies between choreonoid and external source or/and header files (e.g. pcl). All choreonoid project (including mycamera.cpp) was compiled with Visual Studio 2019.
Error Details
Hello.
When compiling pcl with VC++, I get a C2061 syntax error in pcl/io/low_level_io.h(58,17) regarding the identifier 'SSIZE_T'.
Here is the error code.
C:\devel\vcpkg\packages\pcl_x64-windows\include\pcl/io/low_level_io.h(58,17): error C2061: 構文エラー: 識別子 'SSIZE_T'
To Reproduce
My development environment is Windows 11, Visual Studio Community 2019.
And I use Cmake for compilation.
First of all, vcpkg was installed in the C:/devel directory and pcl was installed via vcpkg.
As a result, pcl was installed in C:/devel/vcpkg/packages/pcl_x64-windows.
I'm trying to install pcl as an external library in choreonoid's sample package vnoid.
I have written choreonoid/ext/vnoid/src/CmakeList.txt as follows:
=================choreonoid/ext/vnoid/src/CmakeList.txt==============
=========================================================
Then, I cross-compiled using the following code:
With that compilation, configure and generate succeeded.
Next, I wrote the following program to obtain a 3D point cloud and attempted to build it.
=================choreonoid/ext/vnoid/src/mycamera.cpp==============
=========================================================
=================choreonoid/ext/vnoid/src/mycamera.h===============
=========================================================
However, it could not be built correctly because of the error described at the beginning of this article.
I would appreciate any insight into this error.
The text was updated successfully, but these errors were encountered: