RoArm-M2-S 7. Web Application Based on ROS2Web app

From Waveshare Wiki
Jump to: navigation, search
RoArm-M2-S 7. Web Application Based on ROS2Web app
RoArm-M2-S.jpg

I2C, UART
TTL Serial Bus Servo Control Interface,
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

7. Web Application Based on ROS2Web app

The web application in this section is not related to Foxglove, which was introduced in Chapter 6, and closes all terminal windows except the roarm_driver robot arm driver node to ensure that the roarm_driver node is running normally.

7.1 ROS2Web_app Project Introduction

ROS2Web_app is an open-source project from GitHub. This project provides an application interface based on Web, which allows users to interact with ROS2 robots through the browser. This application utilizes the convenience and expandability of Web technology, and users do not need to install any software or hardware to control and operate the robot.

The main functions of ROS2Web_app include displaying status information about the robot, receiving control commands from the user, and sending commands to the robot. In addition, it supports live video streaming, allowing users to view the robot's screen in real time. Due to its web-based nature, ROS2Web_app can run on any device that supports a modern web browser, including computers, tablets and smartphones.
The code for the ROS2Web_app project is open on GitHub, which for researchers and developers means that they are free to download, modify and distribute the code for this project. This provides them with a powerful tool for developing and testing their own ROS2 bots.

7.2 Running Web Application

Press Ctrl+Alt+T to open a new terminal, enter the robotic arm ROS2 workspace, and run the ROS2's robotic arm driving nodes:

cd ~/roarm_ws_em0/
ros2 run roarm_driver roarm_driver

Open a second new terminal to enter the workspace of the robotic arm ROS2 and turn on the relevant nodes for the control of the robotic arm:

cd ~/roarm_ws_em0/
ros2 launch moveit_servo demo.launch.py

Open a third new terminal, enter the workspace of the robotic arm ROS2 and run the Web Application Control node in ROS2:

cd ~/roarm_ws_em0/
ros2 run roarm_moveit_cmd webappcontrol

Open a fourth new terminal to enter the workspace of the robotic arm ROS2 and run the server for the ROS2Web application, which is used to publish the web application to the LAN, as well as to get the IP of the virtual machine:

cd ~/roarm_ws_em0/
ros2 web server --no-auth

M2-SWeb.png
Open a fifth new terminal to enter the workspace of the robotic arm ROS2 and run the Web Application node for building applications:

cd ~/roarm_ws_em0/
ros2 run roarm_web_app roarm_web_app

Then on a computer on the same LAN (which can also be the computer running the VM), open Google Chrome and enter the IP address of the VM in the address bar + :8080/roarm_web_app, for example:

http://192.168.10.104:8080/roarm_web_app

M2-SWeb1.png
You can drag the dot on this web page to control the XY axis of the arm. We have implemented simple functions and arranged simple components in this web page. The components on the left side cannot be controlled by the Launch mentioned above, but users can extend the functions of these components according to their own needs.

RoArm-M2-S ROS2 Humble + Moveit2 Tutorial