Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 16 additions & 0 deletions .classpath.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="Controller/src"/>
<classpathentry kind="src" path="TeamCode/src"/>
<classpathentry kind="src" path="tmp_compile"/>
<classpathentry kind="lib" path="lib/Jamepad.jar"/>
<classpathentry kind="lib" path="lib/dyn4j-4.1.4.jar" sourcepath="lib/dyn4j-4.1.4-sources.jar"/>
<classpathentry kind="lib" path="lib/reflections-0.9.11.jar"/>
<classpathentry kind="lib" path="lib/guava-20.0.jar"/>
<classpathentry kind="lib" path="lib/javassist-3.21.0-GA.jar"/>
<classpathentry kind="lib" path="lib/EasyOpenCV_v1.5.0_OBJ_bundle.jar"/>
<classpathentry kind="lib" path="lib/PedroPathing.jar"/>
<classpathentry kind="lib" path="lib/RoadRunner.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="out"/>
</classpath>
47 changes: 47 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Virtual Robot Dev Container Setup

This dev container provides a complete development environment for the Virtual Robot Simulator with:
- **Java 17** (BellSoft Liberica Full JDK with JavaFX)
- **Desktop environment** (accessible via noVNC on port 6080)
- **VS Code Java extensions**

## Getting Started

1. **Open in Dev Container**
- Open this folder in VS Code
- When prompted, click "Reopen in Container" (or use Command Palette: "Dev Containers: Reopen in Container")
- Wait for the container to build and setup to complete

2. **Access the Desktop Environment**
- Once the container is running, open your browser to: `http://localhost:6080`
- Password: `vscode`
- This provides a full desktop environment where GUI applications will display

3. **Run the Virtual Robot Application**
- In VS Code, go to Run and Debug (Cmd+Shift+D)
- Select "Launch Virtual Robot" from the dropdown
- Click the green play button or press F5
- The application will open in the desktop environment (access via browser on port 6080)

## Alternative: Running from Terminal

You can also run the application from the integrated terminal:

```bash
java --module-path $JAVA_HOME/lib \
--add-modules javafx.controls,javafx.fxml,javafx.graphics \
-cp Controller/src:TeamCode/src:lib/* \
virtual_robot.controller.VirtualRobotApplication
```

## Project Structure

- `Controller/src` - Main application code
- `TeamCode/src` - User-defined OpModes
- `lib/` - External dependencies

## Notes

- The DISPLAY environment variable is automatically set to `:1`
- JavaFX is included in the Liberica Full JDK
- Additional graphics libraries are pre-installed for GUI support
53 changes: 53 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "Virtual Robot Simulator",
"image": "mcr.microsoft.com/devcontainers/base:debian",

"features": {
"ghcr.io/devcontainers/features/desktop-lite:1": {
"password": "vscode",
"webPort": "6080",
"vncPort": "5901"
}
},

"customizations": {
"vscode": {
"extensions": [
"vscjava.vscode-java-pack",
"vscjava.vscode-java-debug",
"redhat.java"
],
"settings": {
"java.configuration.runtimes": [
{
"name": "JavaSE-17",
"path": "/home/vscode/.sdkman/candidates/java/current",
"default": true
}
],
"java.jdt.ls.java.home": "/home/vscode/.sdkman/candidates/java/current"
}
}
},

"forwardPorts": [6080, 5901],
"portsAttributes": {
"6080": {
"label": "Desktop (noVNC)",
"onAutoForward": "notify"
},
"5901": {
"label": "VNC",
"onAutoForward": "ignore"
}
},

"postCreateCommand": "bash .devcontainer/setup.sh",

"remoteEnv": {
"DISPLAY": ":1",
"JAVA_HOME": "/home/vscode/.sdkman/candidates/java/current"
},

"remoteUser": "vscode"
}
61 changes: 61 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash
set -e

echo "Setting up Virtual Robot development environment..."

# Install basic dependencies first
echo "Installing system dependencies..."
sudo apt-get update
sudo apt-get install -y \
curl \
zip \
unzip \
libxrender1 \
libxtst6 \
libxi6 \
libgtk-3-0 \
x11-apps \
libgl1-mesa-dri \
libglx0 || true

# Try to install libgl1-mesa-glx if available (older Debian versions)
sudo apt-get install -y libgl1-mesa-glx 2>/dev/null || true

# Install SDKMAN if not already installed
if [ ! -d "$HOME/.sdkman" ]; then
echo "Installing SDKMAN..."
curl -s "https://get.sdkman.io" | bash
fi

# Source SDKMAN
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"

# Install Liberica 17 Full JDK (includes JavaFX)
echo "Installing BellSoft Liberica 17 Full JDK..."
sdk install java 17.0.13.fx-librca || sdk use java 17.0.13.fx-librca || true
sdk default java 17.0.13.fx-librca || true

# Verify installation
echo "Java version:"
java -version

# Set JAVA_HOME permanently
export JAVA_HOME="$HOME/.sdkman/candidates/java/current"
if ! grep -q "JAVA_HOME" "$HOME/.bashrc"; then
echo "export JAVA_HOME=$HOME/.sdkman/candidates/java/current" >> $HOME/.bashrc
echo "export PATH=\$JAVA_HOME/bin:\$PATH" >> $HOME/.bashrc
fi

# Also add to .bash_profile for login shells
if ! grep -q "JAVA_HOME" "$HOME/.bash_profile"; then
echo "export JAVA_HOME=$HOME/.sdkman/candidates/java/current" >> $HOME/.bash_profile
echo "export PATH=\$JAVA_HOME/bin:\$PATH" >> $HOME/.bash_profile
fi

echo "Setup complete! Java environment is ready."
echo "Java Home: $JAVA_HOME"
echo "Desktop environment will be available on port 6080 (noVNC)."
echo "You can access it at: http://localhost:6080"
echo ""
echo "To verify JavaFX is available, run: java --list-modules | grep javafx"
26 changes: 26 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Git
.git
.gitignore

# IDE
.idea
*.iml
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json

# Build outputs
out/
*.class

# Documentation
*.pdf
*.gif
*.jpg
*.md
!.devcontainer/*.md

# OS
.DS_Store
Thumbs.db
3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions .project.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>virtual_robot</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1768453886430</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Launch Virtual Robot",
"request": "launch",
"mainClass": "virtual_robot.controller.VirtualRobotApplication",
"classPaths": [
"${workspaceFolder}/out",
"${workspaceFolder}/lib/dyn4j-4.1.4.jar",
"${workspaceFolder}/lib/guava-20.0.jar",
"${workspaceFolder}/lib/javassist-3.21.0-GA.jar",
"${workspaceFolder}/lib/reflections-0.9.11.jar",
"${workspaceFolder}/lib/RoadRunner.jar",
"${workspaceFolder}/lib/PedroPathing.jar",
"${workspaceFolder}/lib/Jamepad.jar",
"${workspaceFolder}/lib/EasyOpenCV_v1.5.0_OBJ_bundle.jar"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"vmArgs": "-Dprism.order=sw"
}
]
}
27 changes: 27 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"java.project.sourcePaths": [
"Controller/src",
"TeamCode/src",
"tmp_compile"
],
"java.project.referencedLibraries": [
"lib/**/*.jar"
],
"java.project.outputPath": "out",
"java.configuration.updateBuildConfiguration": "automatic",
"java.debug.settings.forceBuildBeforeLaunch": true,
"java.configuration.runtimes": [
{
"name": "JavaSE-17",
"path": "~/.sdkman/candidates/java/current",
"default": true
}
],
"java.jdt.ls.java.home": "~/.sdkman/candidates/java/current",
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true
}
}
23 changes: 23 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Verify Java Installation",
"type": "shell",
"command": "java -version && echo '' && echo 'JavaFX Modules:' && java --list-modules | grep javafx",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Check DISPLAY",
"type": "shell",
"command": "echo \"DISPLAY=$DISPLAY\" && echo \"JAVA_HOME=$JAVA_HOME\"",
"presentation": {
"reveal": "always",
"panel": "new"
}
}
]
}
Loading