Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
d73315a
arrumando o repositório
gabrielbfranca Sep 5, 2024
8d3f938
setting up behave
gabrielbfranca Sep 17, 2024
42be7e0
test scenarios
gabrielbfranca Sep 22, 2024
b5f7f6a
target_system implmentation
gabrielbfranca Sep 24, 2024
6922aba
adicionando steps do mananging system e adicionando feature
gabrielbfranca Sep 26, 2024
757ec72
changing features and steps
gabrielbfranca Sep 26, 2024
e7674cb
Update managing_system_steps.py
gabrielbfranca Sep 26, 2024
a2e2086
Update managing_system_steps.py
gabrielbfranca Sep 26, 2024
c8c9d18
Update managing_system_steps.py
gabrielbfranca Sep 26, 2024
a79eb04
comunicação feita
gabrielbfranca Sep 27, 2024
7fb6840
some fixes
gabrielbfranca Oct 4, 2024
0e0eb62
removendo teste em um pacote
gabrielbfranca Oct 6, 2024
e3fb1a0
unverified charac test
gabrielbfranca Oct 7, 2024
0dfae3a
Update test_patient_flow.py
gabrielbfranca Oct 7, 2024
9f5716c
Update test_patient_flow.py
gabrielbfranca Oct 7, 2024
93b599a
Update test_patient_flow.py
gabrielbfranca Oct 7, 2024
4d72334
Update test_patient_flow.py
gabrielbfranca Oct 8, 2024
1be9157
functional code in test
gabrielbfranca Oct 9, 2024
e0f584c
integration package for testing works
gabrielbfranca Oct 9, 2024
330ed2c
fixing rostest
gabrielbfranca Oct 9, 2024
b4acbf8
rospy can catch failures
gabrielbfranca Oct 14, 2024
6d87b2f
features implementados
gabrielbfranca Oct 29, 2024
432f144
refactoring
gabrielbfranca Oct 31, 2024
bf1cc7a
Update check_bsn.feature
gabrielbfranca Oct 31, 2024
8f59a7f
Update check_bsn.feature
gabrielbfranca Oct 31, 2024
c80273e
Update parsers.py
gabrielbfranca Oct 31, 2024
591e2f8
Update check_bsn.feature
gabrielbfranca Nov 1, 2024
b865c7d
mudanaça na impl
gabrielbfranca Nov 1, 2024
352742a
Update check_bsn.feature
gabrielbfranca Nov 2, 2024
0b2cc18
patient status detection
gabrielbfranca Nov 2, 2024
8d271b7
Update Dockerfile.dev
gabrielbfranca Nov 2, 2024
90860b9
null values in sad path is being timed out
gabrielbfranca Nov 7, 2024
3ff489b
Update parse topic data
gabrielbfranca Nov 7, 2024
1967d1e
functioning sad path
gabrielbfranca Nov 8, 2024
5d4b498
solved perfomance
gabrielbfranca Nov 8, 2024
03a1d22
mudança de propriedade
gabrielbfranca Nov 8, 2024
cf73b95
env change
gabrielbfranca Dec 5, 2024
3811ad9
timestamp changes
gabrielbfranca Dec 9, 2024
ed70a7c
changing threadpool
gabrielbfranca Dec 21, 2024
3d30480
adicionando unite teste
gabrielbfranca Jan 3, 2025
93647dd
versao atualizada
gabrielbfranca Jan 21, 2025
e66519c
setting up
gabrielbfranca Jan 22, 2025
cc31f1d
unresolved
gabrielbfranca Jan 28, 2025
74be6ec
exemplares básicos para verificar setup de componente.
gabrielbfranca Jan 29, 2025
5c224ce
bdd configurado em component
gabrielbfranca Jan 29, 2025
62c89dd
setting up patient mocking and bdd scenarios
gabrielbfranca Feb 17, 2025
b40648a
discovered issue in testing. Is the rostest. Roslaunch component runs…
gabrielbfranca Feb 17, 2025
c9bb329
p010 happy path
gabrielbfranca Feb 19, 2025
08eb405
added BSN-P03 happy path
gabrielbfranca Feb 20, 2025
ee4ad86
updated scenarios
gabrielbfranca Feb 21, 2025
d7b3997
Update check_bsn.feature
gabrielbfranca Feb 23, 2025
6d30f0e
grammar changes
gabrielbfranca Mar 19, 2025
fec0114
persistance implementation test
gabrielbfranca Mar 22, 2025
1dade8b
data_persistance
gabrielbfranca Mar 24, 2025
dfecd35
added BDD test with pytest
richardjlv Oct 27, 2025
7f42c89
Implement BDD tests for target system and update CMake configuration
richardjlv Nov 6, 2025
628f1b5
Add BDD tests and launch configurations for data persistence and heal…
richardjlv Nov 26, 2025
73401fc
Add BDD tests for managing system and sensor components, including la…
richardjlv Nov 28, 2025
b8e7f02
Add test suites for G3T1 sensors with launch configurations
richardjlv Dec 11, 2025
50f8f05
Add BDD tests for injector functionality and update check_bsn scenarios
richardjlv Dec 11, 2025
1979a35
Refactor health status tests and update launch configurations
richardjlv Jan 15, 2026
a770e6e
Add test suite for G4T1 Central Hub component with sensor data handling
richardjlv Feb 1, 2026
f341c32
Add coverage script and update CMakeLists for code coverage; include …
richardjlv Feb 7, 2026
a79f8f5
Refactor risk assessment methods in SensorConfiguration and update te…
richardjlv Feb 15, 2026
97a57fc
Add launch file and test suite for G3T1_1 connected sensor functionality
richardjlv Feb 15, 2026
df8f5e5
Update sensor launch files to log output and add new test cases for G…
richardjlv Feb 22, 2026
6bae92e
refactor: remove obsolete tests
richardjlv Feb 26, 2026
51065d2
cleanup: remove commented-out test code and improve coverage flags
richardjlv Feb 26, 2026
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
5 changes: 5 additions & 0 deletions .devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
cd /workspaces/bsn &&\
rosdep install --from-paths src --ignore-src -r -y &&\
rm -rf build &&\
rm -rf devel &&\
catkin_make
echo "source /workspaces/bsn/devel/setup.sh" >> /root/.bashrc
source ~/.bashrc
source /opt/ros/melodic/setup.bash

7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ json/
# Ignore generated docs
*.dox
*.wikidoc

html
latex
# eclipse stuff
.project
.cproject
Expand Down Expand Up @@ -64,4 +65,6 @@ test.py
json
venv
TODO
bsn_remote_control
bsn_remote_control

coverage/
31 changes: 21 additions & 10 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
FROM ros:melodic-ros-core-bionic

RUN apt update &&\
apt install -y python-rosdep build-essential git python-pip python3-pip python-virtualenv python-rospkg ros-melodic-rosmon &&\
sudo rosdep init && rosdep update &&\
pip3 install pandas

COPY .devcontainer/additional_bashrc.sh /root/.additional_bashrc

RUN cat "/root/.additional_bashrc" >> /root/.bashrc && rm /root/.additional_bashrc
FROM ros:melodic-ros-core-bionic

RUN apt update &&\
apt install -y python-rosdep build-essential git python-pip python3-pip python-virtualenv python-rospkg ros-melodic-rosmon &&\
sudo rosdep init && rosdep update &&\
pip3 install pandas &&\
pip3 install behave &&\
sudo apt-get install python3-rosdep python3-rosinstall-generator python3-vcstool &&\
sudo apt-get install python3-pybind11 &&\
sudo apt-get install python-pybind11


ENV DISPLAY=:0
ENV QT_X11_NO_MITSHM=1

COPY .devcontainer/additional_bashrc.sh /root/.additional_bashrc

RUN cat "/root/.additional_bashrc" >> /root/.bashrc && rm /root/.additional_bashrc



48 changes: 24 additions & 24 deletions bsn.launch
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<launch>
<include file="./src/sa-bsn/configurations/knowledge_repository/data_access.launch" /> <!-- KNOWLEDGE REPOSITORY -->
<include file="./src/sa-bsn/configurations/system_manager/strategy_manager.launch" /> <!-- MANAGER SYSTEM -->
<include file="./src/sa-bsn/configurations/system_manager/strategy_enactor.launch" /> <!-- MANAGER SYSTEM -->
<include file="./src/sa-bsn/configurations/logging_infrastructure/logger.launch" /> <!-- LOGGING INFRASTRUCTURE -->
<include file="./src/sa-bsn/configurations/target_system/probe.launch" /> <!-- APPLICATION -->
<include file="./src/sa-bsn/configurations/target_system/effector.launch" /> <!-- APPLICATION -->
<include file="./src/sa-bsn/configurations/target_system/g4t1.launch" /> <!-- APPLICATION -->
<include file="./src/sa-bsn/configurations/environment/patient.launch " /> <!-- APPLICATION -->
<include file="./src/sa-bsn/configurations/target_system/g3t1_1.launch" /> <!-- APPLICATION -->
<include file="./src/sa-bsn/configurations/target_system/g3t1_2.launch" /> <!-- APPLICATION -->
<include file="./src/sa-bsn/configurations/target_system/g3t1_3.launch" /> <!-- APPLICATION -->
<include file="./src/sa-bsn/configurations/target_system/g3t1_4.launch" /> <!-- APPLICATION -->
<include file="./src/sa-bsn/configurations/target_system/g3t1_5.launch" /> <!-- APPLICATION -->
<include file="./src/sa-bsn/configurations/target_system/g3t1_6.launch" /> <!-- APPLICATION -->
<!--<include file="./src/sa-bsn/configurations/simulation/injector.launch" /> <!-- FAULT INJECTION -->
<launch>

<include file="./src/sa-bsn/configurations/knowledge_repository/data_access.launch" /> <!-- KNOWLEDGE REPOSITORY -->

<include file="./src/sa-bsn/configurations/system_manager/strategy_manager.launch" /> <!-- MANAGER SYSTEM -->
<include file="./src/sa-bsn/configurations/system_manager/strategy_enactor.launch" /> <!-- MANAGER SYSTEM -->

<include file="./src/sa-bsn/configurations/logging_infrastructure/logger.launch" /> <!-- LOGGING INFRASTRUCTURE -->

<include file="./src/sa-bsn/configurations/target_system/probe.launch" /> <!-- APPLICATION -->
<include file="./src/sa-bsn/configurations/target_system/effector.launch" /> <!-- APPLICATION -->
<include file="./src/sa-bsn/configurations/target_system/g4t1.launch" /> <!-- APPLICATION -->

<include file="./src/sa-bsn/configurations/environment/patient.launch" /> <!-- APPLICATION -->

<include file="./src/sa-bsn/configurations/target_system/g3t1_1.launch" /> <!-- APPLICATION -->
<include file="./src/sa-bsn/configurations/target_system/g3t1_2.launch" /> <!-- APPLICATION -->
<include file="./src/sa-bsn/configurations/target_system/g3t1_3.launch" /> <!-- APPLICATION -->
<include file="./src/sa-bsn/configurations/target_system/g3t1_4.launch" /> <!-- APPLICATION -->
<include file="./src/sa-bsn/configurations/target_system/g3t1_5.launch" /> <!-- APPLICATION -->
<include file="./src/sa-bsn/configurations/target_system/g3t1_6.launch" /> <!-- APPLICATION -->

