qt_visualizer tutorial pointcloud doesnt appear - pcl

I compiled PCL1.10.1 against VTK 8.2.0 and try to start using PCL in my QT Gui Project like pcl
s qt_visualizer tutorial.
https://pcl.readthedocs.io/projects/tutorials/en/latest/qt_visualizer.html#qt-visualizer
The pointcloud doesnt appear. The renderwindow works. I could change backgrundcolor and add a coordinateaxis.
I copied the code from doc/tutorials/content/sources/qt_visualizer
I used cmake 3.16.3. According to
dpkg -s libboost-dev | grep 'Version'
boost version is 1.71.0.0ubuntu2
Any ideas?

changing
typedef pcl::PointXYZRGBA PointT;
typedef pcl::PointCloud<PointT> PointCloudT;
in pclviewer.h
to
typedef pcl::PointCloud<pcl::PointXYZRGB> PointCloud;
solved my problem. Dont know why.

Related

gtsam is not able to find Eigen

I use version 4.1.1 of GTSAM. I have version 3.3.4 of Eigen installed.
The error is:
/usr/local/include/gtsam/base/OptionalJacobian.h:22:10: fatal error: Eigen/Dense: No such file or directory
#include <Eigen/Dense>
I tried building GTSAM with the flag -DGTSAM_USE_SYSTEM_EIGEN set to both on and off.
The same error message appears in both cases.
For reference this is a ROS project built with catkin.
Have you seen this PR: https://github.com/borglab/gtsam/pull/1304
If you can upgrade GTSAM to 4.2a8, it uses Eigen's find script's rather than custom ones and should properly find Eigen3, if you have it installed if you require to build from source.
Since you are using ROS, why not go the standard route... Have you declared a dependency on it in your package.xml and installed it with rosdep?
https://github.com/ros/rosdistro/pull/23198/files
Add to your package.xml:
<depend>gtsam</depend>
And, your CMakeLists, you just call
find_package(gtsam REQUIRED)
It is unclear to me, if gtsam is available through binaries, why you would be building it from source.
I was able to get it working by cloning version 4.0.3 of GTSAM into the src folder of my workspace, then building it with the following arguments:
-DGTSAM_USE_SYSTEM_EIGEN=ON -DGTSAM_POSE3_EXPMAP=ON -DGTSAM_ROT3_EXPMAP=ON

Where can I get PIC18F4455.lib file to build a code..?

I want to compile and debug the code for PIC18F4455 device.
.lib file is missing in this project code.
Where can I get this PIC18F4455.lib file..? I have searched it in the
'C:Program/Microchip' folder.. But could'nt find it there..
Can anybody help with this..??
Regards,
Dhara
Add the definition below to tell the compiler to include the file.
#include <xc.h>
If you are using any other compiler than the Microchip XC compiler, it's suggested you download the latest IDE and latest official compiler.

Link Eigen Library with ROS

I am a newbie working on ROS Hydro. Most of my codes are based on the Eigen library. I have already installed the library by below codes:
sudo apt-get install libeigen3-dev
Now I can find a eigen folder in /opt/ros/hydro/include/Eigen and another folder under /usr/include/eigen3. From what I saw online, this should suggest my installation success.
However, when I build ros package by catkin_make, it reports error that no Eigen/Dense file or directory. I did what this post suggests and it works:
Using Eigen Library in ROS Indigo
However, this needs me to edit the CmakeLists.txt for every package, to include eigen library and link targets. Is there a more convenient way to set the libraries so that it can work for all my future codes without me touching every CmakeLists for all my packages? Thanks for any answers in advance!

what happened to SDL_mixer.h?

I am trying to get some open source C++ code to compile in xcode. It uses the SDL library. I downloaded SDL 2.0 for OS X and installed it and things are working -- but the download didn't seem to include the file SDL_mixer.h -- which is referenced in the code, as shown below.
#include <SDL/SDL_mixer.h>
What happened to this file? Did it get dropped from SDL? What do I do to work around the missing file to get the code working?
SDL Mixer has always been a separate library you have to install next to your SDL.
To fix your problem, download and install the library in such a way that SDL_mixer.h is located in an SDL/ folder of your include paths.
Install the SDL Mixer framework and add a reference to it in your project.
Include the SDL_Mixer.h header like so:
#include <SDL2_Mixer/SDL_Mixer.h>

Compile OpenCV (2.3.1+) for OS X Lion / Mountain Lion with Xcode

