Skip to content

draft distributed system #62

Draft
shb-png wants to merge 17 commits into
mainfrom
shriya/launch-scripts
Draft

draft distributed system #62
shb-png wants to merge 17 commits into
mainfrom
shriya/launch-scripts

Conversation

@shb-png

@shb-png shb-png commented May 14, 2026

Copy link
Copy Markdown

No description provided.

@shb-png shb-png requested a review from ShayManor May 14, 2026 20:16
@shb-png shb-png force-pushed the shriya/launch-scripts branch 2 times, most recently from ecf42ea to f500b48 Compare May 14, 2026 22:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces the scaffolding for a distributed kart system that splits the ROS 2 stack between a Jetson (sensors/perception) and a Rubik (metrics + master API). It adds dedicated launch files per device, opens ROS discovery beyond localhost, and exposes new HTTP endpoints on the master API to remotely update/restart the Jetson over SSH.

Changes:

  • New bringup_jetson.launch.py, bringup_rubik.launch.py, and bringup_all.launch.py plus a TARGET_DEVICE-aware start.bash.
  • New MasterNode.restart_jetson() / update_jetson() that shell out to ssh and corresponding /jetson/restart and /jetson/update Flask endpoints.
  • Networking/config updates: ROS_LOCALHOST_ONLY=0 in compose/devcontainer, openssh-client added to the Docker image, and new jetson_ip / jetson_username params in system.yaml.

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
src/autonomous_kart/autonomous_kart/params/system.yaml Adds jetson_ip and jetson_username params used for SSH targeting.
src/autonomous_kart/autonomous_kart/nodes/master/master_node.py Adds restart_jetson / update_jetson shelling out via ssh -t.
src/autonomous_kart/autonomous_kart/nodes/master/master_api.py New unauthenticated POST endpoints /jetson/restart and /jetson/update.
src/autonomous_kart/autonomous_kart/launch/bringup_rubik.launch.py New launch file: metrics + master_api on Rubik.
src/autonomous_kart/autonomous_kart/launch/bringup_jetson.launch.py New launch file: sensor/perception/master nodes on Jetson.
src/autonomous_kart/autonomous_kart/launch/bringup_all.launch.py Combined launch file; passes imu_yaml to master_api (likely copy/paste).
scripts/start.bash Branches on TARGET_DEVICE; missing fi makes the script invalid.
docker/Dockerfile Adds openssh-client for outbound SSH.
compose/docker-compose.yml Sets ROS_LOCALHOST_ONLY=0, hardcodes TARGET_DEVICE=jetson.
.gitignore Ignores logs/ and kart_logs/.
.devcontainer/devcontainer.json Sets ROS_LOCALHOST_ONLY=0 for devcontainers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/start.bash
Comment on lines +337 to +379
# pull latest code, rebuild container, and restart bringup on jetson
def restart_jetson(self):
with self._lock:
remote_command = (
"bash ~/run_remote.sh --update"
)

ssh_command = [
"ssh",
"-t",
f"{self.jetson_user}@{self.jetson_ip}",
remote_command,
]

self.logger.info("Rebuilding Jetson container and pulling latest code...")

subprocess.Popen(ssh_command)

# only pull latest code, dont rebuild container
def update_jetson(self):
with self._lock:
remote_command = (
"cd ~/AutonomousKart && "
"git pull && "
"docker exec ros2-dev bash -lc '"
"source /opt/ros/humble/setup.bash && "
"cd /ws && "
"colcon build && "
"source install/setup.bash && "
"ros2 launch autonomous_kart bringup_jetson.launch.py"
"'"
)

ssh_command = [
"ssh",
"-t",
f"{self.jetson_user}@{self.jetson_ip}",
remote_command,
]

self.logger.info("Starting Jetson and pulling latest code...")

subprocess.Popen(ssh_command)
Comment on lines +344 to +375
ssh_command = [
"ssh",
"-t",
f"{self.jetson_user}@{self.jetson_ip}",
remote_command,
]

self.logger.info("Rebuilding Jetson container and pulling latest code...")

subprocess.Popen(ssh_command)

# only pull latest code, dont rebuild container
def update_jetson(self):
with self._lock:
remote_command = (
"cd ~/AutonomousKart && "
"git pull && "
"docker exec ros2-dev bash -lc '"
"source /opt/ros/humble/setup.bash && "
"cd /ws && "
"colcon build && "
"source install/setup.bash && "
"ros2 launch autonomous_kart bringup_jetson.launch.py"
"'"
)

ssh_command = [
"ssh",
"-t",
f"{self.jetson_user}@{self.jetson_ip}",
remote_command,
]
Comment on lines +353 to +379
subprocess.Popen(ssh_command)

# only pull latest code, dont rebuild container
def update_jetson(self):
with self._lock:
remote_command = (
"cd ~/AutonomousKart && "
"git pull && "
"docker exec ros2-dev bash -lc '"
"source /opt/ros/humble/setup.bash && "
"cd /ws && "
"colcon build && "
"source install/setup.bash && "
"ros2 launch autonomous_kart bringup_jetson.launch.py"
"'"
)

ssh_command = [
"ssh",
"-t",
f"{self.jetson_user}@{self.jetson_ip}",
remote_command,
]

self.logger.info("Starting Jetson and pulling latest code...")

subprocess.Popen(ssh_command)
Comment on lines +339 to +379
with self._lock:
remote_command = (
"bash ~/run_remote.sh --update"
)

ssh_command = [
"ssh",
"-t",
f"{self.jetson_user}@{self.jetson_ip}",
remote_command,
]

self.logger.info("Rebuilding Jetson container and pulling latest code...")

subprocess.Popen(ssh_command)

# only pull latest code, dont rebuild container
def update_jetson(self):
with self._lock:
remote_command = (
"cd ~/AutonomousKart && "
"git pull && "
"docker exec ros2-dev bash -lc '"
"source /opt/ros/humble/setup.bash && "
"cd /ws && "
"colcon build && "
"source install/setup.bash && "
"ros2 launch autonomous_kart bringup_jetson.launch.py"
"'"
)

ssh_command = [
"ssh",
"-t",
f"{self.jetson_user}@{self.jetson_ip}",
remote_command,
]

self.logger.info("Starting Jetson and pulling latest code...")

subprocess.Popen(ssh_command)
system_frequency: 60 # Speed of hot loop (Hertz)
line_path: "/ws/data/racing_line/line14.csv"
jetson_ip: "evc-jetson.tail73145c.ts.net"
jetson_username: "evc" No newline at end of file
Comment on lines +340 to +342
remote_command = (
"bash ~/run_remote.sh --update"
)
- ROS_DISTRO=humble
- ROS_DOMAIN_ID=42
- ROS_LOCALHOST_ONLY=1
- ROS_LOCALHOST_ONLY=0
- ROS_DOMAIN_ID=42
- ROS_LOCALHOST_ONLY=1
- ROS_LOCALHOST_ONLY=0
- TARGET_DEVICE=jetson # set target device for build (ex: jetson, rubik)

subprocess.Popen(ssh_command)

# only pull latest code, dont rebuild container
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants