micro-ROS / micro-ROS/micro-ROS-demos

No access to uROS topics in another terminal

未關閉
#81 11 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
C
星號
101
分支
35
平均合併
4 天 16 小時
30 天內合併 PR
3

描述

Issue template

  • Hardware description: Windows 11, Docker inside VS Code with ROS2
  • OS: Linux
  • Installation type: Installed though first_application_linux
  • Version or commit hash: humble
Steps to reproduce the issue

I followed the tutorial with modified files to make in work on Windows 11.
VS Code configuration:
Dockerfile

FROM osrf/ros:humble-desktop
ARG USERNAME=Jakub
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
    && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
    #
    # [Optional] Add sudo support. Omit if you don't need to install software after connecting.
    && apt-get update \
    && apt-get install -y sudo \
    && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
    && chmod 0440 /etc/sudoers.d/$USERNAME
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y python3-pip
ENV SHELL /bin/bash

# ********************************************************
# * Anything else you want to do like clean up goes here *
# ********************************************************

# [Optional] Set the default user. Omit if you want to keep the default as root.
USER $USERNAME
CMD ["/bin/bash"]

devcontainer.json

{
    "name": "ROS 2 Development Container",
    "privileged": true,
    "remoteUser": "Jakub",
    "build": {
        "dockerfile": "Dockerfile",
        "args": {
            "USERNAME": "Jakub"
        }
    },
    "workspaceFolder": "/home/ws",
    "workspaceMount": "source=${localWorkspaceFolder},target=/home/ws/src,type=bind",
    "customizations": {
        "vscode": {
            "extensions":[
                "ms-vscode.cpptools",
                "ms-vscode.cpptools-themes",
                "twxs.cmake",
                "donjayamanne.python-extension-pack",
                "eamodio.gitlens",
                "ms-iot.vscode-ros"
            ]
        }
    },
    "containerEnv": {
        "ROS_LOCALHOST_ONLY": "1",
        "ROS_DOMAIN_ID": "42"
    },
    "remoteEnv": {
        "DISPLAY": "host.docker.internal:0"
      },
    "runArgs": [
        "-e", "DISPLAY=${env:DISPLAY}",
        "--gpus=all"
    ],
    "mounts": [
        "source=${localWorkspaceFolder}/../cache/ROS_DISTRO/build,target=/home/ws/build,type=bind",
        "source=${localWorkspaceFolder}/../cache/ROS_DISTRO/install,target=/home/ws/install,type=bind",
        "source=${localWorkspaceFolder}/../cache/ROS_DISTRO/log,target=/home/ws/log,type=bind"
    ],
    "postCreateCommand": "sudo rosdep update && sudo rosdep install --from-paths src --ignore-src -y && sudo chown -R Jakub /home/ws/"
}

Then inside the docker I followed the tutorial. I try to run:
First terminal:

source /opt/ros/$ROS_DISTRO/setup.bash
source install/local_setup.bash
ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888

Second terminal:

source /opt/ros/$ROS_DISTRO/setup.bash
source install/local_setup.bash

# Use RMW Micro XRCE-DDS implementation
export RMW_IMPLEMENTATION=rmw_microxrcedds

# Run a micro-ROS node
ros2 run micro_ros_demos_rclc ping_pong

Third terminal:

source /opt/ros/$ROS_DISTRO/setup.bash
source install/local_setup.bash
ros2 topic list
Expected behavior

In the third topic I should be able to see topic named /microROS/pong.

Actual behavior

There are only two topics:

/parameter_events
/rosout
Additional information

When I try to run rviz2 its working correctly, I am able to see topics in every terminal.

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 Dockerfile 和 devcontainer.json 開始,然後重現所連結的 first_application_linux 教學中的三終端設定。將 ROS_LOCALHOST_ONLY 和 ROS_DOMAIN_ID 設定與 agent 和 ping_pong 指令進行比較,並使用 ros2 topic list 驗證結果。當第三個終端中可以看到 /microROS/pong 時即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
c, docker, linux
領域
devops, distributed-systems, networking, robotics
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。