-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix: #6 * Add: Documentation on the how frame translation is happening v0.1.10
- Loading branch information
Showing
8 changed files
with
111 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Frame Translation | ||
$\text{transform}(\text{current\_camera\_frame}, \text{return\_all\_frames}=\text{False})$ | ||
|
||
## Transformation Matrix definition: | ||
1. $T_{\text{c}}^{\text{ros}}$ — Transformation matrix from the camera frame to the ROS frame. (A constant) | ||
2. $T_{\text{E}}^{\text{c}_k}$ — Transformation matrix of the current camera frame. | ||
3. $T_{\text{E}}^{\text{c}_0}$ = Transformation matrix of the initial camera frame with respect to the Earth frame. | ||
|
||
|
||
## Transformation Calculations: | ||
1. $T_{\text{c}_k}^{\text{c}_0} = T^{\text{E}}_{\text{c}_0} \cdot T_{\text{E}}^{\text{c}_k}$ — Transformation matrix from the initial frame to the current camera frame. | ||
2. $T^{\text{c}_k}_{\text{ros}_0} = T^{\text{c}}_{\text{ros}} \cdot T^{\text{c}_k}_{\text{c}_0}$ — Combined transformation matrix from the ROS frame to the current camera frame. | ||
3. $T^{\text{ros}_k}_{\text{ros}_0} = T^{\text{c}_k}_{\text{ros}_0} \cdot T_{\text{c}}^{\text{ros}}$ — Final transformation matrix from the ROS frame to the transformed current frame. | ||
|
||
|
||
## APIs and implementation : | ||
|
||
[APIs](frame_handler.md#t265.FrameHandler.FrameHandler.transform) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,30 @@ | ||
# Tracking class APIs | ||
|
||
## T265 Frame | ||
### T265 Body frame | ||
The default frame T265 returns. | ||
|
||
Z pointing the opposite of the camera. | ||
|
||
Y | ||
| / Z | ||
| / | ||
| / | ||
X______|/ | ||
|
||
### ROS frame | ||
The default frame T265 returns if you use ros package. | ||
|
||
Y pointing out of the camera. VR convention. | ||
|
||
Z | ||
| | ||
| | ||
|______ X | ||
/ | ||
/ | ||
Y | ||
|
||
|
||
## APIs | ||
::: t265.Tracking.Tracking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,32 @@ | ||
from t265 import Tracking | ||
import time | ||
import numpy as np | ||
|
||
if __name__ == "__main__": | ||
""" | ||
Example of using the Tracking class | ||
prints the pose, velocity and acceleration every second in ros frame | ||
""" | ||
track = Tracking() | ||
|
||
# define a custom frane | ||
c_T_b = np.linalg.inv(np.array([ | ||
[1, 0, 0, 0], | ||
[0, 0, 1, 0.1515], | ||
[0, -1, 0, 0.038], | ||
[0, 0, 0, 1]])) | ||
# Add the custom frame | ||
track.add_custom_frames('body', T=c_T_b) | ||
while True: | ||
track.update_pose(wait=True) | ||
pos = track.get_translation('ros') | ||
pos = track.get_translation() # get all 6d pose | ||
print(f"Camera_sn: {track.get_camera_sn()}") | ||
print(f'pos: {pos[0:3]}') | ||
print(f"T: {track.get_matrix('ros')}") | ||
print(f"euler {track.get_translation('ros', trans=False, rotation='zyx', degrees=True)}") | ||
print("Velocity: {}".format(track.get_velocity('ros'))) | ||
print("Acceleration: {}\n".format(track.get_acceleration())) | ||
time.sleep(1) | ||
print(f"T: {track.get_matrix('ros')}") # get matrix in ros frame | ||
# Get the translation in the body frame | ||
print(f"euler {track.get_translation('body', trans=False, rotation='XYZ', degrees=True)}") | ||
print(f"default {track.get_translation(trans=False, rotation='XYZ', degrees=True)}") | ||
|
||
# print("Velocity: {}".format(track.get_velocity('ros'))) | ||
# print("Acceleration: {}\n".format(track.get_acceleration())) | ||
time.sleep(1) |