Main function to run MotionDAR node with Hydra configuration
(cfg: DictConfig)
| 602 | config_path=f"../config", |
| 603 | config_name="rmdar_config") |
| 604 | def main(cfg: DictConfig) -> None: |
| 605 | """Main function to run MotionDAR node with Hydra configuration""" |
| 606 | print("Starting MotionDAR with configuration:") |
| 607 | print(f"\n{OmegaConf.to_yaml(cfg)}") |
| 608 | |
| 609 | rclpy.init() |
| 610 | node = None |
| 611 | try: |
| 612 | node = MotionDAR(cfg) |
| 613 | rclpy.spin(node) |
| 614 | except KeyboardInterrupt: |
| 615 | print("Shutting down MotionDAR...") |
| 616 | finally: |
| 617 | if node: |
| 618 | node.destroy_node() |
| 619 | # Only shutdown if it wasn't already shutdown by keyboard thread |
| 620 | if not (node and node._shutdown_event.is_set()): |
| 621 | rclpy.shutdown() |
| 622 | |
| 623 | |
| 624 | if __name__ == "__main__": |
no test coverage detected