Skip to content

Commit

Permalink
Corrigindo pequenos erros e realizando testes
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielRPacheco committed Dec 15, 2023
1 parent b375b71 commit d6575ce
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 12 deletions.
1 change: 1 addition & 0 deletions data_to_read/bpm.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
106
1 change: 1 addition & 0 deletions data_to_read/spo2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
98
1 change: 1 addition & 0 deletions data_to_read/temp.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
38.33
2 changes: 1 addition & 1 deletion src/sa-bsn/configurations/target_system/g3t1_1.launch
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
0 -> Simulation (default)
1 -> Real sensors with Arduino
2 -> Table data (Turn on this feature to auto generate the file at data_to_read/*sensor_name*.csv)-->
<param name="connect_sensor_/g3t1_1" value="0" type="int" />
<param name="connect_sensor_/g3t1_1" value="2" type="int" />

</launch>
2 changes: 1 addition & 1 deletion src/sa-bsn/configurations/target_system/g3t1_2.launch
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
0 -> Simulation (default)
1 -> Real sensors with Arduino
2 -> Table data (Turn on this feature to auto generate the file at data_to_read/*sensor_name*.csv)-->
<param name="connect_sensor_/g3t1_2" value="0" type="int" />
<param name="connect_sensor_/g3t1_2" value="2" type="int" />

</launch>
2 changes: 1 addition & 1 deletion src/sa-bsn/configurations/target_system/g3t1_3.launch
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
0 -> Simulation (default)
1 -> Real sensors with Arduino
2 -> Table data (Turn on this feature to auto generate the file at data_to_read/*sensor_name*.csv)-->
<param name="connect_sensor_/g3t1_3" value="0" type="int" />
<param name="connect_sensor_/g3t1_3" value="2" type="int" />

</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ double Sensor::collect_table(){
}
if(line_number_counter == line_marker) {
m_data = std::stof(line);
std::cout << m_data << std::endl;
last_line = 0;
return m_data;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ def callback(data):
with open(caminho, 'rb') as file:
model = pickle.load(file)

debug = 0
if(debug==1):
# Realiza a previsao de um unico caso de teste
rospy.loginfo("oxi_data %f" % (data.oxi_data))
rospy.loginfo("ecg_data %f" % (data.ecg_data))
rospy.loginfo("trm_data C %f" % (data.trm_data))
rospy.loginfo("trm_data F %f" % ((data.trm_data * 1.8) + 32))
data_to_test = pd.DataFrame({'Oxygen': data.oxi_data, 'PulseRate': data.ecg_data, 'Temperature': ((data.trm_data * 1.8) + 32)}, index=[0])
resultado = model.predict(data_to_test)
debug = 1
if(debug==1):
# Realiza a previsao de um unico caso de teste
rospy.loginfo("Debug: oxi_data %f" % (data.oxi_data))
rospy.loginfo("Debug: ecg_data %f" % (data.ecg_data))
rospy.loginfo("Debug: trm_data C %f" % (data.trm_data))
rospy.loginfo("Debug: trm_data F %f" % ((data.trm_data * 1.8) + 32))
rospy.loginfo("Debug: Covid suspect %i" % (resultado))
if(resultado[0]==1):
rospy.loginfo("The patient's condition was compatible with a suspected case of Covid-19. Please see a doctor.")
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ G3T1_3::~G3T1_3() {}

void G3T1_3::setUp() {
Component::setUp();

convert_name();
std::array<bsn::range::Range,5> ranges;
std::string s;

Expand Down

0 comments on commit d6575ce

Please sign in to comment.