Control a web workspace
Run Python on your computer and send commands to your personal simulation on the website.
Website: prepare Python and VS Code
Use this path when you want the simulation to run on the website.
- Open WWW-POSIM, sign in and create your own WAM-V world in ROS 2 direct control mode. Wait for the running world.
- Install VS Code and its Microsoft Python extension.
- Follow only the block for your computer below. Copy one block into its terminal and press Enter. The
.venvfolder holds Python packages for this project.
Windows — PowerShell
Install the Python install manager. Open a new PowerShell window from the Start menu, then paste:
py install 3.14
mkdir "$HOME\posim-controller"
cd "$HOME\posim-controller"
py -3.14 -m venv .venv
.\.venv\Scripts\python.exe -m pip install https://github.com/IOES-Lab/homebrew-www-posim/releases/download/v0.6.16/www_posim_ros-0.4.3-py3-none-any.whl
Mac — Terminal
Install Python 3.14 using the macOS installer from Python.org. Open Applications → Utilities → Terminal, then paste:
mkdir -p ~/posim-controller
cd ~/posim-controller
python3.14 -m venv .venv
.venv/bin/python -m pip install https://github.com/IOES-Lab/homebrew-www-posim/releases/download/v0.6.16/www_posim_ros-0.4.3-py3-none-any.whl
Ubuntu — Terminal
Press Ctrl+Alt+T to open a terminal. Paste:
sudo apt update
sudo apt install -y python3-venv python3-pip
mkdir -p ~/posim-controller
cd ~/posim-controller
python3 -m venv .venv
.venv/bin/python -m pip install https://github.com/IOES-Lab/homebrew-www-posim/releases/download/v0.6.16/www_posim_ros-0.4.3-py3-none-any.whl
sudo may ask for your computer's password. Characters do not appear while you type it; press Enter after typing.
Website: run your program in VS Code
- In VS Code, select File → Open Folder and open
posim-controllerin your home folder. - Install Microsoft's Python extension if you have not already done so.
- Open the command palette with Ctrl+Shift+P on Windows/Linux or Cmd+Shift+P on Mac. Select Python: Select Interpreter and choose the project's
.venv. - Create a file named
controller.py. Paste the following code. ReplaceYOU@example.comwith your account email and save.
from www_posim_ros import Session
with Session.remote(email="YOU@example.com", control=True) as sim:
topic = next(name for name, kind in sim.topics.items()
if kind == "nav_msgs/msg/Odometry")
print(sim.latest(topic)["pose"]["pose"]["position"])
sim.set_velocity(forward=0.3, yaw_rate=0.0, duration=2.0)
- Select Terminal → New Terminal. Run the command for your computer:
Windows:
.\.venv\Scripts\python.exe controller.py
Mac/Ubuntu:
.venv/bin/python controller.py
- At
Password:, type your WWW-POSIM password and press Enter. Characters do not appear while you type. Watch WAM-V move in the website.
The program runs on your computer and sends commands to your own server workspace. Importing the package does not sign in or start a connection; entering the with block connects.
If something does not work
No module named www_posim_ros: select the project's Python interpreter. For a website project, repeat the package-install command with that.venvPython.- No fresh telemetry: check that your world is running and the robot has appeared. A topic name alone does not mean data is arriving.
- Start your own workspace in ROS 2 direct-control mode: create a world with that control mode selected.
controller_busy: stop the other program controlling this world, then run your program again.- World or robot changed: stop the program and start it again to obtain the current connection profile.
- Installed ROS tools fail: check
~/.www-posim-ros/domain-76/client.loginside the prepared environment. Stop and reopen the ROS tools if needed.