-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from purduerov/phoenix
Phoenix
- Loading branch information
Showing
40 changed files
with
188 additions
and
2,571 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Specify base image | ||
FROM ros:humble | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install system dependencies | ||
RUN apt-get -y update | ||
RUN apt-get -y install python3-pip | ||
|
||
# Install python dependencies | ||
COPY requirements.txt requirements.txt | ||
RUN pip3 install -r requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "X17 Dev Container", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": ".." | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-iot.vscode-ros", // ROS extension | ||
"ms-python.python", // Python extension (if needed) | ||
"ms-azuretools.vscode-docker" // Docker extension | ||
], | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash" | ||
} | ||
} | ||
}, | ||
"mounts": [ | ||
"source=${localWorkspaceFolder}/,target=/workspace,type=bind" | ||
], | ||
"runArgs": [ | ||
"--network", "host" // Use host network | ||
], | ||
"remoteUser": "root", | ||
"postCreateCommand": "echo 'source /opt/ros/humble/setup.bash' >> /root/.bashrc" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
__pycache__/ | ||
ui/__pycache__ | ||
log/ | ||
.env | ||
.env | ||
build | ||
install | ||
.vscode/ | ||
.idea/ | ||
.DS_Store |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# X17-Surface PHOENIX BRANCH | ||
|
||
This is the phoenix branch for X17-Surface. It is a rewrite of the previous X17-Surface codebase, with a focus on readability and maintainability. I will try to remove as much unnecessary complexity as possible while still maintaining the core functionality. | ||
|
||
> [!WARNING] | ||
> This branch is still a work in progress and is not yet fully functional. Do not merge into main until sufficient testing has been completed. | ||
### Changes Made | ||
|
||
#### 1. New .devcontainer setup | ||
This will allow for easier development in a consistent environment. | ||
Requires the following components to be installed on your machine: | ||
- Docker Desktop | ||
- Visual Studio Code | ||
- Visual Studio Code Dev Containers extension | ||
|
||
When all of the above are installed, you can open the project in Visual Studio Code and it will prompt you to reopen in a container. If you are not prompted, you can use the command palette (Ctrl+Shift+P) and select "Dev-Containers: Rebuild and Reopen in Container". | ||
|
||
#### 2. xml -> yaml conversion | ||
The configuration files have been converted from XML to YAML format for better readability and ease of use. I plan on doing the same for the CORE repo as well. | ||
|
||
#### 3. New script directory | ||
A new directory has been created for scripts, making it easier to manage and organize scripts related to the project. (Running, building, etc.) | ||
|
||
#### 4. New launch configuration | ||
There is a new launch configuration. It is intended to create more parity between the surface and core functionality. This can be found in the `ui` directory. Now to launch the surface, you can use the following command (Does not work yet, just a template): | ||
|
||
``` | ||
ros2 launch ui surface_launch.yaml | ||
``` | ||
> Note: Make sure to build and source your workspace before running the launch command. | ||
After the launch command, the interface should be accessable at `http://127.0.0.1:5000`. I have run into some issues when trying to access the interface via `localhost` (which is where vscode will try to send you if you click on the link), so it is currently recommended to use the IP address directly. I have only had this issue on MacOS so far. | ||
|
||
### Known working platforms | ||
> Format: Device (Architecture) - OS Version (Date tested) | ||
- M3 MacBook Pro (ARM) - MacOS Sequoia 15.0 (9/19/2024) | ||
- Adam's Desktop (x86) - WSL2 on Windows 11 (9/20/2024) | ||
|
||
### Known issues | ||
- You cannot access any hardware yet (gamepad, etc.) | ||
|
||
### Updates | ||
|
||
9/19/2024: Initial commit. Implemented new .devcontainer setup, converted XML to YAML, created new script directory, and added new launch configuration. | ||
The only nodes that are launched with the above launch command are the 'ui' node (Flask application) and the gamepad. I have not tested with the actual hardware yet so who knows if it will work. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/bash | ||
|
||
source /opt/ros/humble/setup.bash | ||
colcon build | ||
. install/setup.bash | ||
export ROS_DOMAIN_ID=69 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Define directories to be removed | ||
directories=("log" "install" "build") | ||
|
||
# Loop through each directory and remove it if it exists | ||
for dir in "${directories[@]}"; do | ||
if [ -d "$dir" ]; then | ||
echo "Removing directory: $dir" | ||
rm -rf "$dir" | ||
else | ||
echo "Directory $dir does not exist." | ||
fi | ||
done | ||
|
||
source /opt/ros/humble/setup.bash | ||
|
||
echo "Cleanup complete." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/bash | ||
|
||
. install/setup.bash | ||
export ROS_DOMAIN_ID=69 | ||
ros2 launch ui surface_launch.yaml |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
launch: | ||
|
||
- node: | ||
pkg: ui | ||
exec: app.py | ||
namespace: rov | ||
|
||
- node: | ||
pkg: gamepad | ||
exec: sender.py | ||
namespace: rov |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python3 | ||
import os | ||
from flask import Flask, render_template, request, redirect, url_for | ||
# Import rlcpy for logging | ||
import rclpy | ||
|
||
app = Flask(__name__) | ||
|
||
@app.route('/') | ||
def index(): | ||
return render_template('index.html') | ||
|
||
if __name__ == "__main__": | ||
# Initialize the ros node | ||
rclpy.init() | ||
node = rclpy.create_node('flask_server') | ||
node.get_logger().info("Flask server started") | ||
|
||
# Run the flask app | ||
app.run(host='0.0.0.0', port=5000) |
Oops, something went wrong.