Skip to content

Latest commit

 

History

History
89 lines (62 loc) · 3.57 KB

README.md

File metadata and controls

89 lines (62 loc) · 3.57 KB

Setup Instructions

Install node 17

nvm method (works on any OS, recommended for development on personal computers)

I would recommend using nvm nvm (Node Version Manager), it provides an easy way to install multiple versions of node on a single computer.

Install nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash

Open a new terminal to get access to nvm

Install node

nvm install 17

snap method (works on ubuntu only, recommended for the robot's computer)

sudo snap install node --classic --channel=17

Verify that node is correctly installed and that you have the version

node -v

This should print out v17.*.* if node is installed correctly

Install pnpm

We use, pnpm instead of npm. Read why here

In general, pnpm is a drop-in replacement for npm but it is faster, uses less storage, and is generally better. Any npm command should work the exact same if you just replace it with pnpm.

Install it with:

npm install -g pnpm

Download all node packages

Note: All of the following commands including this one need to be run in the blueshift_web directory

pnpm install

Run the website for development

Note: Until RobotWebTools/roslibjs#548 is fixed, running the website in development mode won't work. The ROS based build/launch scripts are still functional, but when developing the website, it needs to be manually built using pnpm run build and then pnpm run preview This should be fixed (see this commit). Its a kind of janky hack, but works.

pnpm run dev

If it needs to be accessible on other computers on your network

pnpm run dev -- --host

If the website needs to communicate with ROS (i.e. you are doing anything more than UI development), you need to start the rosbridge node:

ros2 launch rosbridge_server rosbridge_websocket_launch.xml

Running the website with ROS

To build it:

colcon build --packages-select blueshift_web

Note 1: This first time it is built, this might take a long time, because all the node packages need to be copied over to the install folder. Every subsequent time, it should only copy over the difference, so it should be faster. TODO later: there may be a way to just re-download them into the install directory which might be quicker.

Note 2: Building this with the --symlink-install flag seems to raise cause an issue with symlinks, so this package (and probably the whole workspace) should be built without that flag. These should be fixed as of these commits

To run it (this also starts the rosbridge_server to facilitate JS<->ROS communication)

ros2 launch blueshift_web simple.launch.py

Note: if there are any errors about missing packages, make download all dependencies as described here

Notes

Joystick functionality will only work correctly in a Chrome based browser (ie. Chrome or Chromium).