Troubleshooting ROS2 Debugging with PyCharm and Raspberry Pi Docker Compose for MicroROS-Pi5 Robot Car

Problem Context

  • Environment: PyCharm Professional installed on Windows 11, Docker and ROS2 Humble (yahboomtechnology/ros-humble:4.1.2) running in a Docker container on a Raspberry Pi 4 (RPi OS), controlling a MicroROS-Pi5 ROS2 Robot Car for Raspberry Pi 5.
  • Objective: Remotely debug a ROS2 node (publish_ip.py) using PyCharm on the ros2-dev Docker container hosted on the Raspberry Pi, integrated with the MicroROS-Pi5 Robot Car.
  • Current Status: Running docker-compose up -d on the Raspberry Pi successfully brings the ros2-dev container to the "Up" state, with the /root/1.sh script (which initializes ROS2 and runs publish_ip.py) partially succeeding (outputs "Successful"). However, in PyCharm, setting up a "New Target: Docker Compose" and clicking "Next" results in the process hanging for over 3 hours or getting stuck at "Attaching to ...", with the container remaining in the "Created" state. Even after clearing the cache (Invalidate Caches / Restart), the issue persists. Manually running docker-compose up -d on the Raspberry Pi works fine and starts the Docker container, but in PyCharm, the "Next Target: Docker Compose" process occasionally shows as "In Progress" yet sometimes displays only "No Interpreter" when "Next" is clicked, with no Python daemon visible.

Attempts Made

  1. Configuration:
    • Dockerfile: Includes copying the yahboomcar_ws workspace and executing 1.sh (containing source /opt/ros/humble/setup.bash, source /root/yahboomcar_ws/install/setup.bash, echo "Successful", systemctl start supervisor, and python3 ~/publish_ip.py).
    • docker-compose.yml: Configured with volumes: - /home/pi/project:/project, command: /bin/bash -c "/root/1.sh", and container_name: ros2-dev.
    • Path Mappings: Set to C:\Users\계정\PyCharmProjects\ros2_project → /project.
    • Interpreter: /usr/bin/python3, Server: Docker2 (RPi SSH).
  2. Execution:
    • Successful docker-compose up -d on RPi with logs showing "Successful" and MY_DOMAIN_ID: 20.
    • Attempted docker exec -it ros2-dev /bin/bash /root/1.sh manually (result unclear).
  3. Troubleshooting:
    • Invalidate Caches / Restart, disabled Docker Compose V2 and Targets API.
    • Removed existing containers (docker rm -f ros2-dev, docker-compose down).
    • Checked network connectivity (ping RPi_IP) and retested SSH connection.
    • Pruned <none> tagged images (docker image prune -f).

Issues Encountered

  • PyCharm "Next" button hangs for over 3 hours or gets stuck at "Attaching to ...".
  • RPi docker-compose up -d works, but PyCharm leaves the container in "Created" state.
  • /root/1.sh may fail due to systemctl start supervisor (non-functional in Docker) or ~/publish_ip.py path issues.
  • yahboomcar_ws absence caused initial build failure, resolved by adding it.
  • Occasionally, "Next" shows "No Interpreter" with no Python daemon visible.

Questions

  1. Why does clicking "Next" in PyCharm's "New Target: Docker Compose" not properly execute docker-compose up -d on the remote Raspberry Pi for the MicroROS-Pi5 Robot Car?
  2. Is there an issue with the Path Mappings (C:\Users\계정\PyCharmProjects\ros2_project → /project) or other configurations?
  3. What could be causing /root/1.sh execution to fail or hang in PyCharm (e.g., systemctl or path errors) when controlling the MicroROS-Pi5?
  4. Are there additional network/SSH settings to adjust for better synchronization with the Raspberry Pi and MicroROS-Pi5?
  5. What should be considered when manually running docker-compose up -d and then connecting PyCharm to the MicroROS-Pi5 Robot Car setup?

Additional Information

  • RPi Logs: Attaching to ros2-dev, Successful, MY_DOMAIN_ID: 20.
  • docker ps -a: Contains recursing_leakey, gallant_mclean, magical_ishizaka, pycharm_helpers_PY-252.23892.515 (no ros2-dev currently).
  • docker images: Includes my-ros2-humble:latest (13.8GB), pycharm_helpers, microros/micro-ros-agent:humble, and older yahboomtechnology/ros-humble versions.

Please assist. Let me know if additional logs or configurations are needed!

0
3 comments

Hi Kyshigh,

Native support for remote Docker is not yet implemented in PyCharm. You can follow the progress and share your feedback on the related feature request here: PY-33489.
If you're new to YouTrack, this guide can help you get started with voting and commenting on issues.

0

After reading the comment and thinking about it carefully, I checked and found that in PyCharm 2025.2, there's a menu called "devcontainer." In there, I used the following configuration:

text

 

{
  "name": "Python 3.11",
  "image": "python:3.11-slim",
  "customizations": {
    "pycharm": {
      "interpreter": {
        "python": "/usr/local/bin/python"
      }
    }
  },
  "mounts": [ 
    "source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind"
  ],
  "remoteUser": "root"
}

This worked fine on my PC, and I confirmed that access was successful.

However, with the Yahboom Docker setup, even though I set the Python interpreter to /usr/bin/python3, when I access it and open PyCharm, it displays "No Interpreter." I've been attempting this for dozens of days now. If you have any other information, I'd greatly appreciate it if you could share it. Thank you!

1

Kyshigh, devcontainer setup is not directly related to the initial question with the remote docker interpreter. This will need a more thorough investigation, please create an issue on YouTrack (https://youtrack.jetbrains.com/issues/PY) and attach all relevant information (steps to reproduce, screenshots/video) along with IDE logs from Help | Collect Logs and Diagnostic Data and .devcontainer.json? That will help us triage and resolve it faster.

0

Please sign in to leave a comment.