33from pathlib import Path
44from typing import List , Optional
55
6- from mir_driver . mir_driver import MiR_Base
6+ from mir_interface . mir_interface import MiR_Base
77from typing_extensions import Annotated
88from madsci .common .ownership import get_current_ownership_info
99from madsci .common .types .node_types import RestNodeConfig
@@ -16,7 +16,7 @@ class MIRConfig(RestNodeConfig):
1616 mir_host : str = "mirbase2.cels.anl.gov"
1717 map_name : str = "RPL"
1818
19- class MIRNode :
19+ class MIRNode ( RestNode ) :
2020 """A node to control the mobile MIR Base"""
2121
2222 config : MIRConfig = MIRConfig ()
@@ -25,6 +25,7 @@ def startup_handler(self):
2525 """MIR startup handler."""
2626
2727 self .mir = MiR_Base (mir_ip = self .config .mir_host , map_name = self .config .map_name )
28+ self .mir .create_position_dict ()
2829 print ("MIR Base online" )
2930
3031 def status_handler (self ):
@@ -39,7 +40,8 @@ def status_handler(self):
3940 error = "Executing current mission, can still accept more missions."
4041 elif len (self .node_status .running_actions ) == 0 :
4142 self .node_status .busy = False
42-
43+ def state_handler (self ):
44+ return self .mir .get_state ()
4345
4446
4547 @action
@@ -51,7 +53,7 @@ def move(
5153 ) -> None :
5254 """Sends a move command to the MIR Base"""
5355 self .mir .move (
54- location_name = target_location .representation ,
56+ location_name = target_location .representation [ "location_name" ] ,
5557 )
5658
5759
@@ -64,7 +66,7 @@ def dock(self,
6466 ) -> None :
6567 """Sends a docking command to the MIR Base"""
6668 self .mir .dock (
67- location_name = target_location .representation ,
69+ location_name = target_location .representation [ "location_name" ] ,
6870 )
6971 self .mir .wait_until_finished ()
7072
@@ -105,4 +107,4 @@ def add_wait(
105107
106108if __name__ == "__main__" :
107109 MIR_node = MIRNode ()
108- MIR_node .start_node
110+ MIR_node .start_node ()
0 commit comments