Based on
GitHub Pages: Blazor Toolbox for ROS
Example launchfile: webApp.launch
Please read the following documentation!
BlazorRoslib requires a rosbridge_websocket Node.
When BlazorRoslib is accessed via https (required with GitHub Pages), the browser requires a SSL connection to ROS.
Therefore the rosbridge server has to be setup for wss (originally described here):
- Set up a self-signed certificate ("snakeoil") (usually already done by ubuntu, if not see this GitHub Gist)
sudo apt-get install ssl-cert
- Copy the certificate to
/certs
foldersudo cp /etc/ssl/private/ssl-cert-snakeoil.key /etc/ssl/certs/
- chmod /etc/ssl/certs/ssl-cert-snakeoil.key so it is readable. /etc/ssl/certs/ssl-cert-snakeoil.pem should already be readable.
sudo chmod 644 /etc/ssl/certs/ssl-cert-snakeoil.key
- Setup a launchfile
OR add these args to
<launch> <include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch"> <arg name="ssl" default="true" /> <arg name="certfile" default="/etc/ssl/certs/ssl-cert-snakeoil.pem" /> <arg name="keyfile" default="/etc/ssl/certs/ssl-cert-snakeoil.key" /> </include> </launch>
/opt/ros/kinetic/share/rosbridge_server/launch/rosbridge_websocket.launch
<arg name="ssl" default="true" /> <arg name="certfile" default="/etc/ssl/certs/ssl-cert-snakeoil.pem" /> <arg name="keyfile" default="/etc/ssl/certs/ssl-cert-snakeoil.key" />
- This self-signed certificate is usually not accepted by the browser. As a workaround, you can open the full wss-URL in the browser and manually accept the certificate. You can find the required link on the ROS-Settings page.
To avoid using SSL you can setup a webserver for static files (e.g nginx) and host your own ROS-Toolbox.
For live video a web_video_server node is required.
Setup:
Add the node to a launchfile:
<node name="web_video_server" pkg="web_video_server" type="web_video_server" output="screen" />
OR
Start the node from the console:
rosrun web_video_server web_video_server
For remote recording rosbags the rosbag_recording_services is required. Please follow the installation instructions over there.
For checking topic health the rosbag_recording_services is required. Please follow the installation instructions over there.
For displaying PointCloud2 and LaserScan in the 3D View a tf2_web_publisher node is required.
Add the node to a launchfile:
<node name="tf2_web_republisher" pkg="tf2_web_republisher" type="tf2_web_republisher" output="screen"/>