Skip to content

Commit d435b29

Browse files
committed
add sequences documentation
1 parent db0603f commit d435b29

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ TiPlot is an open-source visualisation tool for flight logs. With TiPlot, you ca
2828
- 3D viewer for displaying the paths of your UAVs.
2929
- Add multiple UAVs to compare flights.
3030
- Sync the 3D view with a specific timestamp by hovering over it.
31+
- Perform customized operations on data currently being processed.
3132
- Ability to send a data dictionary and entities to be displayed in the 3D view over TCP port `5555` from a Python script or a Jupyter notebook.
3233
- Layouts are automatically saved after every change.
3334
- Drag and drop plots to reposition them.
@@ -41,7 +42,7 @@ TiPlot is an open-source visualisation tool for flight logs. With TiPlot, you ca
4142

4243
### Prebuilt AppImage
4344

44-
To install TiPlot using the prebuilt AppImage, follow these steps:
45+
To run TiPlot using the prebuilt AppImage, follow these steps:
4546

4647
1. Download the latest AppImage from the [releases page](https://github.com/tilak-io/tiplot/releases/latest).
4748
2. Make the AppImage executable by running:
@@ -116,6 +117,43 @@ Note that `datadict` is the data dictionary returned by the parser.
116117

117118
For more info check out the Jupyter notebooks in the [templates](https://github.com/tilak-io/tiplot/blob/main/templates) folder.
118119

120+
## Running Sequences and Custom Operations
121+
122+
In this guide, we will walk you through the process of creating and executing sequences, which are Python functions containing a set of operations to manipulate log data. These sequences can be customized to suit your specific needs. Follow these steps to get started:
123+
124+
1. **Set Preferred Editor**: Ensure that you have configured your preferred code editor in the tool settings by navigating to `Tools > Settings > General > External Editor`. If you intend to use a terminal-based editor such as Vim or Nano, make sure to specify the appropriate command to launch the terminal. (i.e: `kitty nvim` for kitty, `gnome-terminal -- nvim` for ubuntu's default terminal, `xterm -e nvim` for xterm...)
125+
126+
2. **Create a New Sequence**: To begin, create a new sequence by navigating to `Tools > Sequences > Add New Sequence`.
127+
128+
3. **Provide a Descriptive Name**: Give your sequence a meaningful and descriptive name that reflects its purpose.
129+
130+
4. **Edit the Sequence**: Upon creating a new sequence, your preferred code editor will open with a template function. You can now define the operations you want to perform on the log data.
131+
132+
Here's an example of a sequence that transforms log data from the NED (North-East-Down) representation to the ENU (East-North-Up) representation for a topic called `vehicle_local_position_enu`:
133+
134+
```python
135+
def handle_data(datadict):
136+
import numpy as np
137+
new = datadict
138+
# Coordinate transformation matrix from NED to ENU
139+
NED_to_ENU = np.array([
140+
[0, 1, 0], # East (ENU X) corresponds to North (NED Y)
141+
[1, 0, 0], # North (ENU Y) corresponds to East (NED X)
142+
[0, 0, -1] # Up (ENU Z) corresponds to -Down (NED Z)
143+
])
144+
# Apply the coordinate transformation to the 'x', 'y', and 'z' columns
145+
new['vehicle_local_position_enu'] = new['vehicle_local_position'].copy()
146+
xyz_ned = new['vehicle_local_position_enu'][['x', 'y', 'z']].values
147+
xyz_enu = np.dot(xyz_ned, NED_to_ENU.T) # Transpose the transformation matrix for NED to ENU
148+
new['vehicle_local_position_enu'][['x', 'y', 'z']] = xyz_enu
149+
return new
150+
```
151+
152+
***NOTE: the imports should be inside the function***
153+
154+
Feel free to adapt and customize your sequence function to perform the operations that are relevant to your data processing needs.
155+
156+
Happy sequencing 🎉!
119157

120158
## Contributing
121159
We welcome contributions to TiPlot. If you would like to contribute, please follow these steps:

0 commit comments

Comments
 (0)