rviz Segmentation fault (core dumped) - opengl

When I try to use rviz ,I got the error "Segmentation fault (core dumped)".And the details are shown below. I use two graphics cards now, one GTX-750, and the other K40, I'm not sure if this is what causes the problem below, as well as how to solve it.
czhang#kaffe:~$ rosrun rviz rviz -l
[ INFO] [1465022465.168948335]: rviz version 1.11.14
[ INFO] [1465022465.169027675]: compiled against Qt version 4.8.6
[ INFO] [1465022465.169046113]: compiled against OGRE version 1.8.1 (Byatis)
[ INFO] [1465022465.324312645]: Creating resource group General
[ INFO] [1465022465.324429908]: Creating resource group Internal
[ INFO] [1465022465.324496607]: Creating resource group Autodetect
[ INFO] [1465022465.324629864]: SceneManagerFactory for type 'DefaultSceneManager' registered.
[ INFO] [1465022465.324883178]: Registering ResourceManager for type Material
[ INFO] [1465022465.324940378]: Registering ResourceManager for type Mesh
[ INFO] [1465022465.324987032]: Registering ResourceManager for type Skeleton
[ INFO] [1465022465.325053591]: MovableObjectFactory for type 'ParticleSystem' registered.
[ INFO] [1465022465.325103877]: OverlayElementFactory for type Panel registered.
[ INFO] [1465022465.325142848]: OverlayElementFactory for type BorderPanel registered.
[ INFO] [1465022465.325179725]: OverlayElementFactory for type TextArea registered.
[ INFO] [1465022465.325225052]: Registering ResourceManager for type Font
[ INFO] [1465022465.325272474]: ArchiveFactory for archive type FileSystem registered.
[ INFO] [1465022465.325308163]: ArchiveFactory for archive type Zip registered.
[ INFO] [1465022465.325345667]: ArchiveFactory for archive type EmbeddedZip registered.
[ INFO] [1465022465.325379959]: DDS codec registering
[ INFO] [1465022465.325428150]: FreeImage version: 3.15.4
[ INFO] [1465022465.325464467]: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
[ INFO] [1465022465.325678042]: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic,3fr,arw,bay,bmq,cap,cine,cr2,crw,cs1,dc2,dcr,drf,dsc,dng,erf,fff,ia,iiq,k25,kc2,kdc,mdc,mef,mos,mrw,nef,nrw,orf,pef,ptx,pxn,qtk,raf,raw,rdc,rw2,rwl,rwz,sr2,srf,srw,sti
[ INFO] [1465022465.325735871]: Registering ResourceManager for type HighLevelGpuProgram
[ INFO] [1465022465.325787693]: Registering ResourceManager for type Compositor
[ INFO] [1465022465.326052531]: MovableObjectFactory for type 'Entity' registered.
[ INFO] [1465022465.326105890]: MovableObjectFactory for type 'Light' registered.
[ INFO] [1465022465.326143255]: MovableObjectFactory for type 'BillboardSet' registered.
[ INFO] [1465022465.326182366]: MovableObjectFactory for type 'ManualObject' registered.
[ INFO] [1465022465.326236493]: MovableObjectFactory for type 'BillboardChain' registered.
[ INFO] [1465022465.326289991]: MovableObjectFactory for type 'RibbonTrail' registered.
[ INFO] [1465022465.326421572]: *-*-* OGRE Initialising
[ INFO] [1465022465.326473744]: *-*-* Version 1.8.1 (Byatis)
[ INFO] [1465022465.326532760]: Loading library /usr/lib/x86_64-linux-gnu/OGRE-1.8.0/RenderSystem_GL
[ INFO] [1465022465.329155160]: Installing plugin: GL RenderSystem
[ INFO] [1465022465.329216970]: OpenGL Rendering Subsystem created.
[ INFO] [1465022465.337273651]: Plugin successfully installed
[ INFO] [1465022465.337361511]: Loading library /usr/lib/x86_64-linux-gnu/OGRE-1.8.0/Plugin_OctreeSceneManager
[ INFO] [1465022465.338621448]: Installing plugin: Octree Scene Manager
[ INFO] [1465022465.338670756]: Plugin successfully installed
[ INFO] [1465022465.338705118]: Loading library /usr/lib/x86_64-linux-gnu/OGRE-1.8.0/Plugin_ParticleFX
[ INFO] [1465022465.340275569]: Installing plugin: ParticleFX
[ INFO] [1465022465.340333816]: Particle Emitter Type 'Point' registered
[ INFO] [1465022465.340369435]: Particle Emitter Type 'Box' registered
[ INFO] [1465022465.340403169]: Particle Emitter Type 'Ellipsoid' registered
[ INFO] [1465022465.340455829]: Particle Emitter Type 'Cylinder' registered
[ INFO] [1465022465.340488375]: Particle Emitter Type 'Ring' registered
[ INFO] [1465022465.340527067]: Particle Emitter Type 'HollowEllipsoid' registered
[ INFO] [1465022465.340564223]: Particle Affector Type 'LinearForce' registered
[ INFO] [1465022465.340608572]: Particle Affector Type 'ColourFader' registered
[ INFO] [1465022465.340643143]: Particle Affector Type 'ColourFader2' registered
[ INFO] [1465022465.340681835]: Particle Affector Type 'ColourImage' registered
[ INFO] [1465022465.340714102]: Particle Affector Type 'ColourInterpolator' registered
[ INFO] [1465022465.340749023]: Particle Affector Type 'Scaler' registered
[ INFO] [1465022465.340788204]: Particle Affector Type 'Rotator' registered
[ INFO] [1465022465.340822985]: Particle Affector Type 'DirectionRandomiser' registered
[ INFO] [1465022465.340856509]: Particle Affector Type 'DeflectorPlane' registered
[ INFO] [1465022465.340892197]: Plugin successfully installed
[ INFO] [1465022465.340944159]: CPU Identifier & Features
[ INFO] [1465022465.340975797]: -------------------------
[ INFO] [1465022465.341024966]: * CPU ID: GenuineIntel: Intel(R) Xeon(R) CPU E5-2620 v3 # 2.40GHz
[ INFO] [1465022465.341055626]: * SSE: yes
[ INFO] [1465022465.341088102]: * SSE2: yes
[ INFO] [1465022465.341115061]: * SSE3: yes
[ INFO] [1465022465.341142159]: * MMX: yes
[ INFO] [1465022465.341169188]: * MMXEXT: yes
[ INFO] [1465022465.341198382]: * 3DNOW: no
[ INFO] [1465022465.341225271]: * 3DNOWEXT: no
[ INFO] [1465022465.341252090]: * CMOV: yes
[ INFO] [1465022465.341279817]: * TSC: yes
[ INFO] [1465022465.341307055]: * FPU: yes
[ INFO] [1465022465.341335899]: * PRO: yes
[ INFO] [1465022465.341365232]: * HT: no
[ INFO] [1465022465.341394426]: -------------------------
[ INFO] [1465022465.341426693]: ******************************
*** Starting GLX Subsystem ***
******************************
[ INFO] [1465022465.341480959]: Registering ResourceManager for type Texture
[ INFO] [1465022465.341578667]: GLRenderSystem::_createRenderWindow "OgreWindow(0)", 1x1 windowed miscParams: FSAA=4 externalGLControl= macAPI=carbon parentWindowHandle=56623105
Segmentation fault (core dumped)
And when I run gdb, actually I know little about this, I got the result below.
Starting program: /opt/ros/indigo/lib/rviz/rviz
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[ INFO] [1465023839.514368832]: rviz version 1.11.14
[ INFO] [1465023839.514489727]: compiled against Qt version 4.8.6
[ INFO] [1465023839.514521295]: compiled against OGRE version 1.8.1 (Byatis)
[New Thread 0x7fffdf758700 (LWP 22754)]
[New Thread 0x7fffdef57700 (LWP 22755)]
[New Thread 0x7fffde756700 (LWP 22756)]
[New Thread 0x7fffddf55700 (LWP 22761)]
Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb)
What can I do ? I have tried the approach about changing OGRE_RTT_MODE to Copy or FBO, and still

