std::length error when using PCL Ground_based RGBD detection - ros

I am facing an issue with Ground-based RGBD people detection (https://pcl.readthedocs.io/projects/tutorials/en/latest/ground_based_rgbd_people_detection.html). The error is inconsistent and hence has been pretty difficult to narrow down.
When I am running the detection, sometimes it throws a std::length error, and what() says vector_M_fill_insert.
Initially, I assumed it happened when people were detected (because it ran fine and the moment a person entered the frame, it stopped), and it was probably associated with the clustering, but in a few cases, it threw the error just after I launched the node.
I passed a processed point cloud to it and then passed the direct camera point cloud as well just to try to check if the issue was with the processed point cloud, but in both cases, it threw the error unpredictably.
I am confused as to how to go about debugging the error or what might be causing it. Any help is appreciated thank you!

You need to build your nodes with debug flags enabled and that can be achieved in some ways ...
Adding to your CMakelists.txt
set(CMAKE_BUILD_TYPE Debug)
Or
compiling with -DCMAKE_BUILD_TYPE=Debug.
Then you should attach the gdb debugger to whatever node you want. If you are using VS Code as IDE, there is already an extension for it with tutorials, otherwise, you can also add it to your launch file as described here

Related

Unable to Build mac project in XCode14.0/14.1 with macOS ventura

I have recently updated to macOS 13.0 and for that minimum XCode Version required is 14.x series. But my existing project never getting successfully building. Its getting stuck at some point.
Its not getting failed. Build process screenshot is attached below. Its not pointing to any specific class. Seems like there are lots of classes which are getting compiled successfully at last but still build process is stuck at some point:
Seen similar threads like below on apple pages but nothing seems working. Does anyone got resolution?
Xcode 14 project compile error
XCode 14 compile errors immediately disappear or do not appear at all
Something similar has happened to me in the past on a number of occasions. If the Swift compiler is hanging mid-build, usually the issue is that there is some expression that is too complex for Swift to do the type inference on.
What you need to do is first find the exact statement that is causing the hang. This is how I do it:
First find out which source file is causing the problem. Look at the build log to figure this out (the build log can be located by looking at the reports navigator ⌘9 ). Find the build log and click on it. The build log will appear in an editor window.
One of the compiles will still be in progress and its file is the one you want.
The next thing to do is comment out all the code and recompile. This time the compilation will finish (if you have the right file, or there is only one) but probably with a lot of errors. Then you add the code back in, function by function, until one of them causes the compilation to hang again. If it's not obvious which line of the function is causing the problem, comment it out again and then add the lines back one by one until the compilation breaks again.
Once you have located the line, you need to simplify the type inference on that line. If it's a closure, try adding an explicit declaration for its parameters and return type. If it involves some complex array, try adding a type annotation to its declaration. Also try breaking down complex expressions into multiple simpler expressions.
There's no one size fits all answer to this but usually, once you have located the exact line that is causing the problem, it should be reasonably obvious how to fix it.

'GL_PERSPECTIVE_CORRECTION_HINT' error on Raspberry Pi while installing OpenCV

I am trying to create a barcode scanner from a usb camera for Raspberry Pi. I used the tutorial on this site to install OpenCV on the Pi:(https://gist.github.com/rodrigobaron/072a85460e46c48e3bee24fe140b9fdb).
After I used the make command (the third to last step of the tutorial), the following error occurred:
error: 'GL_PERSPECTIVE_CORRECTION_HINT' was not declared in this scope
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is important to note that I used the simple "make" command rather than "make -j4" as the "j4" option allows it to work on all four cores of the raspberry pi, and it is suggested to eliminate "-j4" if an error occurs.
Upon searching for what caused this issue, I have discovered that it may be due to OPEN_GL support not needing to be enabled, or it might also be caused by an error in the header files. I have not determined how to re-write the make file to eliminate OPEN_GL support, nor do I feel comfortable altering the header files without good cause. I would appreciate any advice on fixing the issue as I feel I have exhausted my options. Thank you.
Disabling OPENGL cmake parameters (-DWITH_OPENGL=OFF) should fix the problem. i.e.
cmake -DWITH_QT=ON -DWITH_OPENGL=OFF -DFORCE_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_XINE=ON -DBUILD_EXAMPLES=ON
Another option is to go to line 3229 and just comment that line out. It will build then.
This may not be the best method, but it worked for me..my file looks like this.
opencv/modules/highgui/src/window_Qt.cpp
void OpenGlViewPort::initializeGL()
{
//glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
}

Why is SKAction.playSoundFileNamed crashing?

NOTE:
It has been a few days and I still am having this problem. One thing that would be helpful, is to know some troubleshooting ideas to try, so I can track down what is causing the crash. Any help that would lead me in the correct direction would be greatly appreciated.
I'm running in Xcode 8.2.1 on the simulator, as well as on several different iOS devices. I get the same problem wherever I go.
I have imported a small mp3 file into my spritekit project, called "cat_meow_1.mp3"
when I select the file, in Xcode, and hit the play button, it plays normally. Incidentally I have tried with various different files in various formats, with the same results.
in my code, which complies okay, when I get to the line:
run(SKAction.playSoundFileNamed("cat_meow_1.mp3", waitForCompletion: true))
I get a crash with the error message,
error: use of undeclared identifier '$r0'
Any suggestions how to debug this problem, or to figure out what I did wrong?
I also tried to preload the sound and make a class property, but got the same error. Here's what it looks like:
UPDATE:
After reinstalling Xcode, I still have the same problem. With certain files, I get white noise, while with other ones I get the error here. What else could be wrong with my system to cause this problem?
UPDATE 2:
tried my experiment on a separate mac, and basically it worked just fine. I reinstalled my OS, and got the same problem, with a little more of an error message this time, which reads:
2017-01-18 18:10:09.397565 sound attempt 2[533:124220] [DYMTLInitPlatform] platform initialization successful
2017-01-18 18:10:11.058506 sound attempt 2[533:124042] Metal GPU Frame Capture Enabled
2017-01-18 18:10:11.059146 sound attempt 2[533:124042] Metal API Validation Enabled
error: use of undeclared identifier '$r0'
warning: could not load any Objective-C class information. This will significantly reduce the quality of type information available.
After a couple days, I finally gave in and used Clean My Mac 3 to completely remove Xcode, as well as any and all related files... I must not have caught everything when previously I uninstalled/reinstalled it, because this time, there were none of my custom settings at all when I ran the reinstalled app.
It works now, thankfully, and I can get back to work.

Command failed due to signal: Segmentation fault: with xCode 7.0.1

My code is unable to build on xcode 7. What is Segmentation fault?
A segmentation fault happens when your code tries to access memory that it isn't allowed to access. This is often a sign of an uninitialized reference.
It's not clear to me from your screenshot exactly what is going on, though. Perhaps you could provide more details?
From the screenshot it looks like it is happening when you build your project. If this is correct, you need to create a minimal example that displays the problem i.e a code fragment that crashes the compiler in the same way and then you need to raise a bug report about it with Apple (supplying your minimal example so they can reproduce it).
This has happened to me a couple of times in the past and the way I have identified the bit that crashes the compiler is to comment out everything in the source file and then add it back in function by function.That will narrow the problem down to the function. After that you repeat with the lines of code in the offending function, until you get the line that crashes the compiler.
Along the way you may find a work around to stop the compiler crashing. If you do, do not be tempted to skip reporting the bug to Apple. They need to know.

Unity3d: Error building Player: Append is not supported

I receive this error when appending an already-successful build in XCode. What I don't understand is I'm not changing anything when appending, and this error shows up.
I've never used an 'old version of Xcode' as the error implicitly states.
Does anyone know how to get append working on a consistent basis?
This is a very simple project, and I'm using Playhaven and TapForTap SDK's, if that offers any insight.
Turns out, XCode upgraded itself without telling me. :(
I rolled back to the version I was using and all is well.
With no code snippets or error logs, it's very hard to determine what the source of your problem is. There's no way to know if your error is describing the cause of your problem or a symptom of the problem without more information.
I can only offer some suggestions:
My first thought is that you're using a deprecated method in your code somewhere, possibly "Append", which if that is the case, more than likely has an updated counterpart, but you'll have to check documentation regarding that.
If you've used "Append" previously with no errors, then you should look into what exactly you've changed in your new build, and verify that the methods you're using are supported.
If your errors are vague or unhelpful, you can begin the process of elimination and start commenting out blocks of code until it builds successfully, and narrow down the source of the problem significantly.
However, it would be to your benefit to expand your question with more information.

Resources