WWW-POSIM v0.6.16Simulator documentation
Documentation menu
WWW-POSIM / Simulator documentation

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.

  1. Open WWW-POSIM, sign in and create your own WAM-V world in ROS 2 direct control mode. Wait for the running world.
  2. Install VS Code and its Microsoft Python extension.
  3. Follow only the block for your computer below. Copy one block into its terminal and press Enter. The .venv folder 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

  1. In VS Code, select File → Open Folder and open posim-controller in your home folder.
  2. Install Microsoft's Python extension if you have not already done so.
  3. 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.
  4. Create a file named controller.py. Paste the following code. Replace YOU@example.com with 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)
  1. Select Terminal → New Terminal. Run the command for your computer:

Windows:

.\.venv\Scripts\python.exe controller.py

Mac/Ubuntu:

.venv/bin/python controller.py
  1. 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

Search documentation