Skip to content

SergiiGrynevych/Embedded_test_ros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GPS UART + Video Streaming + ROS2 Guide

This repository contains instructions for:

  1. Running the GPS UART parsing script
  2. Launching video streaming through MediaMTX
  3. Building and running the ROS2 package gps_uart_reader

Repository setup

Clone the repository and switch to the required branch:

git clone https://github.com/SergiiGrynevych/Embedded_test_ros.git
cd ~/Embedded_test_ros/

Replace <REPO_URL> and <REPO_FOLDER> with your actual repository values.


Requirements

Make sure the system has the following installed:

  • python3
  • pip3
  • MediaMTX
  • ROS2 (Humble, Foxy, or another compatible version)
  • colcon

Optional, depending on how you validate video streaming:

  • ffmpeg
  • ffplay
  • VLC
  • GStreamer packages

TASK 1 — Run GPS UART parser

Run the application

cd ~/Embedded_test_ros/
python3 UART_ParsingGPS.py

Troubleshooting

If pyserial is missing, install it with:

pip3 install pyserial

TASK 2 — Run video capture / streaming

Go to the MediaMTX folder:

cd ~/Embedded_test_ros/VideoStreaming/
chmod +x ~/Embedded_test_ros/VideoStreaming/mediamtx
chmod +x ~/Embedded_test_ros/VideoStreaming/rgb_cam_ffmpeg.sh
chmod +x ~/Embedded_test_ros/VideoStreaming/rgb_cam_gstreamer.sh

Launch app using FFmpeg config

./mediamtx mediamtx_ffmpeg.yml

Launch app using GStreamer config

./mediamtx mediamtx_gstreamer.yml

to run correctly video streamer in rgb_cam_ffmpeg.sh and rgb_cam_gstreamer.sh you need to set correctly variable DEVICE. In my case i use camera and search it by v4l2-ctl --list-devices


Stream validation

From another computer on the same network, you can verify the stream in the following ways.

Open in browser

http://<IP_ADDR_BOARD>:8080/stream/

Open with FFplay

ffplay rtsp://<IP_ADDR_BOARD>:8554/stream

Open with VLC

rtsp://<IP_ADDR_BOARD>:8554/stream

Troubleshooting for GStreamer

If GStreamer dependencies are missing, install them with:

sudo apt install -y \
  gstreamer1.0-tools \
  gstreamer1.0-plugins-base \
  gstreamer1.0-plugins-good \
  gstreamer1.0-plugins-bad \
  gstreamer1.0-plugins-ugly \
  gstreamer1.0-rtsp \
  libgstrtspserver-1.0-0 \
  libgstrtspserver-1.0-dev

TASK 3 — Build and run ROS2 package

A ROS2 distribution must be installed in your system, such as:

  • ROS2 Humble
  • ROS2 Foxy
  • or another compatible version

Build package

This will build the ROS2 interface package gps_position_msgs and the package gps_uart_reader.

cd ~/Embedded_test_ros/ros2
colcon build --packages-up-to gps_uart_reader

After building, source the workspace:

source ~/Embedded_test_ros/ros2/install/setup.bash

Launch with ros2 launch

source ~/Embedded_test_ros/ros2/install/setup.bash
cd ~/Embedded_test_ros/ros2
ros2 launch gps_uart_reader gps_uart.launch.py

Run with ros2 run

source ~/ros2/install/setup.bash
ros2 run gps_uart_reader gps_node --ros-args -p port:=/dev/ttyS5 -p baudrate:=9600

Dependencies

Install required Python and ROS2 build dependencies:

pip3 install pyserial
sudo apt install python3-colcon-common-extensions

Show ROS2 interface

ros2 interface show gps_position_msgs/msg/GpsPosition

Notes

  • Replace <IP_ADDR_BOARD> with the actual IP address of the board.
  • Make sure the board and the client computer are in the same network.
  • If ffplay is not installed on the client machine, use VLC or browser playback instead.
  • If ROS2 commands are not found, first source the appropriate ROS2 environment.

Quick Start

1. Run GPS parser

cd ~
python3 UART_ParsingGPS.py

2. Run MediaMTX

FFmpeg:

cd ~/VideoStreaming/
./mediamtx mediamtx_ffmpeg.yml

GStreamer:

cd ~/VideoStreaming/
./mediamtx mediamtx_gstreamer.yml

3. Build and run ROS2 package

cd ~/ros2
colcon build --packages-up-to gps_uart_reader
source ~/ros2/install/setup.bash
ros2 launch gps_uart_reader gps_uart.launch.py

Example validation commands

Check stream in browser

http://<IP_ADDR_BOARD>:8080/stream/

Check stream with FFplay

ffplay rtsp://<IP_ADDR_BOARD>:8554/stream

Show ROS2 interface

ros2 interface show gps_position_msgs/msg/GpsPosition

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors