Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
187e567
chore: rewrite host-env detection to generate a single docker/.env
matejstastny Aug 7, 2026
fe228f9
chore: merge docker-compose-dev.yml into docker-compose.yml
matejstastny Aug 7, 2026
0618fd2
chore: point devcontainer.json at merged compose file and host-env.sh
matejstastny Aug 7, 2026
7128638
chore: add mdx formatter to vscode settings
matejstastny Aug 7, 2026
69d5476
docs: update x_server.sh comments for merged compose file
matejstastny Aug 7, 2026
a094ad4
chore: simplify gitignore for merged env file flow
matejstastny Aug 7, 2026
4b4c5e4
chore: trim comments in docker/.env.defaults
matejstastny Aug 7, 2026
f0d10eb
chore: trim comment in vsg-chrono.Dockerfile
matejstastny Aug 7, 2026
0871c0f
refactor: shorten launch.py diagnostics, link to docs
matejstastny Aug 7, 2026
b78b6b5
docs: rewrite docker setup guide for merged env flow
matejstastny Aug 7, 2026
c8330c0
docs: drop nvidia setup page, fold into docker guide
matejstastny Aug 7, 2026
b079e5e
docs: replace getting-started.mdx with index.mdx
matejstastny Aug 7, 2026
b20e98a
docs: consolidate reference docs into dev-notes.mdx
matejstastny Aug 7, 2026
98d371b
docs: consolidate gazebo internals docs into architecture.mdx
matejstastny Aug 7, 2026
c847e8f
docs: update sidebar config for restructured pages
matejstastny Aug 7, 2026
54999c3
docs: update gazebo docs cross-links for restructure
matejstastny Aug 7, 2026
13e6108
docs: update chrono docs cross-links for restructure
matejstastny Aug 7, 2026
598c0d2
docs: fix README links for docs restructure
matejstastny Aug 7, 2026
969e50c
chore: update imgui window size from local run
matejstastny Aug 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "simulations",
"dockerComposeFile": ["../docker/docker-compose.yml", "../docker/docker-compose-dev.yml"],
"dockerComposeFile": "../docker/docker-compose.yml",
"service": "sim",
"runServices": ["sim"],

"workspaceFolder": "/home/trickfire/simulations",
"remoteEnv": {
"HOST_WORKSPACE": "${localWorkspaceFolder}"
},
"initializeCommand": "bash .devcontainer/detect-host-env.sh || true",
"initializeCommand": "bash .devcontainer/host-env.sh || true",
"postCreateCommand": "pip3 install --break-system-packages -e .", // install the sim cli
"postStartCommand": "bash ./.devcontainer/x_server.sh || true",

Expand All @@ -19,34 +19,26 @@
"shfmt.executablePath": "/usr/local/bin/shfmt"
},
"extensions": [
// --- Python ---
"ms-python.python",
"ms-python.vscode-pylance",
"charliermarsh.ruff",
"ms-python.mypy-type-checker",

// --- C and C++ ---
"ms-vscode.cmake-tools",
"josetr.cmake-language-support-vscode",
"llvm-vs-code-extensions.vscode-clangd",
"ms-vscode.makefile-tools",

// --- Robotics / ROS / URDF / meshes ---
"Ranch-Hand-Robotics.rde-ros-2",
"smilerobotics.urdf",
"morningfrog.urdf-visualizer",
"misiekhardcore.stl-previewer",

// --- Container ---
"ms-azuretools.vscode-docker",

// --- Formatters ---
"esbenp.prettier-vscode",
"yzhang.markdown-all-in-one",
"DotJoshJohnson.xml",
"tamasfe.even-better-toml",
"github.vscode-github-actions",
"mkhl.shfmt"
"mkhl.shfmt",
"unifiedjs.vscode-mdx"
]
}
}
Expand Down
54 changes: 31 additions & 23 deletions .devcontainer/detect-host-env.sh → .devcontainer/host-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ set -eu

script_dir="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
docker_dir="$(cd "$script_dir/../docker" && pwd)"
env_out="$docker_dir/.env"
host_out="$docker_dir/.env.host"

defaults="$docker_dir/.env.defaults"
overrides="$docker_dir/.env.local"
env_out="$docker_dir/.env"

uname_s="$(uname -s 2>/dev/null || echo unknown)"

log() { printf "\033[1;36m%s\033[0m\n" "$1"; }

gpu_available() {
[ "$uname_s" = "Linux" ] || return 1
command -v nvidia-smi >/dev/null 2>&1 || return 1
Expand All @@ -18,24 +20,9 @@ gpu_available() {
}

gpu_runtime=""
if gpu_available; then
gpu_runtime="nvidia"
fi

{
cat "$defaults"
if [ -f "$overrides" ]; then
echo ""
echo "# --- user overrides (docker/.env.local) ---"
cat "$overrides"
fi
echo ""
echo "# --- host-detected (generated, do not edit) ---"
echo "SIM_GPU_RUNTIME=$gpu_runtime"
} >"$env_out"
gpu_available && gpu_runtime="nvidia"

{
echo "# generated by .devcontainer/detect-host-env.sh — do not edit or commit"
write_display_env() {
case "$uname_s" in
Darwin)
echo "# host: macOS (XQuartz over TCP + VirtualGL)"
Expand All @@ -54,16 +41,37 @@ fi
echo "DISPLAY=${DISPLAY:-:0}"
;;
*)
echo "# host: unknown ($uname_s) falling back to local display :0"
echo "# host: unknown ($uname_s) - falling back to local display :0"
echo "DISPLAY=${DISPLAY:-:0}"
;;
esac
}

write_env() {
echo "# generated by .devcontainer/host-env.sh - do not edit or commit"
echo "# to change ports/flags, edit docker/.env.defaults (shared) or docker/.env.local (yours)"
echo ""

cat "$defaults"

if [ -f "$overrides" ]; then
echo ""
echo "# --- user overrides (docker/.env.local) ---"
cat "$overrides"
fi

echo ""
echo "# --- host-detected (generated, do not edit) ---"
write_display_env
echo "SIM_GPU_RUNTIME=$gpu_runtime"

if [ -n "$gpu_runtime" ]; then
echo "# nvidia GPU detected (runtime: nvidia)"
echo "NVIDIA_VISIBLE_DEVICES=all"
echo "NVIDIA_DRIVER_CAPABILITIES=graphics,display,compute,utility"
echo "__EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/10_nvidia.json"
fi
} >"$host_out"
}

write_env >"$env_out"

echo "[detect-host-env] host=$uname_s gpu=${gpu_runtime:-none} -> wrote docker/.env, docker/.env.host"
echo "[INFO] host=$uname_s gpu=${gpu_runtime:-none}"
10 changes: 3 additions & 7 deletions .devcontainer/x_server.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/usr/bin/env bash

# --------------------------------------------------------------------------------------------
# Starts a headless X11 desktop (Xorg/Xvfb + Openbox + x11vnc + noVNC) inside the container.
# Intended for running GUI apps (Gazebo) in Docker.
# Supports --verbose flag for debugging (prints all output to console instead of log file).
# --------------------------------------------------------------------------------------------
# Sets up the container's display: Wayland/X11 passthrough when available, otherwise a
# headless Xorg/Xvfb + Openbox + x11vnc + noVNC stack. See docs/reference/docker-environment.mdx.

set -eo pipefail
trap '' HUP
Expand Down Expand Up @@ -101,7 +97,7 @@ try_display_passthrough() {
fi

# Case 1: Linux host with a Wayland compositor, or WSL2 with WSLg. The host socket is
# bind-mounted into /run/host-runtime by docker-compose-dev.yml.
# bind-mounted into /run/host-runtime by docker-compose.yml.
local wayland_sock="/run/host-runtime/${WAYLAND_DISPLAY:-wayland-0}"
if [ -S "$wayland_sock" ]; then
log "[X11] Using Wayland socket at $wayland_sock"
Expand Down
15 changes: 3 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,19 @@
!.vscode/launch.json
!.vscode/extensions.json

# pixi
.pixi/

# Python
# python
.mypy_cache
__pycache__
*.egg-info/
build/
**/.venv

# ROS2
# ros
gazebo/install
gazebo/build
gazebo/log

# sim create tests
# sim tests
cli/gazebo/create/tests

# chrono outputs
Expand All @@ -31,14 +28,8 @@ chrono/results/*

# env
**/*.env
# docker/.env is generated each `devcontainer up` by .devcontainer/detect-host-env.sh
# (from docker/.env.defaults + docker/.env.local + host detection). docker/.env.defaults
# is the committed source of truth; docker/.env.local holds per-machine overrides.
docker/.env
docker/.env.host
docker/.env.local

# trickfire-docs
.trickfire-docs/
dist/
.cache/
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
"editor.formatOnSave": true,
"editor.formatOnPaste": true
},
"[mdx]": {
"editor.wordWrap": "on",
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
Expand Down Expand Up @@ -74,6 +78,5 @@
"${workspaceFolder}/gazebo/sim_common"
],
"ROS2.distro": "jazzy",
"cmake.ignoreCMakeListsMissing": true,
"autoDevcontainer.enabled": true
"cmake.ignoreCMakeListsMissing": true
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Robot simulations for TrickFire Robotics - Gazebo Harmonic (ROS 2 Jazzy) for rob

**Full documentation is at [docs.trickfirerobotics.com/simulations](https://docs.trickfirerobotics.com/simulations)**

- [Getting Started](https://docs.trickfirerobotics.com/simulations/getting-started) - native setup, Dev Container alternative, first launch
- [Getting Started](https://docs.trickfirerobotics.com/simulations) - native setup, Dev Container alternative, first launch
- [Running Gazebo](https://docs.trickfirerobotics.com/simulations/gazebo/gazebo) - `sim gazebo` CLI usage and flags
- [Running Chrono](https://docs.trickfirerobotics.com/simulations/chrono/chrono) - `sim chrono` CLI usage
- [Adding a New Robot](https://docs.trickfirerobotics.com/simulations/gazebo/adding-robots) - OnShape to Gazebo with `sim gazebo create`
- [Environment](https://docs.trickfirerobotics.com/simulations/reference/docker-environment) - Docker environment in depth
- [Dev Notes](https://docs.trickfirerobotics.com/simulations/dev-notes) - architecture decisions, Docker environment internals, CLI tips
2 changes: 1 addition & 1 deletion chrono/data/vsg/imgui.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Size=531,121

[Window][Simulation]
Pos=5,5
Size=349,458
Size=238,362
Collapsed=1

Loading