Cleanup resources and disconnect from robot.
(self)
| 128 | self.cleanup() |
| 129 | |
| 130 | def cleanup(self) -> None: |
| 131 | """Cleanup resources and disconnect from robot.""" |
| 132 | print("🧹 Cleaning up robot controller...") |
| 133 | self.stop_control_loop() |
| 134 | |
| 135 | if ( |
| 136 | hasattr(self, "piper") |
| 137 | and self.piper is not None |
| 138 | and self.piper.get_connect_status() |
| 139 | ): |
| 140 | if self.is_robot_enabled(): |
| 141 | self.graceful_stop() # this will disable the robot as well |
| 142 | self.piper.DisconnectPort() |
| 143 | print("✓ Robot disconnected") |
| 144 | |
| 145 | print("✓ Robot controller cleanup completed") |
| 146 | |
| 147 | def is_robot_enabled(self) -> bool: |
| 148 | """Check if robot is enabled and ready to accept commands. |
no test coverage detected