tso-sensorium 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. tso_sensorium/__init__.py +8 -0
  2. tso_sensorium/assets/instructions/bowel_retraction_phantom.yaml +76 -0
  3. tso_sensorium/assets/instructions/bowel_retraction_porcine.yaml +76 -0
  4. tso_sensorium/assets/instructions/endoscope_guidance.yaml +27 -0
  5. tso_sensorium/assets/recording_dashboard.html +1556 -0
  6. tso_sensorium/assets/storz_endoscope_calibration.yml +68 -0
  7. tso_sensorium/configuration.py +150 -0
  8. tso_sensorium/episodes/__init__.py +31 -0
  9. tso_sensorium/episodes/annotations.py +158 -0
  10. tso_sensorium/episodes/builder.py +244 -0
  11. tso_sensorium/episodes/dataset_builder.py +416 -0
  12. tso_sensorium/episodes/dataset_transforms.py +191 -0
  13. tso_sensorium/episodes/generation.py +184 -0
  14. tso_sensorium/episodes/generation_config.py +344 -0
  15. tso_sensorium/episodes/legend.py +157 -0
  16. tso_sensorium/episodes/phase_labelers.py +275 -0
  17. tso_sensorium/episodes/schema.py +240 -0
  18. tso_sensorium/episodes/table_transforms.py +362 -0
  19. tso_sensorium/export/__init__.py +11 -0
  20. tso_sensorium/export/base.py +47 -0
  21. tso_sensorium/export/csv_writer.py +59 -0
  22. tso_sensorium/export/lerobot_action_update_writer.py +966 -0
  23. tso_sensorium/export/lerobot_writer.py +218 -0
  24. tso_sensorium/processing/__init__.py +30 -0
  25. tso_sensorium/processing/alignment.py +216 -0
  26. tso_sensorium/processing/camera_transform.py +146 -0
  27. tso_sensorium/processing/frame_transforms.py +131 -0
  28. tso_sensorium/processing/image.py +45 -0
  29. tso_sensorium/processing/rectification.py +99 -0
  30. tso_sensorium/recording/__init__.py +13 -0
  31. tso_sensorium/recording/config.py +145 -0
  32. tso_sensorium/recording/core.py +255 -0
  33. tso_sensorium/recording/dashboard.py +370 -0
  34. tso_sensorium/recording/denoising_preview.py +324 -0
  35. tso_sensorium/recording/episode_files.py +77 -0
  36. tso_sensorium/recording/episode_names.py +29 -0
  37. tso_sensorium/recording/library_service.py +754 -0
  38. tso_sensorium/recording/liveness.py +60 -0
  39. tso_sensorium/recording/message_fields.py +55 -0
  40. tso_sensorium/recording/network.py +43 -0
  41. tso_sensorium/recording/playback.py +66 -0
  42. tso_sensorium/recording/ros1/__init__.py +33 -0
  43. tso_sensorium/recording/ros1/camera_transform_publisher.py +141 -0
  44. tso_sensorium/recording/ros1/liveness.py +116 -0
  45. tso_sensorium/recording/ros1/random_publisher.py +259 -0
  46. tso_sensorium/recording/ros1/record.py +210 -0
  47. tso_sensorium/recording/ros1/ros_config.py +37 -0
  48. tso_sensorium/recording/ros1/session.py +127 -0
  49. tso_sensorium/recording/ros1/video_subscriber.py +165 -0
  50. tso_sensorium/recording/ros1/web_service.py +54 -0
  51. tso_sensorium/recording/ros2/__init__.py +9 -0
  52. tso_sensorium/recording/ros2/liveness.py +118 -0
  53. tso_sensorium/recording/ros2/record.py +226 -0
  54. tso_sensorium/recording/ros2/session.py +136 -0
  55. tso_sensorium/recording/ros2/web_service.py +61 -0
  56. tso_sensorium/resources.py +34 -0
  57. tso_sensorium/scripts/__init__.py +8 -0
  58. tso_sensorium/scripts/annotate.py +55 -0
  59. tso_sensorium/scripts/generate_dataset.py +36 -0
  60. tso_sensorium/scripts/label_phases.py +33 -0
  61. tso_sensorium/scripts/mock_scene.py +60 -0
  62. tso_sensorium/scripts/mock_sensors.py +72 -0
  63. tso_sensorium/scripts/mock_sensors_ros2.py +78 -0
  64. tso_sensorium/scripts/publish_robot_camera_transform.py +120 -0
  65. tso_sensorium/scripts/record.py +67 -0
  66. tso_sensorium/scripts/record_ui.py +60 -0
  67. tso_sensorium/scripts/record_ui_ros2.py +69 -0
  68. tso_sensorium-0.1.0.dist-info/METADATA +509 -0
  69. tso_sensorium-0.1.0.dist-info/RECORD +73 -0
  70. tso_sensorium-0.1.0.dist-info/WHEEL +5 -0
  71. tso_sensorium-0.1.0.dist-info/entry_points.txt +10 -0
  72. tso_sensorium-0.1.0.dist-info/licenses/LICENSE +22 -0
  73. tso_sensorium-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,8 @@
