... | ... | @@ -8,7 +8,56 @@ This is a guide to help you get up and running locally. Since VS Code is the mos |
|
|
# Setup the project
|
|
|
Let us suppose you want to do some changes inside of the `lhw_qi` subsystem (if you're interested in any other subsystem, just replace `lhw_qi` with it from now on). Start by cloning down the project repository to your local PC somewhere, `git clone git@gitlab.liu.se:liuhomewreckers/liu-home-wreckers.git`. Now follow the steps found [here](./Docker) to get the container images setup. You'll only have to build for `lhw` and `lhw_qi`.
|
|
|
|
|
|
To check whether everything works as it should, you can enter the container with `docker compose run --rm lhw_qi zsh` and then execute `colcon build`. It should take about 4 minutes to complete the compilation.
|
|
|
To check whether everything works as it should, you can enter the container with `docker compose run --rm lhw_qi zsh` and then execute `colcon build`. It should take about 4 minutes to complete the compilation. At this point we can start making changes to the source code!
|
|
|
|
|
|
# Making changes
|
|
|
... |
|
|
\ No newline at end of file |
|
|
...
|
|
|
|
|
|
# Dev Containers
|
|
|
VS Code has an extension that allows you to run language servers inside of containers, meaning you can reap the benefits of the packages a container has, without having to download them to your computer. Once again I'll explain this as if you'd want to develop for `lhw_qi`, and once again you can just replace `lhw_qi`with your wanted subsystem.
|
|
|
|
|
|
1. Install the [dev containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension.
|
|
|
2. Create a `.devcontainer` folder within the subsystem folder (e.g. `mkdir ./liu-home-wreckers/src/lhw_qi/.devcontainer`.
|
|
|
3. Within the newly created folder, add these two files:
|
|
|
|
|
|
./liu-home-wreckers/src/lhw_qi/.devcontainer/devcontainer.json
|
|
|
```json
|
|
|
{
|
|
|
"dockerComposeFile": "./docker-compose.yml",
|
|
|
"service": "lhw_qi_dev",
|
|
|
"workspaceFolder": "/workspace/liu-home-wreckers",
|
|
|
"customizations": {
|
|
|
"vscode": {
|
|
|
"extensions": [
|
|
|
"ms-vscode.cpptools",
|
|
|
"ms-vscode.cpptools-extension-pack"
|
|
|
"ms-python.python",
|
|
|
"ms-python.vscode-pylance"
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
|
|
|
This file tells the extension what service to start, which folder to run vscode inside and what vscode extensions it should install unto that dev container. I'm adding both Python and C++ extensions here for simplicity.
|
|
|
|
|
|
./liu-home-wreckers/src/lhw_qi/.devcontainer/docker-compose.yml
|
|
|
```yml
|
|
|
version: '3.8'
|
|
|
|
|
|
services:
|
|
|
lhw_qi_dev:
|
|
|
container_name: lhw_qi_dev
|
|
|
image: lhw_qi:listener
|
|
|
network_mode: host
|
|
|
environment:
|
|
|
- DISPLAY=$DISPLAY
|
|
|
- RCUTILS_COLORIZED_OUTPUT=1
|
|
|
volumes:
|
|
|
- /tmp/.X11-unix:/tmp/.X11-unix
|
|
|
- ../:/workspace/liu-home-wreckers/src/lhw_qi
|
|
|
- ../../../installs/lhw_qi:/workspace/liu-home-wreckers/install
|
|
|
command: /bin/sh -c "while sleep 1000; do :; done"%
|
|
|
```
|
|
|
|
|
|
Just another docker-compose file. You should be able to use the one in project root, but I haven't managed it yet. This works though, so this stands for now. Beware that the image probably shouldn't have `listener` at the end but `latest` if you aren't developing for `lhw_qi`. |
|
|
\ No newline at end of file |