|
16 | 16 |
|
17 | 17 | 1. **Fork the repository:** Click the "Fork" button in the top right corner of the GitHub page. |
18 | 18 |
|
19 | | -2. **Create a new branch:** Create a separate branch for your changes to keep them isolated from the main project. |
| 19 | +2. **Create a new branch:** Create a separate branch for your changes to keep them isolated from the main project. |
20 | 20 |
|
21 | 21 | ```bash |
22 | 22 | git checkout -b "your_branch_name" |
23 | 23 | ``` |
24 | 24 |
|
25 | | -3. **Make your changes:** Edit files with your additions or corrections. Please follow the existing format and style. When adding a new function, make sure to include: |
| 25 | +3. **Make your changes:** Edit files with your additions or corrections. Please follow the existing format and style guidelines. When adding a new function, make sure to include: |
26 | 26 |
|
27 | 27 | * The function name and format. |
28 | 28 | * A brief description of the function's functionality. |
@@ -66,6 +66,71 @@ We use **Ruff** for both linting and formatting. CI requires: |
66 | 66 |
|
67 | 67 | --- |
68 | 68 |
|
| 69 | +## Optional: Using Devcontainer |
| 70 | + |
| 71 | +The devcontainer provides a stable testing platform with ROS2 humble pre-installed as well as an environment to test the MCP server in http transport. (stdio transport is not compatible with the devcontainer) |
| 72 | + |
| 73 | +1. Install [VSCode](https://code.visualstudio.com/) and the **Remote - Containers** extension. |
| 74 | +2. Open the `ros-mcp-server` repository in VSCode. |
| 75 | +3. When prompted, **reopen in container**. |
| 76 | + - The container includes ROS2 Humble, Python 3.10+, `ruff`, `pre-commit`, `uv`, and `git`. |
| 77 | + - The repository is mounted at `/root/workspace`. |
| 78 | + - **Note for GUI apps** (`turtlesim`, `rviz`, `Gazebo`): |
| 79 | + Ensure the container can access your host X server by running the following command once on the host: |
| 80 | + |
| 81 | + <details> |
| 82 | + <summary> Ubuntu host </summary> |
| 83 | + |
| 84 | + ```bash |
| 85 | + sudo apt install x11-xserver-utils # if xhost is not installed |
| 86 | + xhost +local:root # allow container user access |
| 87 | + ``` |
| 88 | + </details> |
| 89 | + |
| 90 | + <details> |
| 91 | + <summary> Windows WSL2 host </summary> |
| 92 | + |
| 93 | + ```bash |
| 94 | + export DISPLAY=$(grep nameserver /etc/resolv.conf | awk '{print $2}'):0 |
| 95 | + export QT_X11_NO_MITSHM=1 |
| 96 | + xhost +local:root |
| 97 | + ``` |
| 98 | + </details> |
| 99 | + |
| 100 | + |
| 101 | +4. You can now control the Turtlesim robot following **Step-2** and **Step-4** from the [installation guide](installation.md). |
| 102 | +5. Initialize pre-commit hooks (optional but recommended): |
| 103 | + ```bash |
| 104 | + pre-commit install |
| 105 | + pre-commit run --all-files |
| 106 | + ``` |
| 107 | +6. Check Python code formatting with `ruff` |
| 108 | + ```bash |
| 109 | + ruff check . |
| 110 | + ruff format --check . |
| 111 | + ``` |
| 112 | + <details> |
| 113 | + <summary>SSH Agent Setup for Git (click to expand)</summary> |
| 114 | + |
| 115 | + This should be run on the host side prior to building the devcontainer. |
| 116 | + ```bash |
| 117 | + # Start the SSH agent |
| 118 | + eval "$(ssh-agent -s)" |
| 119 | +
|
| 120 | + # List keys currently loaded |
| 121 | + ssh-add -l |
| 122 | + ``` |
| 123 | + |
| 124 | + If it says “The agent has no identities”, you must load your key, for example: |
| 125 | + ```bash |
| 126 | + ssh-add ~/.ssh/id_ed25519 |
| 127 | + ssh-add -l # confirm fingerprint shows up |
| 128 | + ``` |
| 129 | + </details> |
| 130 | + |
| 131 | + **Note:** This setup has been tested and verified on Ubuntu. |
| 132 | + |
| 133 | + |
69 | 134 | ## License |
70 | 135 |
|
71 | 136 | This project is licensed under the **Apache License 2.0**. By contributing to this project, you agree that your contributions will be licensed under the same license. |
|
0 commit comments