To date, an official ROS package for the GoPro Hero does not exist, and I plan for this package (https://github.com/Seanmatthews/gopro_hero) to remedy that. Currently only tested with the GoPro Hero 4 Black, the nodes within allow:
* Access to camera settings
* Taking and retrieving still images (including multishot)
* Continuous live stream frame retrieval
We plan to attach the GoPro Hero 4 Black camera to the sub's external housing. A WiFi dongle (separate from the sub's router), plugged into the sub's vision computer, connects to the GoPro's network. That computer accesses the GoPro's stream for logging and processing. The network configuration here seems (and is) somewhat complex, but the GoPro requires that it is the LAN provider that allows devices to connect to it for control and streaming. Briefly, we considered bridging the primary sub network to the GoPro's network to avoid an additional network and network device, but the GoPro's network is fairly unstable and we don't want the sub relying on it in any capacity.
The GoPro Hero 4's live stream comes from a UDP stream (udp://10.5.5.9:8554). Any connection must command the GoPro to restart the stream after it connects, and then send stay alive messages every 2 to 2.5 seconds. A similar effect may be achieved by sending the stream restart command at the same interval, but this method produces a video blip on each restart command.
The package is written as a collection of C++ nodes because 1) I'm more comfortable with the language, and 2) I initially investigated using ffmpeg to grab still frame images from the GoPro's UDP stream (though that proved troublesome), with the expectation that it could be tuned for minimal latency. While I still plan to explore this avenue, it turns out that OpenCV's VideoCapture class is perfectly capable of capturing frames from the live stream with only a small amount of latency.
During development, I drew on a number of sources that paved the way for this node. Some even implemented their own GoPro control programs and APIs. Should you opt to write your own GoPro control program, here they are: