Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] ROS2 breakpoints not working on composable node ! #1269

Open
2 tasks done
jalenzz opened this issue Jan 10, 2024 · 4 comments
Open
2 tasks done

[bug] ROS2 breakpoints not working on composable node ! #1269

jalenzz opened this issue Jan 10, 2024 · 4 comments
Assignees
Labels
bug Something isn't working Debugging ROS2

Comments

@jalenzz
Copy link

jalenzz commented Jan 10, 2024

  • Linux: Ubuntu 22.04
  • ROS 2: humble

<Version of the plugin>
v0.9.2

<Copy the Version information from the Help | About menu>
Version: 1.85.1
Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
Date: 2023-12-13T09:47:11.635Z
Electron: 25.9.7
ElectronBuildId: 25551756
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Linux x64 6.2.0-39-generic

what is the bug

<current behavior>

I'm trying to debug a ros2 program that was started via a launch file, and I hit a breakpoint
When I turn on debugging, the program runs normally, but it doesn't stop at the breakpoint.

// launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "ROS: Launch",
            "request": "launch",
            "target": "path to launch",
            "type": "ros",
            "preLaunchTask": "debug workspace"
        }
    ]
}
// a part of tasks.json
        {
            "label": "debug workspace",
            "detail": "Build ROS 2 workspace with debug symbols",
            "type": "shell",
            "command": "colcon build --symlink-install  --cmake-args '-DCMAKE_BUILD_TYPE=Debug'",
            "group": "build",
            "problemMatcher": "$gcc"
        },

additional context

<any additional information would be helpful for a better understanding>
My ros2 program is written in components, and the launch in the launch file is through ComposableNodeContainer. Will this affect the debug?

    serial = ComposableNodeContainer(
        name='serial',
        namespace='',
        package='rclcpp_components',
        executable='component_container',
        composable_node_descriptions=[
            ComposableNode(
                package = 'serial',
                plugin = 'sensor::SerialForUnity',
                name = 'serial_for_unity_node',
                parameters = [config]
            )
        ]
    )
@jalenzz jalenzz added the bug Something isn't working label Jan 10, 2024
@Ryanf55
Copy link

Ryanf55 commented Jan 13, 2024

I have this problem too. Same environment, aside from I'm using the remote-ssh extension too. Host OS is windows 10, server running ROS is ubuntu 22.04. GDB works fine with this method:
https://navigation.ros.org/tutorials/docs/get_backtrace.html#from-a-node

I just want GDB working in VSCode.

launch.json

        {
            "name": "ROS: Launch",
            "type": "ros",
            "request": "launch",
            "target": "/home/ryan/Dev/ros2_ws/src/grid_map_geo/install/grid_map_geo/share/grid_map_geo/launch/load_vrt_launch.xml",
            "preLaunchTask": "colcon build debug"
        }

tasks.json

        {
            "label": "colcon build debug",
            "detail": "Build ROS 2 workspace with debug symbols",
            "type": "shell",
            "command": "colcon build --symlink-install --mixin debug",
            "group": "build",
            "problemMatcher": "$gcc"
        },

You can see that the debug panel knows about the breakpoints, but they aren't hit.
image

That said, looks like the pre-release version works!
image

@jalenzz
Copy link
Author

jalenzz commented Jan 15, 2024

@Ryanf55 Yes, I had tried pre-release version, but still not work.

Is you used composable nodes?

I tried normal nodes, and they stop at breakpoints, but not composable nodes.

@jalenzz jalenzz changed the title [bug] ROS2 breakpoints not working ! [bug] ROS2 breakpoints not working on composable node ! Jan 15, 2024
@jalenzz
Copy link
Author

jalenzz commented Jan 15, 2024

from launch import LaunchDescription
from launch_ros.actions import ComposableNodeContainer
from launch_ros.descriptions import ComposableNode

def generate_launch_description():

    composable_node_container = ComposableNodeContainer (
        name='composable_node_container',
        namespace='',
        package='rclcpp_components',
        executable='component_container',
        composable_node_descriptions=[
            ComposableNode(
                package = 'camerainfo',
                plugin = 'camerainfo::CameraInfoNode',
                name = 'camera_info_node',
                extra_arguments = [{"use_intra_process_comms": True}],
            ),
            ComposableNode(
                package = 'camera',
                plugin = 'sensor::CameraNode',
                name = 'camera_node',
                extra_arguments = [{"use_intra_process_comms": True}]
            )
        ]
    )
    return LaunchDescription([composable_node_container])

@Ryanf55
Copy link

Ryanf55 commented Jan 15, 2024

@Ryanf55 Yes, I had tried pre-release version, but still not work.

Is you used composable nodes?

I tried normal nodes, and they stop at breakpoints, but not composable nodes.

Only normal nodes were attempted. I can't get any of it to work now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Debugging ROS2
Projects
None yet
Development

No branches or pull requests

3 participants