Checking RVIZ :
the default suggestion will be using RVIZ with no parameters,
$ rosrun rviz rviz
If that dosen't work either, it's maybe because of a bad config file. So, delete ~/.rviz folder and start over again. I once had the same issue and this solved it.
Also, if you have recently updated your ROS distro, you may have to update your graphic cards as well. If not,give a shot for the solutions in RVIZ troubleshouting page.
Checking Ogre :
In a terminal, run the following commands :
$ glxgears
this is a good test to see if OpenGL is working for you at the system/driver level. (you'll get a pretty window with mechanical stuff going)
Also
$ glxinfo | grep 'OpenGL renderer'
should not say 'software rasterizer', it should be the model of your graphics card.
If those don't work, that means you have an outdated graphic card and Ogre is not working. (which makes it independant from Rviz).

Uninstalling rviz and rebuilding it from source solved it for me.
Removing rviz:
sudo apt-get remove ros-noetic-rviz
Building from source:
git clone https://github.com/ros-visualization/rviz
catkin build rviz

Related

How to get ROS GSCam to Work in a Docker Container?

I am trying to use the ROS GSCam package in a Docker container to read from a camera stream and publish to a ROS topic. Using GStreamer via gst-launch works fine in the container. For example, running
gst-launch-1.0 -v tcpclientsrc host=10.0.0.20 port=7001 ! decodebin ! filesink location= xyz.flv
in the container successfully saves the camera stream to the xyz.flv file. When I try to use GSCam using the following commands
roscd gscam
mkdir bin
cd bin
export GSCAM_CONFIG="tcpclientsrc host=10.0.0.20 port=7001 ! decodebin ! ffmpegcolorspace"
rosrun gscam gscam
the camera stream is published to a ROS topics if these commands are run outside the container, but when run inside the container they result in the following output:
[ INFO] [1625351876.482947987]: Using GStreamer config from env: "tcpclientsrc host=10.0.0.20 port=7001 ! decodebin ! ffmpegcolorspace"
[ INFO] [1625351876.486672898]: using default calibration URL
[ INFO] [1625351876.486702714]: camera calibration URL: file:///root/.ros/camera_info/camera.yaml
[ INFO] [1625351876.486735225]: Unable to open camera calibration file [/root/.ros/camera_info/camera.yaml]
[ WARN] [1625351876.486750795]: Camera calibration file /root/.ros/camera_info/camera.yaml not found.
[ INFO] [1625351876.486759250]: Loaded camera calibration from
[ INFO] [1625351876.502708790]: Time offset: 1625351189.738
[FATAL] [1625351876.519311654]: Failed to PAUSE stream, check your GStreamer configuration.
[FATAL] [1625351876.519330710]: Failed to initialize GSCam stream!
What can I do to fix this?
EDIT. The problem seems to come from this piece of the code:
gst_element_set_state(pipeline_, GST_STATE_PAUSED);
if (gst_element_get_state(pipeline_, NULL, NULL, -1) == GST_STATE_CHANGE_FAILURE) {
ROS_FATAL("Failed to PAUSE stream, check your gstreamer configuration.");
return false;
}
Using code from here, I can see that the return value of gst_element_set_state() is SUCCESS, as is the return value of gst_element_get_state() for each element of the pipeline (tcpclientsrc0, decodebin0, and appsink0). Strangely however, the output of gst_element_get_state(pipeline_, NULL, NULL, -1) is FAILURE, which doesn't seem to make sense. What am I missing? Can a pipeline state change fail despite all its elements changing state successfully? or does the pipeline have some other (perhaps hidden) element that fails to change state?
From the answer given here I realized that my problem stemmed from the fact that the common ROS GSCam package (downloaded via ppa) uses GStreamer0.10, but because I was building the package from source inside the Docker image it used GStreamer1.0. Changing the build dependencies to
<build_depend>libgstreamer0.10-dev</build_depend>
<build_depend>libgstreamer-plugins-base0.10-dev</build_depend>
in the package.xml file solved the problem.

How do I add command line launch arguments to a Release target in a CMake-managed C++ project in MSVC 2019?

My goal is to run e.g. MyTarget.exe "C:\Users\MHebes\config.json from MSVC.
I can do this in Debug mode, but can't get it to work in Release.
If I right-click on my top-level CMakeLists.txt, I can see the launch.vs.json for the current open folder:
..\..\..\..\AppData\Local\Microsoft\VisualStudio\16.0_45505961\OpenFolder\launch_schema.json:
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"type": "default",
"project": "CMakeLists.txt",
"projectTarget": "MyTarget.exe (apps\\MyTarget\\Debug\\MyTarget.exe)",
"name": "Debug launch target for MyTarget",
"args": [
"C:/Users/MHebes/config.json"
]
}
]
}
I don't fully understand this in the first place, since the launch.vs.json docs don't mention anything about a "configurations" list but this was how it was auto-populated when I added a new configuration. Regardless, this works in debug modeā€”the "Debug launch target for MyTarget" option shows up in the Select Startup Item... list when Debug is selected in the dropdown.
I have added a Release/RelWithDebugInfo configuration to my CMakeSettings.json.
But when I actually switch the build to Release, the Select Startup Item... list is only populated with default CMakeTargets.
How do I add command-line launch arguments to Release builds?
My end goal is that when I Start Debugging in Release mode, it will build a Release exe and run it with some args.
I think I figured it out. I added another configuration with a different target:
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"type": "default",
"project": "CMakeLists.txt",
"projectTarget": "MyTarget.exe (apps\\MyTarget\\Debug\\MyTarget.exe)",
"name": "Debug launch target for MyTarget",
"args": [
"C:/Users/MHebes/config.json"
]
},
{
"type": "default",
"project": "CMakeLists.txt",
"projectTarget": "MyTarget.exe (apps\\MyTarget\\RelWithDebInfo\\MyTarget.exe)",
"name": "RelWithDebInfo launch target for MyTarget",
"args": [
"C:/Users/MHebes/config.json"
]
}
]
}
The Microsoft Docs page on Configure CMake debugging sessions says:
projectTarget: Specifies the CMake target to invoke when building the project. Visual Studio autopopulates this property if you enter launch.vs.json from the Debug Menu or Targets View. This value must match the name of an existing debug target listed in the Startup Item dropdown.
Since Visual studio populates the Startup list with names that include the path to the executable, and because that path is dependent on the configuration name (i.e. buildRoot in CMakeSettings.json includes ${name} in the path by default), this explains why projectTarget must include the configuration path.
This seems like an insane interface to me. Maybe I'm doing something wrong.

