The Pixhawk 4 hasn’t been supported until very recently, so there isn’t a stable release for it. To use it with ArduSub you’ll need to use the Development release (ArduSub 4.2) or the Bar30 won’t work, as covered in this thread:
Leak Detector + Bar30 Firmware Pixhawk4