8wDlpd.png
8wDFp9.png
8wDEOx.png
8wDMfH.png
8wDKte.png

在 gnome 扩展中截屏时删除弹出窗口和声音

ryandra 2月前

68 0

当在 gnome 扩展中通过 captureScreenshot 函数进行截图时,会弹出一个窗口,并播放典型的拍照声音。extension.js:import {Extension} from 'reso...

在gnome扩展中截取屏幕截图时 captureScreenshot ,会弹出一个窗口,并播放典型的拍照声音。

扩展.js:

import {Extension} from 'resource:///org/gnome/shell/extensions/extension.js';
import * as Screenshot from 'resource:///org/gnome/shell/ui/screenshot.js';
import Shell from 'gi://Shell';

export default class ExampleExtension extends Extension {
async enable() {
    const shooter = new Shell.Screenshot();
    const [content] = await shooter.screenshot_stage_to_content();
    const texture = content.get_texture();
    await Screenshot.captureScreenshot(texture, null, 1, null);
}

disable() {
}
}

弹出窗口:

enter image description here

如何安静地截取屏幕截图,不弹出窗口,不发出声音?例如,当外部应用程序通过 dbus API https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/blob/main/data/org.gnome.Shell.Screenshot.xml#L46 。在这种情况下,屏幕截图只是悄悄地添加到磁盘中,仅此而已。

Ubuntu 24.04,GNOME 46,Wayland

帖子版权声明 1、本帖标题:在 gnome 扩展中截屏时删除弹出窗口和声音
    本站网址:http://xjnalaquan.com/
2、本网站的资源部分来源于网络,如有侵权,请联系站长进行删除处理。
3、会员发帖仅代表会员个人观点,并不代表本站赞同其观点和对其真实性负责。
4、本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
5、站长邮箱:yeweds@126.com 除非注明,本帖由ryandra在本站《ubuntu》版块原创发布, 转载请注明出处!
最新回复 (0)
  • 当我在 Linux 终端中导入 TensorFlow 时,出现以下错误:非法指令(核心转储)我已经在 Linux 终端中使用 pip install tensorflow 安装了 TensorFlow,没有出现任何错误

    当我在 Linux 终端导入 TensorFlow 时,出现以下错误:

    非法指令(核心转储)

    我已经在 Linux 终端中安装了 TensorFlow pip install tensorflow ,没有显示任何错误,并且一切都已成功安装。我也尝试从 GitHub 安装它,但问题仍然存在。我在 Ubuntu-20.04 虚拟机上安装了 Python3。

    我该如何解决它?

  • 为了在我的 Unity 游戏中创建爆炸,我将 3 个运行时配置的粒子系统集中起来,并将停止操作设置为禁用(这样我就可以将所有禁用的粒子对象集中起来);我做了类似的事情:p...

    为了在我的 Unity 游戏中创建爆炸,我将 3 个运行时配置的粒子系统池化,并将停止操作设置为禁用(这样我就可以将所有禁用的粒子对象池化);

    我做了这样的事情:

    public void CreateExplosions()
    {
        Pool_Particle_Simple(position, rotation, 8);
        Pool_Particle_Simple(position, rotation, 9);
        Pool_Particle_Simple(position, rotation, 10);
    }
    public PoolableParticle GetAvailabe_PoolParticle(PoolableParticle[] particles, int start, int end)
        {
            for (int i = start; i < end; i++)
            {
                PoolableParticle particle = particles[i];
                switch (particle.gameObject.activeInHierarchy)
                {
                    case false:
                        particles[i].gameObject.SetActive(true);
                        return particles[i];
    
                }
            }
            return null;
        }
    
        public void Pool_Particle_Simple(Vector3 position, Quaternion rotation, ushort type)
        {
            PoolableParticle particle = GetAvailabe_PoolParticle(poolableParticles, 0, poolableParticles.Length);
            switch (ReferenceEquals(particle, null))
            {
                case false:
                  
                    ParticleSystem particleSystem = particle.ParticleSystem;
                    SetupParticle(particleSystem, particle.ParticleSystemRenderer, type);
    
                    particleSystem.transform.position = position;
                    particle.transform.rotation = rotation;                
                    particleSystem.Play();
                    break;
            }
        }
    
        public void SetupParticle(ParticleSystem particleSystem, ParticleSystemRenderer renderer, int type)//0 = Smoke01, 1 = Smoke02, ...
        {
            switch (type)
            {
                case 0://Smoke01
    
                    ParticleSystem.MainModule main = particleSystem.main;
                    main.duration = 5;
                    main.loop = false;
                    main.prewarm = true;
                    main.startDelay = 0;
                    main.startLifetime = new ParticleSystem.MinMaxCurve(4, 6);
                    main.startSpeed = new ParticleSystem.MinMaxCurve(.5f, 1f);
                    main.startSize3D = false;
                    main.startSize = 55;
                    main.startRotation = 0;
                    main.flipRotation = 1;
                    main.startColor = Color.white;
                    main.gravityModifier = 0;
                    main.simulationSpace = ParticleSystemSimulationSpace.World;
                    main.simulationSpeed = 1;
                    main.scalingMode = ParticleSystemScalingMode.Local;
                    main.emitterVelocityMode = ParticleSystemEmitterVelocityMode.Rigidbody;
                    main.maxParticles = 15;
                    main.cullingMode = ParticleSystemCullingMode.AlwaysSimulate;
                    main.ringBufferMode = ParticleSystemRingBufferMode.Disabled;
    
                    ParticleSystem.EmissionModule emission = particleSystem.emission;
                    emission.rateOverTime = 3;
                    emission.rateOverDistance = 0;
                    emission.burstCount = 0;
    
                    ParticleSystem.VelocityOverLifetimeModule velocity = particleSystem.velocityOverLifetime;
                    velocity.enabled = false;
    
                    ParticleSystem.LimitVelocityOverLifetimeModule limitVelocity = particleSystem.limitVelocityOverLifetime;
                    limitVelocity.enabled = false;
    
                    ParticleSystem.ShapeModule shape = particleSystem.shape;
                    shape.enabled = true;
                    shape.shapeType = ParticleSystemShapeType.Cone;
                    shape.angle = 25;
                    shape.radius = 0.3822865f;
                    shape.radiusThickness = 1;
                    shape.arc = 360;
                    shape.arcMode = ParticleSystemShapeMultiModeValue.Random;
                    shape.arcSpread = 0;
                    shape.length = 5;
                    shape.position = Vector3.zero;
                    shape.rotation = Vector3.zero;
                    shape.scale = Vector3.one;
                    shape.alignToDirection = false;
                    shape.randomDirectionAmount = 1;
                    shape.sphericalDirectionAmount = 0;
                    shape.randomPositionAmount = 0;
    
                    ParticleSystem.ForceOverLifetimeModule force = particleSystem.forceOverLifetime;
                    force.enabled = false;
    
                    ParticleSystem.ColorOverLifetimeModule color = particleSystem.colorOverLifetime;
                    color.enabled = true;
    
                    Gradient gradient = new Gradient();
                    gradient.mode = GradientMode.Blend;
                    GradientColorKey[] colorKeys = new GradientColorKey[2];
                    colorKeys[0] = new GradientColorKey(Color.white, 0f);
                    colorKeys[1] = new GradientColorKey(Color.white, 1f);
                    GradientAlphaKey[] alphaKeys = new GradientAlphaKey[4];
                    alphaKeys[0] = new GradientAlphaKey(0.12f, 0);
                    alphaKeys[1] = new GradientAlphaKey(.45f, 0.27f);
                    alphaKeys[2] = new GradientAlphaKey(.70f, .805f);
                    alphaKeys[3] = new GradientAlphaKey(0f, 1f);
                    gradient.SetKeys(colorKeys, alphaKeys);
                    color.color = gradient;
    
                    ParticleSystem.SizeOverLifetimeModule size = particleSystem.sizeOverLifetime;
                    size.separateAxes = false;
                    size.size = new ParticleSystem.MinMaxCurve(0, 1);
    
                    ParticleSystem.RotationOverLifetimeModule rotation = particleSystem.rotationOverLifetime;
                    rotation.enabled = true;
                    rotation.separateAxes = false;
          
                    rotation.z = .45f;
    
                    ParticleSystem.SubEmittersModule subEmitters = particleSystem.subEmitters;
                    subEmitters.enabled = false;
    
                    ParticleSystem.NoiseModule noise = particleSystem.noise;
                    noise.enabled = false;
    
                    ParticleSystem.TrailModule trails = particleSystem.trails;
                    trails.enabled = false;
    
                    renderer.renderMode = ParticleSystemRenderMode.Mesh;
                    renderer.meshDistribution = ParticleSystemMeshDistribution.UniformRandom;
                    renderer.sortMode = ParticleSystemSortMode.None;
                    renderer.sortingFudge = 0;
                    renderer.alignment = ParticleSystemRenderSpace.Local;
                    renderer.flip = Vector3.zero;
                    renderer.enableGPUInstancing = false;
                    renderer.pivot = Vector3.zero;
                    renderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
                    renderer.sortingLayerID = 0;
                    renderer.lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.BlendProbes;
                    renderer.probeAnchor = null;
    
                    break;
    
                case 8://Small Explosion (base)
    
                    main = particleSystem.main;
                    main.duration = 2f;
                    main.loop = false;
                    main.prewarm = false;
                    main.startDelay = 0f;
                    main.startLifetime = new ParticleSystem.MinMaxCurve(.75f, 1f);
                    main.startSpeed = 0;
                    main.startSize3D = false;
                    main.startSize = new ParticleSystem.MinMaxCurve(1f, 2f);
                    main.startRotation = new ParticleSystem.MinMaxCurve(0, 360);
                    main.flipRotation = 0;
                    main.startColor = Color.white;
                    main.gravityModifier = 0;
                    main.simulationSpace = ParticleSystemSimulationSpace.Local;
                    main.simulationSpeed = 1;
                    main.scalingMode = ParticleSystemScalingMode.Local;
                    main.emitterVelocityMode = ParticleSystemEmitterVelocityMode.Transform;
                    main.maxParticles = 1000;
                    main.cullingMode = ParticleSystemCullingMode.AlwaysSimulate;
                    main.ringBufferMode = ParticleSystemRingBufferMode.Disabled;
    
                    emission = particleSystem.emission;
                    emission.rateOverTime = 0;
                    emission.rateOverDistance = 0;
                    ParticleSystem.Burst[] bursts = new ParticleSystem.Burst[1];
                    bursts[0] = new ParticleSystem.Burst(0f, (short)5, (short)5, 1, 0.050f);
                    emission.SetBursts(bursts);
    
                    shape = particleSystem.shape;
                    shape.enabled = true;
                    shape.shapeType = ParticleSystemShapeType.Sphere;
                    shape.radius = 0.2442369f;
                    shape.radiusThickness = 1;
                    shape.arc = 360;
                    shape.arcMode = ParticleSystemShapeMultiModeValue.Random;
                    shape.arcSpread = 0;
                    shape.position = Vector3.zero;
                    shape.rotation = Vector3.zero;
                    shape.scale = Vector3.one;
                    shape.alignToDirection = false;
                    shape.randomDirectionAmount = 0;
                    shape.randomPositionAmount = 0;
                    shape.sphericalDirectionAmount = 0;
    
                    velocity = particleSystem.velocityOverLifetime;
                    velocity.space = ParticleSystemSimulationSpace.Local;
                    velocity.enabled = true;
                    velocity.xMultiplier = 0;
                    velocity.orbitalX = 0;
                    velocity.orbitalOffsetX = 0;
                    velocity.yMultiplier = 0;
                    velocity.orbitalY = 0;
                    velocity.orbitalOffsetY = 0;
                    velocity.zMultiplier = 0;
                    velocity.orbitalZ = 0;
                    velocity.orbitalOffsetZ = 0;
                    velocity.radial = new ParticleSystem.MinMaxCurve(0f, 2f);
                    velocity.speedModifier = 1;
    
                    force = particleSystem.forceOverLifetime;
                    force.enabled = false;
    
                    limitVelocity = particleSystem.limitVelocityOverLifetime;
                    limitVelocity.enabled = false;
    
                    color = particleSystem.colorOverLifetime;
                    color.enabled = true;
                    gradient = new Gradient();
                    gradient.mode = GradientMode.Blend;
                    colorKeys = new GradientColorKey[3];
                    colorKeys[0] = new GradientColorKey(Color.white, .019f);
                    colorKeys[1] = new GradientColorKey(Color.black, .036f);
                    colorKeys[2] = new GradientColorKey(Color.black, .694f);
                    alphaKeys = new GradientAlphaKey[3];
                    alphaKeys[0] = new GradientAlphaKey(1f, 0);
                    alphaKeys[1] = new GradientAlphaKey(1f, 0.688f);
                    alphaKeys[2] = new GradientAlphaKey(0f, 1f);
                    gradient.SetKeys(colorKeys, alphaKeys);
                    color.color = gradient;
    
                    size = particleSystem.sizeOverLifetime;
                    size.separateAxes = false;
                    size.size = new ParticleSystem.MinMaxCurve(1, 2);
    
                    rotation = particleSystem.rotationOverLifetime;
                    rotation.enabled = false;
    
                    subEmitters = particleSystem.subEmitters;
                    subEmitters.enabled = false;
    
                    noise = particleSystem.noise;
                    noise.enabled = false;
    
                    trails = particleSystem.trails;
                    trails.enabled = false;
    
                    renderer.renderMode = ParticleSystemRenderMode.Billboard;
                    renderer.normalDirection = 1;
                    renderer.sortMode = ParticleSystemSortMode.Distance;
                    renderer.sortingFudge = 0;
                    renderer.minParticleSize = 0;
                    renderer.maxParticleSize = 5f;
                    renderer.alignment = ParticleSystemRenderSpace.View;
                    renderer.flip = new Vector3(.5f, .5f, 0);
                    renderer.allowRoll = true;
                    renderer.pivot = Vector3.zero;
                    renderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
                    renderer.shadowBias = 0;
                    renderer.sortingLayerID = 0;
                    renderer.sortingOrder = 0;
                    renderer.lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off;
    
                    break;
    
                case 9://Small Explosion (additional smoke)
    
                    main = particleSystem.main;
                    main.duration = 2f;
                    main.loop = false;
                    main.prewarm = false;
                    main.startDelay = 0f;
                    main.startLifetime = new ParticleSystem.MinMaxCurve(1.5f, 1.2f);
                    main.startSpeed = 0;
                    main.startSize3D = false;
                    main.startSize = new ParticleSystem.MinMaxCurve(1.5f, 1f);
                    main.startRotation = new ParticleSystem.MinMaxCurve(0, 360);
                    main.flipRotation = 0;
                    main.startColor = Color.white;
                    main.gravityModifier = 0;
                    main.simulationSpace = ParticleSystemSimulationSpace.Local;
                    main.simulationSpeed = 1;
                    main.scalingMode = ParticleSystemScalingMode.Local;
                    main.emitterVelocityMode = ParticleSystemEmitterVelocityMode.Transform;
                    main.maxParticles = 1000;
                    main.cullingMode = ParticleSystemCullingMode.AlwaysSimulate;
                    main.ringBufferMode = ParticleSystemRingBufferMode.Disabled;
    
                    emission = particleSystem.emission;
                    emission.rateOverTime = 0;
                    emission.rateOverDistance = 0;
                    bursts = new ParticleSystem.Burst[1];
                    bursts[0] = new ParticleSystem.Burst(0f, (short)10, (short)10, 1, 0.100f);
                    emission.SetBursts(bursts);
    
                    shape = particleSystem.shape;
                    shape.enabled = true;
                    shape.shapeType = ParticleSystemShapeType.Sphere;
                    shape.radius = 0.3957672f;
                    shape.radiusThickness = 0;
                    shape.arc = 360;
                    shape.arcMode = ParticleSystemShapeMultiModeValue.Random;
                    shape.arcSpread = 0;
                    shape.position = Vector3.zero;
                    shape.rotation = Vector3.zero;
                    shape.scale = Vector3.one;
                    shape.alignToDirection = false;
                    shape.randomDirectionAmount = 0;
                    shape.randomPositionAmount = 0;
                    shape.sphericalDirectionAmount = 0;
    
                    velocity = particleSystem.velocityOverLifetime;
                    velocity.enabled = true;
                    velocity.xMultiplier = 0;
                    velocity.orbitalX = 0;
                    velocity.orbitalOffsetX = 0;
                    velocity.yMultiplier = 2;
                    velocity.orbitalY = 0;
                    velocity.orbitalOffsetY = 0;
                    velocity.zMultiplier = 0;
                    velocity.orbitalZ = 0;
                    velocity.orbitalOffsetZ = 0;
                    velocity.radial = new ParticleSystem.MinMaxCurve(0f, 1f);
                    velocity.speedModifier = 1;
    
                    force = particleSystem.forceOverLifetime;
                    force.enabled = false;
    
                    limitVelocity = particleSystem.limitVelocityOverLifetime;
                    limitVelocity.enabled = false;
    
                    color = particleSystem.colorOverLifetime;
                    color.enabled = true;
                    gradient = new Gradient();
                    gradient.mode = GradientMode.Blend;
                    colorKeys = new GradientColorKey[2];
                    colorKeys[0] = new GradientColorKey(new Color(255, 107, 1), 0f);
                    colorKeys[1] = new GradientColorKey(new Color(41, 41, 41), .341f);
    
                    alphaKeys = new GradientAlphaKey[4];
                    alphaKeys[0] = new GradientAlphaKey(0f, 0.01f);
                    alphaKeys[1] = new GradientAlphaKey(.5f, 0.247f);
                    alphaKeys[2] = new GradientAlphaKey(1f, .618f);
                    alphaKeys[3] = new GradientAlphaKey(0f, 1f);
                    gradient.SetKeys(colorKeys, alphaKeys);
                    color.color = gradient;
    
                    size = particleSystem.sizeOverLifetime;
                    size.separateAxes = false;
                    size.size = new ParticleSystem.MinMaxCurve(1, 2);
    
                    rotation = particleSystem.rotationOverLifetime;
                    rotation.enabled = false;
    
                    subEmitters = particleSystem.subEmitters;
                    subEmitters.enabled = false;
    
                    noise = particleSystem.noise;
                    noise.enabled = false;
    
                    trails = particleSystem.trails;
                    trails.enabled = false;
    
                    renderer.renderMode = ParticleSystemRenderMode.Billboard;
                    renderer.normalDirection = 1;
                    renderer.sortMode = ParticleSystemSortMode.Distance;
                    renderer.sortingFudge = 0;
                    renderer.minParticleSize = 0;
                    renderer.maxParticleSize = 5f;
                    renderer.alignment = ParticleSystemRenderSpace.View;
                    renderer.flip = new Vector3(.5f, .5f, 0);
                    renderer.allowRoll = true;
                    renderer.pivot = Vector3.zero;
                    renderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
                    renderer.shadowBias = 0;
                    renderer.sortingLayerID = 0;
                    renderer.sortingOrder = 1;
                    renderer.lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off;
    
                    break;
    
                case 10://Small Explosion (shockWave)
    
                    main = particleSystem.main;
                    main.duration = 2f;
                    main.loop = false;
                    main.prewarm = false;
                    main.startDelay = 0f;
                    main.startLifetime = .5f;
                    main.startSpeed = 0;
                    main.startSize3D = false;
                    main.startSize = 10;
                    main.startRotation = 0;
                    main.flipRotation = 0;
                    main.startColor = Color.white;
                    main.gravityModifier = 0;
                    main.simulationSpace = ParticleSystemSimulationSpace.Local;
                    main.simulationSpeed = 1;
                    main.scalingMode = ParticleSystemScalingMode.Local;
                    main.emitterVelocityMode = ParticleSystemEmitterVelocityMode.Transform;
                    main.maxParticles = 1000;
                    main.cullingMode = ParticleSystemCullingMode.AlwaysSimulate;
                    main.ringBufferMode = ParticleSystemRingBufferMode.Disabled;
    
                    emission = particleSystem.emission;
                    emission.rateOverTime = 0;
                    emission.rateOverDistance = 0;
                    bursts = new ParticleSystem.Burst[1];
                    bursts[0] = new ParticleSystem.Burst(0f, (short)1, (short)1, 1, 0.010f);
                    emission.SetBursts(bursts);
    
                    shape = particleSystem.shape;
                    shape.enabled = false;
    
                    velocity = particleSystem.velocityOverLifetime;
                    velocity.enabled = false;
    
                    force = particleSystem.forceOverLifetime;
                    force.enabled = false;
    
                    limitVelocity = particleSystem.limitVelocityOverLifetime;
                    limitVelocity.enabled = false;
    
                    color = particleSystem.colorOverLifetime;
                    color.enabled = true;
                    gradient = new Gradient();
                    gradient.mode = GradientMode.Blend;
                    colorKeys = new GradientColorKey[2];
                    colorKeys[0] = new GradientColorKey(Color.white, 0f);
                    colorKeys[1] = new GradientColorKey(Color.white, 1f);
                    alphaKeys = new GradientAlphaKey[2];
                    alphaKeys[0] = new GradientAlphaKey(1f, 0f);
                    alphaKeys[1] = new GradientAlphaKey(0f, 1f);
                    gradient.SetKeys(colorKeys, alphaKeys);
                    color.color = gradient;
    
                    size = particleSystem.sizeOverLifetime;
                    size.separateAxes = false;
                    size.size = new ParticleSystem.MinMaxCurve(0, 1);//Forse no
    
                    rotation = particleSystem.rotationOverLifetime;
                    rotation.enabled = false;
    
                    subEmitters = particleSystem.subEmitters;
                    subEmitters.enabled = false;
    
                    noise = particleSystem.noise;
                    noise.enabled = false;
    
                    trails = particleSystem.trails;
                    trails.enabled = false;
    
                    renderer.renderMode = ParticleSystemRenderMode.Billboard;
                    renderer.normalDirection = 1;
                    renderer.sortMode = ParticleSystemSortMode.None;
                    renderer.sortingFudge = 0;
                    renderer.minParticleSize = 0;
                    renderer.maxParticleSize = 20f;
                    renderer.alignment = ParticleSystemRenderSpace.View;
                    renderer.flip = Vector3.zero;
                    renderer.allowRoll = true;
                    renderer.pivot = Vector3.zero;
                    renderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
                    renderer.shadowBias = 0;
                    renderer.sortingLayerID = 0;
                    renderer.sortingOrder = 1;
                    renderer.lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off;
    
                    break;
    
    
    //.....
    }
    

    问题是,有时我会得到像图片右侧那样的伪像,请 在此处输入图片说明 。相反,我希望得到像左侧那样的结果。通过查看检查器,两个校正粒子分子看起来相等,但正如您所见,结果非常不同(伪像非常大,颜色和形状错误)。什么可能导致该故障?

  • 我正在从 gitHub (https://github.com/niobegrzegorzdec/lsd_slam) 构建并运行一个 ROS 项目,该项目专门为 Ubuntu 20.04 设置,安装了 ROS Noetic 和 catkin 工作区。我可以...

    我正在从 gitHub( https://github.com/niobegrzegorzdec/lsd_slam )构建并运行一个 ROS 项目,该项目专为 Ubuntu 20.04 设置,安装了 ROS Noetic 和 catkin 工作区。我可以从 term 窗口构建项目并正常运行。我还可以使用 ROS VS 插件在 VS Code 中构建并启动它。我可以将 printf 语句添加到代码中,并在代码启动时查看它们的执行情况。

    但是,如果我在 VS Code 中的代码中添加断点,即使在这些明确执行的 printf 语句处,它们也永远不会中断。

    我浏览了 ROS 和其他博客,但一无所获(除了看到这似乎是一个非常常见的问题)。我知道在我上一份工作中,我们能够在 ros 节点中设置断点,所以这似乎是可能的。我猜是缺少一些环境变量或 setup.bash 来使可执行文件在 VS 代码中对 gdb 可见。现在我知道 catkin 构建的 ros 节点可执行文件位于 catkin_ws/devel/lib//,但也许 VS 出于某种原因没有在那里查找。

    因此,当我构建并运行程序时,程序会启动并显示正确的数据。它还会打印出我添加到代码中的消息。但是当我在这些打印语句(或其他任何地方)设置断点时,我从 VS Code 中得到“包含此断点的模块尚未加载或无法获取断点地址”。

    当我克隆另一个 github 项目 VS_Code_ROS 并在完全相同的 ROS/Catkin/VS 环境中构建它时,我可以设置断点并在这些断点处中断。但尽管它是一个 \'ROS\' 程序,它不会使用 ros 命令(如 roslaunch)启动。它实际上只是一个经典的 C++ 可执行文件。

  • Aguy 2月前 0 只看Ta
    引用 5

    我个人很难从 VS Code 调试 C++ ROS 节点,可能是因为 ROS Launch 期间进程生成很复杂。我很确定这是可行的(无论是构建和调试还是附加到进程并调试);但是,对于该特定问题,我建议使用 CLion(例如,如果您有权使用免费的教育许可证)。使用 CLion,通过附加到正在运行的节点进程,可以非常轻松地进行调试。

  • -XX:+HeapDumpOnOutOfMemoryError 的 tomcat 转储文件在哪里?-XX:未指定 HeapDumpPath。tomcat9 是使用 systemctl 启动的。

    关于java:-XX:+ HeapDumpOnOutOfMemoryError的tomcat转储文件在哪里?

    未指定 -XX:HeapDumpPath。

    tomcat9 使用systemctl启动。

返回
作者最近主题: