diff --git a/mission_control/navigator_launch/launch/hardware/pneumatic_actuators.launch b/mission_control/navigator_launch/launch/hardware/pneumatic_actuators.launch index ce1ab25d..3e3acf11 100644 --- a/mission_control/navigator_launch/launch/hardware/pneumatic_actuators.launch +++ b/mission_control/navigator_launch/launch/hardware/pneumatic_actuators.launch @@ -1,6 +1,45 @@ - + + + # ONLY BL has been verfied on navigator, others are not currently connected + BL_unlock: 1 + BL_extend: 3 + BL_retract: 2 + + # TODO: fix once it is all plugged in + #FL_unlock: 5 + #FL_extend: 6 + #FL_retract: 7 + #FR_unlock: 8 + #FR_extend: 9 + #FR_retract: 10 + #BR_unlock: 11 + #BR_extend: 12 + #BR_retract: 12 + + # TODO: valves for ball launcher + LAUNCHER_RELOAD: + type: set + ports: + open_port: + id: 4 + default: False + close_port: + id: 5 + default: False + + LAUNCHER_FIRE: + type: pulse + pulse_time: 0.5 + ports: + open_port: + id: 7 + default: False + + + + # ONLY BL has been verfied on navigator, others are not currently connected BL_unlock: 1 diff --git a/mission_control/navigator_missions/navigator_missions/navigator.py b/mission_control/navigator_missions/navigator_missions/navigator.py index 03539354..9989b111 100644 --- a/mission_control/navigator_missions/navigator_missions/navigator.py +++ b/mission_control/navigator_missions/navigator_missions/navigator.py @@ -111,6 +111,7 @@ def enu_odom_set(odom): try: cls._actuator_client = cls.nh.get_service_client('/actuator_driver/actuate', SetValve) + cls._actuator_client2 = cls.nh.get_service_client('/actuator_driver2/actuate', SetValve) cls._database_query = cls.nh.get_service_client('/database/requests', ObjectDBQuery) cls._camera_database_query = cls.nh.get_service_client( '/camera_database/requests', navigator_srvs.CameraDBQuery) @@ -202,41 +203,43 @@ def deploy_thruster(self, name): ''' Execute sequence to deploy one thruster ''' + board = 2 if name in ['BL', 'BR'] else 1 extend = name + '_extend' retract = name + '_retract' unlock = name + '_unlock' # Pull thruster up a bit to remove pressure from lock - yield self.set_valve(retract, True) + yield self.set_valve(retract, True, board=board) yield self.nh.sleep(self._actuator_timing['deploy_loosen_time']) # Stop pulling thruster up and unlock - yield self.set_valve(retract, False) - yield self.set_valve(unlock, True) + yield self.set_valve(retract, False, board=board) + yield self.set_valve(unlock, True, board=board) # Beging extending piston to push thruster down - yield self.set_valve(extend, True) + yield self.set_valve(extend, True, board=board) yield self.nh.sleep(self._actuator_timing['deploy_wait_time']) # Lock and stop extending after waiting a time for lock to engage - yield self.set_valve(unlock, False) + yield self.set_valve(unlock, False, board=board) yield self.nh.sleep(self._actuator_timing['deploy_lock_time']) - yield self.set_valve(extend, False) + yield self.set_valve(extend, False, board=board) @util.cancellableInlineCallbacks def retract_thruster(self, name): ''' Execute sequence to retract one thruster ''' + board = 2 if name in ['BL', 'BR'] else 1 retract = name + '_retract' unlock = name + '_unlock' # Unlock and begin pulling thruster up - yield self.set_valve(unlock, True) - yield self.set_valve(retract, True) + yield self.set_valve(unlock, True, board=board) + yield self.set_valve(retract, True, board=board) # Wait time for piston to fully retract yield self.nh.sleep(self._actuator_timing['retract_wait_time']) # Lock thruster in place - yield self.set_valve(unlock, False) + yield self.set_valve(unlock, False, board=board) # Wait some time for lock to engage yield self.nh.sleep(self._actuator_timing['retract_lock_time']) # Stop pulling up - yield self.set_valve(retract, False) + yield self.set_valve(retract, False, board=board) def deploy_thrusters(self): ''' @@ -273,9 +276,12 @@ def fire_launcher(self): yield self.nh.sleep(0.5) self.launcher_state = "inactive" - def set_valve(self, name, state): + def set_valve(self, name, state, board=1): req = SetValveRequest(actuator=name, opened=state) - return self._actuator_client(req) + if board == 2: + return self._actuator_client2(req) + else: + return self._actuator_client(req) @util.cancellableInlineCallbacks def get_sorted_objects(self, name, n=-1, throw=True, **kwargs):