× Overview The Robot Learning Hub Curriculum Safety For Schools Contact Sales

VS Code, Running & Stopping

Students use VS Code and SSH so they can work with the robot like a real development system. Code runs on the robot, but students edit and launch it from their own laptop.

Why VS Code and SSH

SSH lets a laptop open a secure terminal session on the robot's Raspberry Pi. VS Code adds a familiar editor, file browser, and terminal on top of that connection, so students can open the robot workspace, inspect files, edit code, and run commands without switching tools constantly. Account-level detail is covered in SSH & Student Accounts.

Example connection

Terminal
ssh student@swayform.local

Open and source the workspace

Terminal
cd ~/ros2_ws source install/setup.bash
Note

These commands are example defaults. The exact hostname, username, or workspace path can be adjusted for the final classroom image.

Connecting to the robot — before you run anything

1
Power on the robot. Make sure it is stable. Do not place hands or objects near the arms while software is starting.
2
Connect to the correct network. Laptop and robot need to be able to see each other.
3
Open VS Code and use Remote-SSH to open a terminal and file browser on the robot.
4
Open the workspace at ~/ros2_ws, where demos, labs, and student projects live.
5
Run a safe demo first — start with Wave, the simplest one.

Running a demo

Terminal
cd ~/ros2_ws source install/setup.bash ros2 run swayform_demos wave_demo

Before running: confirm the robot is stable, the table area is clear, no one is holding an arm, the correct demo command is being used, and the previous behavior has fully stopped.

Stopping motion safely

Students should know how to stop a behavior before they start changing code — a safe stop is part of the normal workflow, not an emergency-only action.

Terminal
Ctrl + C
Wait for the robot to finish or relax its current movement.
Do not immediately grab the arm or hand.
Check the terminal output for errors.
Only restart the demo when the area is clear.

Ctrl+C is a normal software stop, not the full safety system — see Safety for the physical emergency stop and protected motion architecture. If the robot does not move correctly, stop the script first, then check whether the correct file was edited, the workspace was sourced, and another behavior is not already controlling the robot.