<!--<include file="./src/sa-bsn/configurations/simulation/injector.launch" /> FAULT INJECTION -->
</launch>
79 changes: 79 additions & 0 deletions coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/bin/bash

# --- Configurações ---
OUTPUT_DIR="coverage"
# Agora os arquivos intermediários ficarão DENTRO da pasta de output
INFO_FILE="$OUTPUT_DIR/coverage.info"
INFO_FILE_CLEAN="$OUTPUT_DIR/coverage_cleaned.info"

# Verifica se estamos na raiz do workspace
if [ ! -f "devel/setup.bash" ]; then
echo "❌ Erro: Execute este script da raiz do seu workspace catkin."
exit 1
fi

# Carrega o ambiente
source devel/setup.bash

# Cria a pasta de destino imediatamente para guardar a bagunça lá
mkdir -p "$OUTPUT_DIR"

echo "========================================="
echo "🧹 1. Zerando contadores anteriores..."
echo "========================================="
lcov --directory . --zerocounters --quiet

echo "========================================="
echo "🚀 2. Rodando os testes..."
echo "========================================="

if [ $# -eq 0 ]; then
echo "⚠️ Nenhum comando passado. Rodando 'catkin_make run_tests'..."
catkin_make run_tests
else
echo "Executando: $@"
"$@"
fi

# Captura erro do teste mas não para o script
TEST_EXIT_CODE=$?
if [ $TEST_EXIT_CODE -ne 0 ]; then
echo "⚠️ Os testes falharam. Gerando relatório para diagnóstico..."
fi

echo "========================================="
echo "📸 3. Capturando dados (Salvando em $OUTPUT_DIR)..."
echo "========================================="
# Gera o arquivo bruto JÁ dentro da pasta output
lcov --directory . --capture --output-file "$INFO_FILE" --rc lcov_branch_coverage=1

echo "========================================="
echo "🗑️ 4. Filtrando arquivos..."
echo "========================================="
lcov --remove "$INFO_FILE" \
'/usr/*' \
'/opt/*' \
'*/test/*' \
'*/tests/*' \
'*/build/*' \
'*/devel/*' \
'*/CMakeCCompilerId.c' \
'*/CMakeCXXCompilerId.cpp' \
--output-file "$INFO_FILE_CLEAN" \
--rc lcov_branch_coverage=1

echo "========================================="
echo "📊 5. Gerando HTML..."
echo "========================================="
genhtml "$INFO_FILE_CLEAN" --output-directory "$OUTPUT_DIR" --rc lcov_branch_coverage=1 --legend

# --- LIMPEZA FINAL ---
# Remove os arquivos .info para deixar apenas o site HTML.
# Se quiser guardar os dados brutos para usar no Codecov/Sonar, comente as linhas abaixo.
echo "✨ Limpando arquivos temporários..."
rm "$INFO_FILE"
rm "$INFO_FILE_CLEAN"

echo ""
echo "✅ Concluído!"
echo "📄 Abra: $(pwd)/$OUTPUT_DIR/index.html"
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
8 changes: 5 additions & 3 deletions src/libbsn/src/configuration/SensorConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,17 @@ namespace bsn {
}

bool SensorConfiguration::isLowRisk(double val) {
return lowRisk.in_range(val);
return lowPercentage.in_range(val);
}

bool SensorConfiguration::isMediumRisk(double val) {
return (mediumRisk[0].in_range(val) || mediumRisk[1].in_range(val));
// return (mediumRisk[0].in_range(val) || mediumRisk[1].in_range(val));
return midPercentage.in_range(val);
}

bool SensorConfiguration::isHighRisk(double val) {
return (highRisk[0].in_range(val) || highRisk[1].in_range(val));
// return (highRisk[0].in_range(val) || highRisk[1].in_range(val));
return highPercentage.in_range(val);
}

void SensorConfiguration::setHighRisk(const array<Range, 2> h) {
Expand Down
Loading