Can anyone provide me some detailed guide how to compile OpenCV 2.3.1 on OS X Lion with Xcode?
I'm getting mad about this … I got the source, used cmake to create the Xcode template and tried to build it, but it fails with about 200 errors.
Thanks in advance,
Dom
SOLUTION in my answer post.
Detailed guide how to get OpenCV 2.3.1 up and running under OS X Lion (10.7.2) with Xcode 4.2.1 using MacPorts
EDIT 08/06/2012: This is also working for OpenCV 2.4.1. Just make sure you got the latest version of Xcode and installed the "Command Line Tools" (Xcode -> Preferences -> Downloads -> Command Line Tools).
EDIT 15/08/2012: Tested everything with Mountain Lion ans the current versions of Xcode & OpenCV … it's working :) And you don't have to use the LLVM compiler.
EDIT 16/10/204: Over the last year I abandoned MacPorts and started using brew, which works better for my purposes.
Brew guide
1.) Get the current Version of Brew here.
2.) Make sure brew is ready to us
brew doctor && brew update
3.) Install OpenCV (as of 17/20/2014 v2.4.9)
brew install opencv
4.) Fire up Xcode (as of 17/20/2014 v6.0.1) and open/create your project
5.) Select your target, go to "General" and hit the "+"-Button in the "Linked Frameworks and Libraries"
5.1.) Click "Add Other", hit "/", go to "/usr/local/lib" and add any libopencv_**.dylib you need
6.) Now add "/usr/local/include" to your "Header Search Paths" under "Build Settings" (target still selected)
7.) Finally make sure include OpenCV in your .mm files.
MacPorts guide (maybe outdated)
1.) Get the current Version of MacPorts here. Don't forget to add "/opt/local/(s)bin" to your environment PATH
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
2.) Keep your MacPorts up-2-date:
sudo port -v selfupdate
3.) Install OpenCV 2.3.1 (building with llvm-gcc)
sudo port install opencv configure.compiler=llvm-gcc-4.2
4.) Fire up Xcode and create your project
5.) Select your target, go to "Summary" and hit the "+"-Button in the "Linked Frameworks and Libraries"
5.1.) Click "Add Other", hit "/" and go to "/opt/local/lib"
5.2.) Add any libopencv_**.dylib you need
6.) Now add "/opt/local/include/" to your "Header Search Paths" under "Build Settings" (target still selected)
7.) Finally make sure to have the following lines at the beginning of your .pch file:
#ifdef __cplusplus
#import "opencv2/opencv.hpp"
#endif
Otherwise you'll get some nasty erros like this:
"Non-const static data member must be initialized out of line"
"Statement expression not allowed at file scope"
That's it! Hope it helps :)
Thanks to Vachidrewer, I was able to get OpenCv running on Mavericks.
I did things in a little different order,so here are my notes.
If it isn't installed, install Macports and add it to path.
(I already had it installed)
Use Macports to update itself from the command line
$ sudo port -v selfupdate
Use Macports to install opencv and its dependencies from the command line.
$ sudo port install opencv
If it isn't installed, install xCode. (I already had it installed)
Use xCode to create a C++ Command line project.
Use xCode to verify that the simple hello world C++ program it created works by running it in the xCode IDE.
Modify the main.cpp file created by xCode from the hello world example to the simple opencv example from Vachidrewer.
Notice that xCode editer reports that it can NOT find the header opencv header file.
Add /opt/local/include/ to the project search path and notice that the editer errors go away.
Try to run the program in the xCode IDE and notice that it reports that it can't find the opencv libraries.
Add a group called opencvfrqmework to the project and add /opt/local/lib/libopencv_core.dylib and /opt/local/lib/livopencv_highgui.dylib to the group.
Use the xCode IDE to run the project and notice that a window pops up with half od it darker then the other half.
Have you tried just building it using standard UNIX Makefiles?
Follow this guide, and see if that helps. If you have already downloaded the source code, you probably don't need to do the svn checkout that is suggested. You can probably start with Use CMake to build in section 2.
Hope that helps.
With small changes to #moosgummi answer below steps worked with Xcode 4.6 on Mac OSX 10.7 TEST code is included below.
Installation of OpenCV :
Get the current Version of MacPorts here.
Don't forget to add "/opt/local/(s)bin" to your environment PATH
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
Keep your MacPorts up-2-date:
sudo port -v selfupdate
Install OpenCV with mac ports
sudo port install opencv
Configuring Xcode for using OpenCV
Create a new XCode project using the Command Line Utility/Standard Tool template. Name it and select C++
Select Project -> Edit Project Settings. Select the Build tab. Set Configuration to All Configurations
In the Architectures section, double-click Valid Architectures and remove all the PPC architectures if any.
Compiler for C/C++/Objective-C > Apple LLVM compiler 4.2
Language" > "C++ Standard Library", and select "libstdc++ (GNU C++ standard library)"
In the Search Paths section set Header Search Paths to /opt/local/include/
Please choose non-recursive as an option while adding that search path
Close the Project Info window
Select Project -> New Group and create a group called OpenCV Frameworks
With the new group selected, select Project -> Add files to 'Your Project Name'
Press the "/" key to get the Go to the folder prompt. Enter /opt/local/lib
Select libopencv_core.dylib, libopencv_highgui.dylib (you may need to add other library files from this folder to run other code.)
Uncheck Copy Items… and click Add
TEST CODE
Copy this code into your main.cpp file. It should open up a small window that is half shaded.
#include <iostream>
#include <opencv2/opencv.hpp>
int main(int argc, char *argv[])
{
// Open the file.
IplImage *img = cvCreateImage( cvSize(100,200), IPL_DEPTH_8U, 3); //if (!img) {
// printf("Error: Couldn't open the image file.\n");
// return 1;
//}
// Display the image.
cvNamedWindow("Image:", CV_WINDOW_AUTOSIZE);
cvShowImage("Image:", img);
// Wait for the user to press a key in the GUI window.
cvWaitKey(0);
// Free the resources.
cvDestroyWindow("Image:");
cvReleaseImage(&img);
return 0;
}
After get a lot of errors (segmentation fault etc) I finally get it working. Here is the tutorial:
http://www.guidefreitas.com/installing-opencv-2-4-2-on-mac-osx-mountain-lion-with-python-support

Resources