1
+ """TSO Sensorium.
2
+
3
+ A library for sensor data recording, post-processing, and episodic dataset
4
+ creation for robot learning. Recording adapters for ROS 1 and ROS 2 live
5
+ behind optional extras; processing and export work without ROS.
6
+ """
7
+
8
+ __version__ = "0.1.0"
@@ -0,0 +1,76 @@
1
+ # Dataset metadata with the phase legend for bowel retraction
2
+ # (phantom experiments): integer labels map to a phase name and
3
+ # instruction variants; one variant is sampled per episode.
4
+ dataset_name: bowel_retraction
5
+ phase_legend:
6
+ 0:
7
+ instructions:
8
+ - Stay in place until the surgeon's tool aims at the target bowel area for your grasp. Your tool is
9
+ visible in view.
10
+ - Remain positioned until the surgeon's pointer directs to the bowel segment you need to seize.
11
+ - Keep your current spot until the surgeon's instrument targets the bowel for your grip. Your instrument
12
+ is in the frame.
13
+ - Do not move until the surgeon's tool points to the exact bowel section that you will need to grasp.
14
+ - Maintain position while watching for the surgeon's instrument to signal the desired bowel grasp
15
+ location.
16
+ - Stay put until the surgeon highlights the bowel area where your tool should grasp.
17
+ - Remain still until the surgeon's tool indicates the bowel segment ready for your grasp.
18
+ - Don't move until the surgeon's instrument selects the bowel spot for robotic gripping.
19
+ - Stay immobile until the surgeon's tool points out the segment of the bowel for your instrument's
20
+ grasp.
21
+ - Maintain your spot waiting for the surgeon to mark the bowel grasping point you need to reach.
22
+ name: wait_for_grasp_target
23
+ 1:
24
+ instructions:
25
+ - Approach the spot indicated by the surgeon's tool and open your gripper wide for the bowel grab.
26
+ - Move toward the surgeon-pointed bowel position and open your end-effector to ready the grasp.
27
+ - Navigate to the location shown by the surgeon's instrument while opening the grasper for seizing
28
+ the bowel.
29
+ - Head to the bowel area targeted by the surgeon and widen your gripper in prep for seizure.
30
+ - Go to the position the surgeon's tool is signaling and open up your clamp for the bowel.
31
+ - Shift to the surgeon-directed bowel site and prepare grasping.
32
+ - Proceed to the point marked by the surgeon's arm and open your tool for bowel grasping.
33
+ - Move into the bowel position guided by the surgeon and ready your grasper by opening it.
34
+ - Travel to the surgeon-indicated grasp spot and open your grasper for the bowel gripping.
35
+ - Direct your tool to the surgeon's pointed bowel area and open the grip wide.
36
+ name: approach_and_open
37
+ 2:
38
+ instructions:
39
+ - Clamp down on the bowel segment with your end-effector. Hold steady for surgeon's opposite grasp.
40
+ - Close the tool firmly around the bowel. Maintain position awaiting surgeon's hold on the bowel.
41
+ - Activate your grip on the bowel by closing the tool. Wait in place for surgeon's counterpart grip.
42
+ - Engage the bowel by shutting your gripper. Remain fixed until surgeon secures the far end.
43
+ - Grasp the bowel tissue via closing your clamp. Hold location as surgeon grabs opposite.
44
+ - Secure the bowel segment with a firm gripper close. Stay until surgeon's other-end seizure.
45
+ - Close your end-effector to hold the bowel. Keep position while surgeon takes the rest.
46
+ - Pinch the bowel by contracting your gripper. Await surgeon's grasp on the other portion.
47
+ - Lock onto the bowel with your closing jaws. Maintain spot for surgeon's dual hold.
48
+ - Grip the bowel tightly via gripper closure. Remain until surgeon's end is secured.
49
+ name: grasp_and_hold
50
+ 3:
51
+ instructions:
52
+ - Once surgeon grips opposite, retreat your tool carefully to straighten the bowel fully.
53
+ - 'Surgeon secured the far end: draw the bowel rearward steadily till straight and retracted.'
54
+ - After surgeon's opposite hold, move backward gently to fully extend the bowel in sight.
55
+ - 'Surgeon has the other side: retract bowel by easing back until it''s straight and pulled.'
56
+ - Pull back on gripped bowel post-surgeon's end grasp, continuing till fully straight in camera.
57
+ - 'Surgeon''s grip in place: back up your instrument to retract bowel until visually straight.'
58
+ - Once opposite end is taken, draw back carefully to fully straighten the bowel tissue.
59
+ - Retreat with bowel after surgeon's hold, moving rear until it's extended and aligned.
60
+ - Withdraw your instrument to extend bowel straight, following surgeon's opposite hold.
61
+ - With both ends grasped, withdraw to straighten the bowel in the camera frame completely.
62
+ name: retract
63
+ 4:
64
+ instructions:
65
+ - Keep your position locked with the bowel gripped tight after full retraction.
66
+ - Maintain steady hold on the retracted bowel segment in current spot.
67
+ - Stay put, gripping the straight bowel firmly without movement.
68
+ - Keep the retracted bowel grasped and your tool stationary.
69
+ - Maintain grip and position on the straightened bowel tissue.
70
+ - Stay in place with firm hold on the taut bowel segment.
71
+ - Hold steady, keeping the bowel gripped post-retraction.
72
+ - Preserve your spot and bowel grasp after alignment.
73
+ - Remain fixed, clamping the fully straight bowel.
74
+ - Stay stationary with secure bowel grip in view.
75
+ name: hold_completed
76
+ task: retract the bowel
@@ -0,0 +1,76 @@
1
+ # Dataset metadata with the phase legend for bowel retraction
2
+ # (porcine experiments): integer labels map to a phase name and
3
+ # instruction variants; one variant is sampled per episode.
4
+ dataset_name: bowel_retraction
5
+ phase_legend:
6
+ 0:
7
+ instructions:
8
+ - Hold position until the surgeon grasps the bowel segment and offers it toward your grasper. Your
9
+ robotic grasper is visible in view.
10
+ - Stay in place as you wait for the surgeon to seize the bowel and extend it for handover to your
11
+ gripper.
12
+ - Remain positioned until the surgeon picks up the bowel segment and positions it for your robotic
13
+ grasp.
14
+ - Keep your current spot until the surgeon grabs the bowel and brings it close for transfer to your
15
+ gripper.
16
+ - Maintain position while observing the surgeon grasp the bowel and prepare to hand it over to you.
17
+ - Remain still until the surgeon takes hold of the bowel and moves it into handover range.
18
+ - Keep steady until the surgeon grips the bowel segment and presents it for your grasp.
19
+ - Maintain your spot waiting for the surgeon to grab the bowel and bring it to your reach.
20
+ - Remain fixed until the surgeon secures the bowel segment and offers it to your gripper.
21
+ - Keep your position as you await the surgeon grasping the bowel for transferring it to you.
22
+ name: wait_for_grasp_target
23
+ 1:
24
+ instructions:
25
+ - Approach the surgeon's grasped bowel and open your gripper to receive and take over the hold.
26
+ - Move toward the bowel being held by the surgeon and open your grasper for gentle transfer.
27
+ - Navigate to the offered bowel segment from surgeon and open your gripper to accept the handover.
28
+ - Head to the position of the surgeon-held bowel and open your grasper in prep for receiving.
29
+ - Advance to the bowel offered by surgeon and open your grasper for seamless takeover.
30
+ - Proceed to the bowel segment in surgeon's grip and open your grasper for handover acceptance.
31
+ - Travel to the surgeon-grasped bowel and open your grasper to receive the tissue handover.
32
+ - Direct your gripper to the surgeon's held bowel and open your grasper wide for transfer.
33
+ - Approach the target bowel from surgeon's grasp and open your gripper for the hand-over.
34
+ - Move to the spot of the surgeon-offered bowel and open your grasper for gentle takeover.
35
+ name: approach_and_open
36
+ 2:
37
+ instructions:
38
+ - Close down on the bowel segment for hold. Keep position awaiting surgeon's counterpart grasp.
39
+ - Close the tool firmly around the bowel. Maintain position awaiting surgeon's hold on the bowel.
40
+ - Activate your grip on the pointed tissue by closing the tool. Wait in place for surgeon's counterpart
41
+ grip.
42
+ - Engage the bowel by shutting your gripper. Remain fixed until surgeon secures the far end.
43
+ - Grasp the bowel tissue via closing your clamp. Hold location as surgeon grabs opposite.
44
+ - Secure the bowel segment with a firm gripper close. Stay until surgeon's other-end seizure.
45
+ - Close your end-effector to hold the bowel. Keep position while surgeon takes the rest.
46
+ - Pinch the tissue by contracting your gripper. Await surgeon's grasp on the other portion.
47
+ - Lock onto the bowel with your closing jaws. Maintain spot for surgeon's dual hold.
48
+ - Grip the bowel tightly via gripper closure. Remain until surgeon's end is secured.
49
+ name: grasp_and_hold
50
+ 3:
51
+ instructions:
52
+ - Once surgeon grips opposite, retreat your tool carefully to straighten the bowel fully.
53
+ - 'Surgeon secured the far end: draw the bowel rearward steadily till straight and retracted.'
54
+ - After surgeon's opposite hold, move backward gently to fully extend the bowel in sight.
55
+ - 'Surgeon has the other side: retract bowel by easing back until it''s straight and pulled.'
56
+ - Pull back on gripped bowel post-surgeon's end grasp, continuing till fully straight in camera.
57
+ - 'Surgeon''s grip in place: back up your instrument to retract bowel until visually straight.'
58
+ - Once opposite end is taken, draw back carefully to fully straighten the bowel tissue.
59
+ - Retreat with bowel after surgeon's hold, moving rear until it's extended and aligned.
60
+ - Withdraw your instrument to extend bowel straight, following surgeon's opposite hold.
61
+ - With both ends grasped, withdraw to straighten the bowel in the camera frame completely.
62
+ name: retract
63
+ 4:
64
+ instructions:
65
+ - Keep your position locked with the bowel gripped tight after full retraction.
66
+ - Maintain steady hold on the retracted bowel segment in current spot.
67
+ - Stay put, gripping the straight bowel firmly without movement.
68
+ - Keep the retracted bowel grasped and your tool stationary.
69
+ - Maintain grip and position on the straightened bowel tissue.
70
+ - Stay in place with firm hold on the taut bowel segment.
71
+ - Hold steady, keeping the bowel gripped post-retraction.
72
+ - Preserve your spot and bowel grasp after alignment.
73
+ - Remain fixed, clamping the fully straight bowel.
74
+ - Stay stationary with secure bowel grip in view.
75
+ name: hold_completed
76
+ task: retract the bowel
@@ -0,0 +1,27 @@
1
+ dataset_name: endoscope_guidance
2
+ task: automate the movement of the endoscope
3
+ phase_legend:
4
+ 0:
5
+ name: focus
6
+ instructions:
7
+ - Zoom in toward the region between the surgical instruments.
8
+ 1:
9
+ name: overview
10
+ instructions:
11
+ - Zoom out to obtain a broad view of the operative field.
12
+ 2:
13
+ name: level_the_horizon
14
+ instructions:
15
+ - Rotate the camera until the horizon is level.
16
+ 3:
17
+ name: follow_anatomy
18
+ instructions:
19
+ - Follow the surgical instrument tip along the anatomical contour.
20
+ 4:
21
+ name: reach_tip
22
+ instructions:
23
+ - Search the scene for the tip of the surgical instrument.
24
+ 5:
25
+ name: stop
26
+ instructions:
27
+ - Do not move the camera.