Node-gyp Library not loaded: /usr/local/lib/libmtp.9.dylib

I have been attempting to make a nodejs-native-addon which uses libmtp to carry out certain functions. I have been successful in the building the app but the app is throwing Library not loaded: /usr/local/lib/libmtp.9.dylib. Referenced from: /path/build/Debug/nbind.node. Reason: image not found error when I try to run it on another macbook where the libmtp isn't installed.
This is my binding.gyp file:
{
"targets": [
{
"includes": [
"auto.gypi"
],
"sources": [
"src/native/mtp.cc"
],
"link_settings": {
"libraries": [
"-lmtp"
],
},
}
],
"includes": [
"auto-top.gypi"
],
}
I even attempted to include the dylib file in the libraries option
"link_settings": {
"libraries": [
"<(module_root_dir)/src/native/lib/libmtp.9.dylib"
]
}
but the app fails to start with the Library not loaded: /usr/local/lib/libmtp.9.dylib. Referenced from: /path/build/Debug/nbind.node. Reason: image not found error.
Any help will be appreciated.
The error is indicating that the library libmtp.9.dylib cannot be found in the standard library include path /usr/local/lib
Try setting the environment variable LD_LIBRARY_PATH to point to the location where you have the libmtp.9.dylib before running the node.
One solution would be to create a symlink in a known rpath like /usr/local/lib manually to your built library. Not ideal but it may provide a workaround for at least having successful builds in development.
ln -s <absolute_path>/src/native/lib/libmtp.9.dylib /usr/local/lib/libmtp.9.dylib
This allows the binding.gyp file to find the library without it needing to configure an rpath with whatever process is throwing the error. This is easier in my opinion than tracking down the binding.gyp trace.

