Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.
Merged

Dev #78

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/deploy_jetson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
--build-arg password=${{ secrets.PASSWORD }} \
--build-arg user=${{ secrets.USER }} .


- name: Remove Old Local Executable
run: |
cd digital_cluster
Expand All @@ -44,4 +45,14 @@ jobs:
cd digital_cluster
rm -f /home/jetracer/qt_cluster/build/digital_cluster
cp ./digital_cluster /home/jetracer/qt_cluster/build/
ls -lh /home/jetracer/qt_cluster/build/digital_cluster
cp -r ./fonts_icon /home/jetracer/qt_cluster/
ls -lh /home/jetracer/qt_cluster/build/digital_cluster
ls -lh /home/jetracer/qt_cluster/fonts_icon

- name: Run Qt App with Docker Compose
run: |
cd /home/jetracer/qt_cluster
docker-compose build
docker-compose up


Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Google Testing
name: Documentation and running tests

on:
push:
Expand Down Expand Up @@ -31,19 +31,17 @@ jobs:
rm -rf build
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DUSE_SANITIZER=ON ..
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON ..
make
xvfb-run -a ./digital_cluster_test
lcov --capture --directory . --output-file coverage.info --ignore-errors mismatch,unused
lcov --remove coverage.info '*/build/*' '*/test/*' '/usr/*' --output-file coverage.info
genhtml coverage.info --output-directory coverage_report

- name: Create docs directory if it does not exist
run: mkdir -p docs

# Gerar documentação
- name: Generate Documentation
run: doxygen Doxyfile
run: cd doxyfiles && doxygen Doxyfile

- name: Upload Coverage Report
uses: actions/upload-artifact@v4
Expand All @@ -56,23 +54,18 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: doxygen-docs
path: docs # Adjust to your Doxygen output directory
path: doxyfiles/docs
# retention-days: 7

- name: Move coverage report into docs
run: |
mkdir -p docs/coverage
cp -r digital_cluster/build/coverage_report/* docs/coverage/
mkdir -p doxyfiles/docs/coverage
cp -r digital_cluster/build/coverage_report/* doxyfiles/docs/coverage/

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.PAT_TOKEN }}
publish_dir: docs
# destination_dir: ./
publish_dir: doxyfiles/docs
force_orphan: true
# user_name: github-actions
# user_email: github-actions@github.com
# keep_files: true
# exclude_assets: '**/*.md'

5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
digital_cluster/build/
digital_cluster/digital_cluster
digital_cluster/.env
docs/
.gitignore
digital_cluster/.vscode/
digital_cluster/src/object copy.cpp
.vscode/
17 changes: 0 additions & 17 deletions .vscode/c_cpp_properties.json

This file was deleted.

72 changes: 0 additions & 72 deletions .vscode/settings.json

This file was deleted.

9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Digital Cluster

![Digital Cluster](/digital_cluster/results/cluster.png)

## Project Architecture

Expand All @@ -13,12 +16,12 @@ The Jetson communicates with the Raspberry via **mqtt**, with a **Cloud Broker**

## Documentation and Results

For more documentation and visual results of our Qt app, go to [Digital Cluster README](/digital_cluster/README.md).
For more documentation and visual results of our Qt app, go to [Digital Cluster documentation](/digital_cluster/README.md).

For more on our **CAN Communication, Arduino and Speed Sensor**, visit our [Arduino README](/arduino/README_arduino.md).
For more on our **CAN Communication, Arduino and Speed Sensor**, visit our [Arduino documentation](/arduino/README_arduino.md).

