Skip to content

Commit e796f12

Browse files
committed
added validate description
1 parent 59e10eb commit e796f12

2 files changed

Lines changed: 61 additions & 30 deletions

File tree

README.md

Lines changed: 59 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@ Prerequisites:
1313
- [Python 3.x](https://www.python.org/downloads/)
1414
- [Pip](https://pypi.org/project/pip/)
1515

16-
Each script has its own requirements.txt wich permits the installation of the required packages
16+
Each script has its own requirements.txt which permits the installation of the required packages
1717
## Normal Order of operation
1818
Follow this flow chart in order to find which script to run depending on your need:
1919
![](img/calibration_flow.png)<br />
2020
## ExtractRawData
21-
Requires the [TestBench-Arduino](https://swarmus.github.io/SwarmUS-doc/) code to be installed on the test-bench's Arduino in order to be interfaced.
2221
This script enables the user to extract the raw DW1000 data from the HiveBoard/BeeBoards assembly. The test-bench will turn by a chosen stepping angle and acquire the desired amount of raw data per step.
2322
#### Hardware setup
2423
- Place a BeeBoards assembly in the middle of the test-bench. The 0deg axis of the assembly needs to point in a parallel fashion to the mounted laser pointer.
25-
- The BeeBoards have to be connected to a HiveBoard mounted to the test-bench using the same cable and ports as labeled on the assembly. If the cables and assembly are note indicated be sure to note wich BeeBoards are used, plugged with wich cables and in wich channel on wich HiveBoard. The calibration will only be valid for this configuration and has to be completly re-performed if any of this component is changed or plugged differently.
24+
- The BeeBoards have to be connected to a HiveBoard mounted to the test-bench using the same cable and ports as labeled on the assembly. If the cables and assembly are not indicated be sure to note which BeeBoards are used, plugged with which cables and in which channel on which HiveBoard. The calibration will only be valid for this configuration and has to be completly re-performed if any of this component is changed or plugged differently.
2625
- Connect power and communication interface to the HiveBoard.
2726
- Connect a usb cable to the Arduino.
28-
- Connect power to the drive submodule (red = 12&nbsp;V, black = ground)
27+
- Connect power to the drive submodule (red = 12&nbsp;V, white = ground)
2928
- To align the receiver with the emmiter, use the laser pointer. Each laser should point to the alignment target of the other laser assembly. This position ensures a 0 degree relative orientation between the two radio setup.
3029
- The laser mount should be calibrated periodicly to ensure its position and accuracy,
3130
#### Runnning the script
3231
The script can be run from the following file (**insert file path**)
32+
Requires the [TestBench-Arduino](https://swarmus.github.io/SwarmUS-doc/) code to be installed on the test-bench's Arduino in order to be interfaced.
3333

3434
#### Adjustable parameters
35-
`USE_ETHERNET` : If true, the communication with the Hiveboard will be done from the Ethernet port. If false, the UART interface will be used, and the following line must be edited to match the port on wich the Hiveboard is connected.
35+
`USE_ETHERNET` : If `True`, the communication with the Hiveboard will be done from the Ethernet port. If `False`, the UART interface will be used, and the following line must be edited to match the port on which the Hiveboard is connected.
3636
```python
3737
hb_stream = UsbStream('COM16')
3838
```
@@ -44,27 +44,28 @@ testbench = TurningStation('COM15', 115200)
4444
`stepSize` : number of encoder ticks between each acquisition position.<br />
4545
`num_frames` : number of raw data frames to be acquisitioned at each position.<br />
4646
`destination` : ending position of the acquisition. The used encoder has 2048 tick per turn, 2050 should represent a single complete turn.<br />
47-
The data extracted will be saved upon completion of the acquisition once the destination has been reached. The saved data is found in the `/src/data` folder. Each CSV is timestamped and named using the `name` variable
48-
49-
Once these parameters have been adjusted, the file can be run. The *TurningStation* should turn the amount entered in `step` and than stop for 3-5 seconds for the acquisition period before starting to turn again, repeting this cycle until `destination` has been reached
47+
The data extracted will be saved upon completion of the acquisition once the destination has been reached. The saved data is found in the `/src/data` folder. Each CSV is timestamped and named using the `name` variable.
5048

49+
Once these parameters have been adjusted, the file can be run. The *TurningStation* should turn the amount entered in `step` and then stop for 3-5 seconds for the acquisition period before starting to turn again, repeting this cycle until `destination` has been reached. A complete turn takes usually around 15 minutes.
5150

51+
#### Note
52+
Communication with the HiveBoard is done using the pheromones submodule. If communication problem occur, ensure that the version used by the script is the same as on the HiveBoard.
5253
## Parser
5354
Parses and presents the PDOA values from the previously acquired raw data (from control). The user will be prompted 2 clickable interfaces to firstly offset the data to a common reference and secondly to extract the slopes of each antenna pair.
5455
#### Runnning the script
5556
The script can be run from the following file (**insert file path**)
5657
#### Adjustable parameters
57-
`dataFolderPath` : folder path where the extracted raw data CSV has been save.<br />
58+
`dataFolderPath` : folder path where the extracted raw data CSV produced by [ExtractRawData](#pxtractRawData) has been save.<br />
5859
`dataName` : name of the file to parse the data from.<br />
5960
`usedPairs` : the antenna pairs to be used. Encoded as follow :<br />
60-
pair 0 = antenna 0 - antenna 1<br />
61-
pair 1 = antenna 0 - antenna 2<br />
62-
pair 2 = antenna 1 - antenna 0<br />
63-
....<br />
64-
pair 5 = antenna 2 - antenna 1<br />
65-
`EXPORT_PDOA` : True will prompt the second set of plots (slopes extraction) and save the calibration result in a **pickle** format
66-
#### Behavioral descrition and user interaction
67-
Upon runnning the script, the first plot to appear will ask the user to select points from wich to offset the whole dataset. The first plot represents a sin, the points selected should then be the very bottom of a sin *parabola* section. Also, to obtain a better estimation of the offset needed, it is possible to select the very bottom of the *parabola*, and a top of this *parabola* that has wrapped over. Many points can be selected, the mean of the *y axis* will be used as the offset. If the sin is not wrapping, no points need to be selected, as no offset needs to be applied. This process has to be repeted for the number of `usedPairs` selected. Here is an exemple of the process.<br />
61+
<pre><code> pair 0 = antenna 0 - antenna 1<br />
62+
pair 1 = antenna 0 - antenna 2<br />
63+
pair 2 = antenna 1 - antenna 0<br />
64+
....<br />
65+
pair 5 = antenna 2 - antenna 1<br /></code></pre>
66+
`EXPORT_PDOA` : `True` will prompt the second set of plots (slopes extraction) and save the calibration result in a **pickle** format.
67+
#### Behavioral descriptionand user interaction
68+
Upon runnning the script, the first plot to appear will ask the user to select points from which to offset the whole dataset. Theoretically, the plot should represent a **sin** wave, the offset in this section will prevent the signal from wrapping over 2&pi;and under 0. If the **sin** is not wrapping, no points need to be selected, as no offset needs to be applied, simply close the plot.The points selected should then be the very bottom of a **sin** *parabola* section. Also, to obtain a better estimation of the offset needed, it is possible to select the very bottom of the *parabola*, and a top of this *parabola* that has wrapped over. Many points can be selected, the mean of the *y axis* will be used as the offset. This process has to be repeted for the number of `usedPairs` selected. Here is an exemple of the process.<br />
6869
![](img/ex_offset.png)<br />
6970
A plot of the result will then appear. If all curves are not wrapping, the first step is succesful. Otherwise, the script must be re-run and better points must be selected until all curves do not wrap. <br />
7071

@@ -74,47 +75,76 @@ The saved data will appear in the `dataFolderPath/angleParameters`. Each antenna
7475
A validation of these files can be done using the `testRead` function from the `Exporter` class.<br />
7576

7677
## Send_parameters
77-
Communicates to the Hiveboard the slope and caracteristics of the
78-
antenna pairs. Uses the pickle files created by [Parser](#parser). These files need to be placed in the calibration folder using the `hb_{HIVEBOARD_ID}` notation.<br />
78+
Communicates to the Hiveboard the slope and caracteristics of the antenna pairs. Uses the pickle files created by [Parser](#parser). These files need to be placed in the calibration folder using the `hb_{HIVEBOARD_ID}` notation.<br />
7979
#### Runnning the script
8080
The script can be run from the following file (**insert file path**)
8181
#### Adjustable parameters
8282
`HIVEBOARD_ID` : the identification number of the Hiveboard. Can be found either in the flash memory or written on the RJ45 connector. <br />
83-
`MOUNT_ORIENTATION_OFFSET` : the rotation offest, in degrees, applied to the Beeboard assembly between the Test-bench setup at wich the calibration was made, and the orientation on the robot or final installation.<br />
84-
`USE_ETHERNET` : If true, the communication with the Hiveboard will be done from the Ethernet port. If false, the UART interface will be used, and the following line must be adjusted to match the port on wich the Hiveboard is connected.
83+
`MOUNT_ORIENTATION_OFFSET` : the rotation offest, in degrees, applied to the Beeboard assembly between the Test-bench setup at which the calibration was made, and the orientation on the robot or final installation.<br />
84+
`USE_ETHERNET` : If true, the communication with the Hiveboard will be done from the Ethernet port. If false, the UART interface will be used, and the following line must be adjusted to match the port on which the Hiveboard is connected.
8585
```python
8686
hb_stream = UsbStream('COM16')
8787
```
88-
#### Behavioral descrition
88+
#### Behavioral description
8989
When the script is ran, the parameters in the calibration folder will be sent to the connected Hiveboard and saved in the flash memory. Thus, there is no need to re-send the parameters on every boot cycle. The calibration should be performed occasionally to ensure the system reliability.
9090

91+
#### Note
9192
Communication with the HiveBoard is done using the pheromones submodule. If communication problem occur, ensure that the version used by the script is the same as on the HiveBoard.
9293
## Visualisation
93-
When a calibration has been completly transfered to the correspondant Hiveboard, this tool can be used to manually and visually confirm the effectivness of the calibration. Using a emmiter, the user can move around the calibrated Hiveboard and see a marker representing the emmiter move around.
94+
When a calibration has been completly transfered to the correspondant Hiveboard, this tool can be used to manually and visually confirm the effectiveness of the calibration. Using a emmiter, the user can move around the calibrated Hiveboard/BeeBoards assembly and see a marker representing the emmiter move around.
9495

9596
To use the tool, you will need one stationary HiveBoard with its BeeBoards and at least one mobile
9697
HiveBoard/BeeBoard assembly.
9798

98-
The stationary BeeBoard must be powered by the barrel connector (**not** by USB). Plug the Micro-USB cable to your
99+
The stationary HiveBoard must be powered by the barrel connector (**not** by USB). Plug the Micro-USB cable to your
99100
computer for the serial connection.
100101

101-
Next, start the mobile HiveBoard/BeeBoard assemblies.
102+
Next, start the mobile HiveBoard/BeeBoards assembly.
102103

103104
To start the tool, start the `main.py` file under `src/visualisation_tool`. By default, the visualisation tool will
104105
use the com port `/dev/ttyACM0`. To edit this value, edit the `COM_PORT` variable in `DataUpdater.py`.
105106

106107
The visualisation tool will open a window with an orange dot at the center, representing the stationary HiveBoard. The
107-
mobile HiveBoards will show as coloured circles and their position will be updated at regular intervals. Specific
108+
mobile HiveBoard assemblies will show as coloured circles and their position will be updated at regular intervals. Specific
108109
neighbors can be hidden by unchecking the 'visible' check box in the table underneath the graph.
109110

110111
![](img/visualisation_tool.png)
111112

113+
#### Note
112114
Communication with the HiveBoard is done using the pheromones submodule. If communication problem occur, ensure that the version used by the script is the same as on the HiveBoard.
113115
## Validate
114-
This is a method to test the whole angles system of the interlocalisation. Using the exact same hardware setup as the calibration it is possible to extract the angle value result from the whole acquisition, linearisation and certitude algorithm.
116+
This is a method to test the whole angles system of the interlocalisation. Using the exact same hardware setup as the calibration it is possible to extract the angle value result from the whole acquisition, linearisation and certitude algorithm. Using the test-bench assembly will automate this procedure.
115117
#### Runnning the script
116-
The script can be run from the following file (**insert file path**)
118+
The script can be run from the following file (**insert file path**)<br />
119+
Requires the [TestBench-Arduino](https://swarmus.github.io/SwarmUS-doc/) code to be installed on the test-bench's Arduino in order to be interfaced.
120+
#### Hardware setup
121+
Refer to the [ExtractRawData](#extractRawData) hardware setup section for the protocol to ensure precise data acquisition.
117122
#### Adjustable parameters
118-
#### Behavioral descrition
123+
`REMOTE_HB_ID`: ID of the emmiter used for the validation. As many HiveBoard can be detected, the scripts filters only the one needed by the user.<br />
124+
`NUM_DATA_POINTS_PER_ANGLE`:number of cycles to do at each angle position. Each cycles output a single angle value.<br />
125+
`USE_ETHERNET` : If `True`, the communication with the Hiveboard will be done from the Ethernet port. If `False`, the UART interface will be used, and the following line must be edited to match the port on which the Hiveboard is connected.
126+
```python
127+
hb_stream = UsbStream('/dev/ttyACM0')
128+
```
129+
The Arduino communicates through UART and the following line must be edited:
130+
```python
131+
testbench = TurningStation('/dev/ttyACM1', 115200)
132+
```
133+
`stepSize` : number of encoder ticks between each acquisition position.<br />
134+
`destination` : ending position of the acquisition. The used encoder has 2048 tick per turn, 2050 should represent a single complete turn.<br />
135+
The data extracted will be saved upon completion of the acquisition once the destination has been reached.
136+
137+
#### Behavioral description
138+
Similarly to [ExtractRawData](#extractRawData), the *TurningStation* will turn by the `stepSize` incrementation until it reaches the `destination` encoder tick. At each increment, the interlocalisation is enabled and produces `NUM_DATA_POINTS_PER_ANGLE` angles. These values are the one that would be propagated in the system in a typical use case. For a complete description of the process behind these values, please refer to [link to la doc a charles sur l'interloc].
139+
119140
#### Results
141+
The saved data is found in the `/src/data` folder. Each CSV is timestamped and named using the "validation_" prefix. For a visual analysis of the data, 3 plots have already been created. Running `src/analysis/analyze_interloc_validation` will produce:
142+
- A representation of the acquired angles for each position.
143+
- The error between the calculated angle and the actual orientation of the emmiter.
144+
- The standard deviation of the angles calculated at each position.
145+
To select which file to analyze, edit :
146+
```python
147+
analyze_validation("../data/validation_hb6.csv")
148+
```
149+
#### Note
120150
Communication with the HiveBoard is done using the pheromones submodule. If communication problem occur, ensure that the version used by the script is the same as on the HiveBoard.

src/validate_interloc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
testbench.resetPosition()
3838

3939
stepSize = 20
40-
for ticks in tqdm(range(0, 2060, stepSize)):
40+
destination = 2060
41+
for ticks in tqdm(range(0, destination, stepSize)):
4142
hb.enable_interloc_dumps(True)
4243
hb.set_interloc_state(OPERATING)
4344

0 commit comments

Comments
 (0)