i am a student ,these days i intented to DIY my own ROV. but there are so many files about software.what is the relationship between these files or how can i find some useful information about this ?
@badevguru I am a postgraduate too. I have an openrov now.so I want to get the data of all the sensores and video streamer .and then I hope to store these data to verify some algorithm, for example I can apply to monocular obstacle avoidance. But I have no ideal where I should modify. I am afraid of I don’t know the openrov how to communication with the hardware , and which code is it .the source code I haven’t entirely understand .so what I have said can you understand. And would you like give me some advice to tell me how to make it. Any ideal is help! I am very appreciate for it. thank you so much.
Socket.io is basically web sockets with some additional meta data.
Using the 30.0.3 release which is the stable release:
Note: The interfaces are under active development and so some modules such a lights are in transition.
So to figure out how to turn on/off lights, I will take a look at the lights node module. Most of the functionality is in the form of plugins. The plugins have the portion that runs on the beaglebone that is in the root of the plugin folder, and the part the runs in the browser that is in the \public subfolder.
In the case of lights in the 30.0.3 release, the functionality is spread over two locations, the lights plugin and main cockpit.js file. All the light functionality is moving to the lights plugin in the next release.
I can find the lights plugin here: https://github.com/OpenROV/openrov-cockpit/tree/30.0.3/src/plugins/lights
And so the node.js module that will define the API used by the lights will be found here:
So basically, the lights has a socket.io message defined called ‘lights.set_external_lights_power’ that takes a percentage value between 0 and 1.0 to set the power of the lights. Clearly in this instance, we have a command for the external lights but what about the internal lights? That must still be in the main cockpit.js file (which you can also find by simply searching the project for ‘light’.
So the cockpit.js is here:
And its node.js module is here: https://github.com/OpenROV/openrov-cockpit/blob/30.0.3/src/cockpit.js
And looking through it I will see the API for the lights defined here:
So to control the internal lights I have to send a
And in this case value is between 0 and 1 so, just like external lights, this is a percentage between 0 and 1.0.
Hope this helps figure out how to trace the API through the source code. The next release (sitting in master, but not yet stable) refactors much of the APIs so they are all found in consistent spots in the source code.