Web Camera Node
- This node can publish ROS image messages to port 8080 of a webpage, providing the functionality to view camera images via a web browser.
Viewing Images Via Webpage
Viewing Methods
Local Viewing
- Open a web browser and enter the URL:
localhost:8080
- Open a web browser and enter the URL:
Local Network Viewing
Open a web browser and enter the URL:
Robot's IP:8080
- For example:
192.168.31.198:8080
- For example:
Viewing Images
Head Camera
- Click on
/camera/color/
'simage_raw
- Click on
Chin Camera
- Click on
/chin_camera/
'simage
- Click on
Node Startup
Node Name
- web_video_server
Package Path
- ~/robot_ros_application/catkin_ws/src/web_video_server
Starting the Node
Method 1
The robot will automatically run the
~/start.sh
script upon startup, which starts a series of basic functional nodes, includingweb_video_server
. Therefore, this node is already running after the robot is powered on.You can view all active nodes using the Ubuntu command
rosnode list
, whereweb_video_server
corresponds to/web_video_server
.lemon@lemon-NUC8i3BEH:~$ rosnode list
/BodyHubNode
/SensorHubNode
/camera/realsense2_camera
/camera/realsense2_camera_manager
/chin_camera
/head_toward_sound
/ik_module_node
/joystick_handle_node
/keyboards_node
/mqtt_node
/ros_aiui_node
/ros_broadcast_node
/ros_color_node
/ros_face_node
/ros_fruit_node
/ros_gesture_node
/ros_label_node
/ros_mic_arrays
/ros_msg_node
/ros_socket_node
/ros_speech_node
/rosout
/slam_mapping_node
/vision_node
/web_video_server # web_video_server nodeIf you receive a prompt that the page cannot be accessed when opening the webpage, it may indicate that the node has not started or has exited abnormally. The solution is as follows:
If you enter
rosnode list
in the terminal and receive the promptERROR: Unable to communicate with master!
, like this:lemon@lemon-NUC8i3BEH:~$ rosnode list
ERROR: Unable to communicate with master!Simply rerun the
start.sh
script:cd ~/ && ./start.sh
If the active node list output is missing only the
web_video_server
node compared to the table above, you can use Method 2 to run this node individually.
Method 2
Run the node individually
source ~/robot_ros_application/catkin_ws/devel/setup.bash
rosrun web_video_server web_video_serverAfter starting the node, do not close this terminal or manually interrupt the node, as the webpage display of the camera image relies on the normal operation of this node.