Build flatpak package from prebuild binaries (mono and gtk-sharp2 project)

I'm trying to pack my application with flatpak and currently I'm stuck:
How do I make shure, that the runtimes are installed on the target system? I need mono, gtk-sharp2, SFML, CSFML. I learned about the basic runtime, but what about my dependencies?
How do I run the application? I tried
[sven#localhost flatpak]$ flatpak-builder --run build net.sourceforge.audiocuesheet.json /app/AudioCuesheetEditor/./AudioCuesheetEditor
bwrap: execvp /app/AudioCuesheetEditor/./AudioCuesheetEditor: No such file or directory
Some more information about the project:
net.sourceforge.audiocuesheet.json:
{
"app-id": "net.sourceforge.audiocuesheet",
"runtime": "org.gnome.Platform",
"runtime-version": "3.26",
"sdk": "org.gnome.Sdk",
"command": "/AudioCuesheetEditor/AudioCuesheetEditor",
"modules": [
{
"name": "AudioCuesheetEditor",
"buildsystem": "simple",
"build-commands": [
"cp -r AudioCuesheetEditor /app/AudioCuesheetEditor",
"chmod +x /app/AudioCuesheetEditor/AudioCuesheetEditor"
],
"sources": [
{
"type": "archive",
"path": "AudioCuesheetEditor-linux-x64-v2.4.2.zip",
"dest": "AudioCuesheetEditor"
}
]
}
]
}
As you can see, the archive has prebuild binaries, which I would like to deploy to the target maschines. I'm new to flatpak and not really shure, if I'm doing right, so maybe some help from you would be perfect.
Thanks
Sven

Link1104 cannot open file tbb_debug.lib

I tried to adjust the tbb library for c++ on visual studio 2013 ultimate. but I get the error above. I have made the following adjustments:
Go to [Project] ! [ Your Application i Properties] ! [Debugging] ! [Environment]
PATH=%PATH%;C:\multi-core pr\tbb42_20140122oss_osx_0\tbb42_20140122oss\bin
[Project] [ Your Application i Properties] --- C/C++----General---additional
directories
C:\multi-core pr\tbb42_20140122oss_osx_0\tbb42_20140122oss\include
[Project] [ Your Application i Properties] --- Linker----General--Additional
library dependencies
C:\multi-core pr\tbb42_20140122oss_osx_0\tbb42_20140122oss\lib\
[Project] [ Your Application i Properties] ---Input ----additional dependcies
tbb_debug.lib;
But it doesn't work. Could you please help me?