To view a more detailed and structured documentation, click on
[Doxygen Docs](https://seame-pt.github.io/DistributedEmbeddedSystems/).
[Doxygen documentation](https://seame-pt.github.io/DistributedEmbeddedSystems/).

## Test Coverage Report

Expand Down
17 changes: 0 additions & 17 deletions digital_cluster/.vscode/c_cpp_properties.json

This file was deleted.

9 changes: 0 additions & 9 deletions digital_cluster/.vscode/settings.json

This file was deleted.

6 changes: 5 additions & 1 deletion digital_cluster/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
option(USE_SANITIZER "Enable sanitizer" OFF)

if(USE_SANITIZER)
set(SANITIZER_COMPILE_FLAGS -fsanitize=address -fno-omit-frame-pointer)
# set(SANITIZER_COMPILE_FLAGS -fsanitize=address -fno-omit-frame-pointer)
set(SANITIZER_LINK_FLAGS -fsanitize=address)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_COMPILE_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_COMPILE_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SANITIZER_LINK_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${SANITIZER_LINK_FLAGS}")
# set(SANITIZER_FLAGS -fsanitize=thread) # Uncomment this line if you want ThreadSanitizer instead:
endif()

Expand Down
11 changes: 5 additions & 6 deletions digital_cluster/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# Instrument Cluster

![Cluster](results/cluster.jpeg)
Our Digital Cluster receives updates from the **cloud** via MQTT.

Click to see our Digital Cluster updating the values with **Cloud** [View video](results/cluster.mp4).
![Cluster](results/cluster.gif)

### Compile and run with Cmake
## Compile and run with Cmake

To compile locally and view the cluster, you may need to install libraries such as QtMqtt. We recommend using Qt5 and installing QtMqtt from its source repository, the 5.13 version (specific branch).

Furthermore, if you are not in the same network as the jetracer, you should get our values through Cloud. Although, if you don't have access to our .env this will not work. Still, you can comment out the part of the code corresponding, and just view our cluster without real values. You can find the code specific to this matter in **src/mainwindow.cpp, init_mqtt()**.

If you are indeed in the same network, you can set the correct Hostname and port on the file mentioned above. You will also see the implementation and documentation of this matter in said file.


You may have some issues with the thread library so you may need to export it, in my device I do it like this:

```bash
Expand All @@ -35,15 +34,15 @@ make
./digital_cluster
```

# Google Test
## Google Test

To view our gtests go to the **test** folder, to run them, execute the following:

```bash
./automate_test.sh
```

# Cross-compilation
## Cross-compilation

To run this program on our jetracer, you should connect through localhost on mainwindow.cpp. After that, execute the following:

Expand Down
30 changes: 30 additions & 0 deletions digital_cluster/automate_cross.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
set -e
docker buildx build --platform linux/arm64 --progress=plain --load -t cross-env --build-arg password=$(grep password .env | cut -d '=' -f2) --build-arg user=$(grep user .env | cut -d '=' -f2) .


if [ -f "./digital_cluster" ]; then

echo "Removing existing executable from local machine"

rm ./digital_cluster

fi


echo "Copying new executable from Docker container"


docker cp $(docker create cross-env):/workspace/build/digital_cluster ./digital_cluster

echo "Removing existing executable from JetRacer"


ssh jetracer@100.123.70.46 "rm -f /home/jetracer/qt_cluster/build/digital_cluster"


echo "Copying new executable to Raspberry"

scp ./digital_cluster jetracer@100.123.70.46:/home/jetracer/qt_cluster/build

ssh jetracer@100.123.70.46 "cd qt_cluster && docker-compose build && docker-compose up"
7 changes: 4 additions & 3 deletions digital_cluster/automate_env.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/bash
export $(grep -v '^#' .env | xargs)
set -e
rm -rf build
mkdir build
# rm -rf build
# mkdir build
cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make
# export QT_WAYLAND_DISABLE_TABLET=1
# export QT_WAYLAND_DISABLE_CLIPBOARD=1
# export QT_QPA_PLATFORM=xcb
LD_PRELOAD=/lib/x86_64-linux-gnu/libpthread.so.0 ./digital_cluster
LD_PRELOAD=/lib/x86_64-linux-gnu/libpthread.so.0
./digital_cluster
# export QT_LOGGING_RULES="qt5.*=true;qt5.wayland=true"
# GSETTINGS_BACKEND=memory QT_WAYLAND_DISABLE_KEYBOARD=1
# valgrind --leak-check=full --track-origins=yes
Expand Down
15 changes: 7 additions & 8 deletions digital_cluster/automate_test.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#!/bin/bash
export $(grep -v '^#' .env | xargs)
set -e
# rm -rf build
# mkdir build
rm -rf build
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON .. # -DUSE_SANITIZER=ON
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON ..
make
LD_PRELOAD=/lib/x86_64-linux-gnu/libpthread.so.0 ./digital_cluster_test
# gdb --args ./digital_cluster_test

lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '*/build/*' '*/test/*' '/usr/*' '*/googletest/*' --output-file coverage.info
genhtml coverage.info --output-directory coverage_report
xdg-open coverage_report/index.html
# lcov --capture --directory . --output-file coverage.info
# lcov --remove coverage.info '*/build/*' '*/test/*' '/usr/*' '*/googletest/*' --output-file coverage.info
# genhtml coverage.info --output-directory coverage_report
# xdg-open coverage_report/index.html

#/lib/x86_64-linux-gnu/libasan.so.8
# valgrind --leak-check=full ./digital_cluster_test
Expand Down
Empty file removed digital_cluster/coverage.info
Empty file.
Binary file added digital_cluster/fonts_icon/speed50.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added digital_cluster/fonts_icon/speed80.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion digital_cluster/include/autonomy.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <QHBoxLayout>
#include <QLabel>
#include <QDir>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <QCoreApplication>

Expand All @@ -17,6 +19,7 @@ class Autonomy : public QWidget
~Autonomy();
void set_autonomy(int i);
int get_nbsections();
int get_autonomy();
QVector<QWidget*> get_sections();
QHBoxLayout* get_layout();
QVBoxLayout* get_mainlayout();
Expand All @@ -25,10 +28,11 @@ class Autonomy : public QWidget

private:
int nb_sections;
int autonomy;
QVector<QWidget*> sections;
QHBoxLayout *layout;
QVBoxLayout *main_layout;
QLabel *label;
};

#endif // Autonomy_H
#endif
Loading