This project uses a Docker container to execute a multilateration algorithm in real-time on a raw dataset, processed offline, while allowing graphical visualization of the results. Everything is managed by a launch script (docker_launch.sh) that automates the process and ensures it runs in a controlled environment.
Before starting, ensure you have the following installed:
- Docker
- Permissions to use X11 on the host system (for graphical visualization)
- Access to the project repository, which contains the necessary scripts.
- MATLAB R2023b or higher versions.
The project is organized as follows:
ROUD_ps/
├── Dataset/
│ ├── experiment_recording.bag
│ ├── raw_data.bag
│ └── Real_JEMERG23.sh
├── Code/
│ ├── SARFIS/
│ │ ├── DEM files/
│ │ ├── Matlab functions/
│ │ │ ├── DEM/
│ │ │ ├── GPX/
│ │ │ ├── GUI/
│ │ │ └── ROS/
│ │ │ ├── experimentRosbag.bag
│ │ │ ├── rawRosbag.bag
│ │ │ └── ROSbag_play.m
│ │ ├── resources/
│ │ ├── works/
│ │ └── SARFIS.prj
│ ├── Multilateration/
│ │ ├── server_ros_bridge.py
│ │ ├── ros_wrapper.py
│ │ ├── data_visualization.py
│ │ ├── positioning_rtt_ils.py
│ │ └── anchors_positions.py
├── Figures/
├── Demo/
│ └── video-demo.mp4
└── docker_launch.sh
Code/Multilateration/
: contains the multilateration algorithm and workflow to be applied on the provided dataset.Dataset/
: contains the real data from the experiment and raw data to be processed offline.SARFIS/Matlab functions/ROS/
: folder where new recorded rosbags are stored.docker_launch.sh
: shell script used to automate tasks.
Build the docker image:
docker build -t ros-noetic-multilateration .
Before launching the container:
- Ensure the required files (e.g.,
server_ros_bridge.py
,ros_wrapper.py
,data_visualization.py
, andReal_JEMERG23.sh
) are present in the expected paths (see the project's structure). - Verify that you have X11 access from Docker:
xhost +local:root
- Stops and removes any previous container with the name
ros1_multilateration
.docker stop ros1_multilateration docker rm ros1_multilateration
- To launch the container and execute the workflow:
./docker_launch.sh OLS
Where OLS
is the specified estimation mode. You can replace the Ordinary Least Squares mode (OLS
) with other estimation methods if supported by the Real_JEMERG23.sh
script.
- The user can access the container from other terminals using:
docker exec -it ros1_multilateration bash
The docker_launch.sh
script performs the following tasks:
- Executes the
Real_JEMERG23.sh
script, which includes:- Initializing
roscore
. - Playing the rosbag
- Launching the raw
- Recording a new rosbag in the
SARFIS/Matlab functions/ROS/
folder.
- Initializing
- Waits for all processes (e.g., rosbag play, recording) to complete.
- Automatically detects the recorded rosbag and extracts its start and end times.
- Executes the
data_visualization.py
script with the detected parameters.
Workflow results include:
- A recorded rosbag file in
SARFIS/Matlab functions/ROS/
. - Graphs generated by
data_visualization.py
.
The container will remain active after the workflow finishes. You can stop it manually with:
docker stop ros1_multilateration
If you see a message indicating the container is already running:
- Stop it:
docker rm -f ros1_multilateration
If the script appears to hang waiting for the notification file (/tmp/rosbag_record_done
):
- Check the container logs:
docker logs ros1_multilateration
- Ensure that the
Real_JEMERG23.sh
script completes successfully and creates the notification file:touch /tmp/rosbag_record_done
If the recorded rosbag file is not found:
- Verify that the output directory is correctly configured:
ls "SARFIS/Matlab functions/ROS/"
- Check the directory permissions and container logs.
- To customize the workflow, modify the
Real_JEMERG23.sh
ordata_visualization.py
scripts as needed. - If you need to add new execution modes or filters, ensure the relevant scripts are updated accordingly.
The SARFIS tool requires two instances of MATLAB:
-
First Instance:
- Start the master ROS node with
rosinit('localhost')
. - Create the ROS 1 publishers by executing the
ROSbag_play
function which is in theSARFIS/Matlab functions/ROS/
folder. - Pause execution, waiting for the user to press ENTER after creating the subscribers in the second MATLAB instance.
- Start the master ROS node with
-
Second Instance:
- Open the SARFIS tool.
- Connect to the master from the tool's interface (no need to specify the port; it defaults to 11311).
- Create the 6 default agents using the
add
button. The associated subscribers are configured by default. - Create the subscriber associated with geolocation in the
Global Settings
tab.
-
Final Step:
- Return to the first MATLAB instance and press ENTER.
- Observe the recorded bag being replayed offline in the SARFIS tool.