Skip to content

Commit bc39e90

Browse files
authored
Merge pull request #41 from FireDynamics/dev_sven
adds fire, room corners and cam positions to the coordinate plot
2 parents 04393cf + 73a1bd3 commit bc39e90

File tree

3 files changed

+25
-14
lines changed

3 files changed

+25
-14
lines changed

.github/workflows/run_robot_framework_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Get Repository Name
4949
run: |
5050
export REPO="$(echo "${{ github.repository }}" | awk -F / '{print $2}' | sed -e "s/:refs//")"
51-
echo "::set-env name=REPOSITORY_NAME::$REPO"
51+
echo "name=REPOSITORY_NAME::$REPO" >> $GITHUB_ENV
5252
# when test are run for a commit, post results as a comment
5353
# note: comment is not posted for tests triggered for pull requests, only for a main branch (master)
5454
- name: Send test report as comment to commit

ledsa/tests/AcceptanceTests/LedsaATestLibrary.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
from robot.api.deco import keyword, library
22
from robot.libraries.BuiltIn import BuiltIn
33
import os
4-
from PIL import Image
4+
try:
5+
from PIL import Image
6+
except ImportError:
7+
import Image
58
import numpy as np
69
from scipy.stats import norm
710
from ledsa.core.ledsa_conf import ConfigData

ledsa/tests/plot_coordinates.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,33 @@
33
import numpy as np
44
from ..core.led_helper import load_file
55
from os import sep
6+
import pandas as pd
67

78

89
def plot_coordinates():
910
leds = load_file('analysis{}led_search_areas_with_coordinates.csv'.format(sep), delim=',')
10-
print(np.shape(leds))
1111
fig = plt.figure()
1212
ax = fig.add_subplot(111, projection='3d')
1313

14-
ax.scatter(leds[:, 3], leds[:, 4], leds[:, 5])
15-
c1 = [7.29, 6.46, 2.3]
16-
c2 = [1.28, 4.88, 2.3]
17-
f = [4.5, 5.25, 0]
18-
x = [7.29, 1.28, 4.5]
19-
y = [6.46, 4.88, 5.25]
20-
z = [2.3, 2.3, 0]
21-
ax.scatter(x, y, z, s=30)
22-
ax.set_xbound(0, 7)
23-
ax.set_ybound(0, 7)
24-
ax.set_zbound(0, 7)
14+
ax.scatter(leds[:, 3], leds[:, 4], leds[:, 5], c='b', s=10, marker='.')
15+
16+
try:
17+
fire = pd.read_csv('experiment_structure.csv', usecols=lambda x: x.upper() in ['FIRE']).values.tolist()
18+
cameras = pd.read_csv('experiment_structure.csv',
19+
usecols=lambda x: x.upper() in ['CAM1', 'CAM2']).values.tolist()
20+
corners = pd.read_csv('experiment_structure.csv',
21+
usecols=lambda x: x.upper() in ['CORNER1', 'CORNER2', 'CORNER3', 'CORNER4', 'CORNER5',
22+
'CORNER6', 'CORNER7', 'CORNER8']).values.tolist()
23+
ax.scatter(fire[0], fire[1], fire[2], s=150, c='r', marker='^')
24+
ax.scatter(cameras[0][0], cameras[1][0], cameras[2][0], s=300, c='k', marker='$Cam1$')
25+
ax.scatter(cameras[0][1], cameras[1][1], cameras[2][1], s=300, c='k', marker='$Cam2$')
26+
ax.scatter(corners[0], corners[1], corners[2], s=40, c='k', marker='+')
27+
except IOError:
28+
print('experiment_structure.csv not found.')
29+
print('Camera position, fire and corners are not plotted.')
30+
ax.set_xbound(0, 10)
31+
ax.set_ybound(0, 10)
32+
ax.set_zbound(0, 4)
2533

2634
plt.show()
2735

0 commit comments

Comments
 (0)