Programming GPIO pins on Core2

Good afternoon,
We are trying to interface two USB cameras (thermal or visible) on the rover to collect image data. Currently we are connecting them to the Pi from the USB port on the top of the rover. However, for syncronisation, we need an external trigger. I think the easiest would be to acces one of the GPIO pins on hExt on the Core 2 board.
How can I program a Core2 ROS pin output from a C++ application running on the Raspberry Pi? The current documentation only tells us whats currently being used.

I tried to compile the leo_firmware but ran into problem. Also, is the Leo Rover OS source available? I only found turtle_os.

Thanks

Hi,

Just take the relay function as a default. Here’s the link: https: //github.com/szlachcic/leo_firmware_relay/releases. If you download the source code, you can see the modified main.cpp and edit with VSC. But you always have to pay attention when updating to another firmware that you have previously modified the main.cpp - because in the current relases this feature is not in there. Otherwise you only need to use the https://github.com/LeoRover/leo_ui_sample_relay as template to control the ports via HTML / JAVA

So, what we actually are working on now is to stack one tutorial changes on another. Meaning that there will be a file which will trigger different functions prepared in the firmware. But still need to be patient for that.
To program the Core2 firmware the best way is to go to Husarion website and look there: https://husarion.com/software/hframework/#gpio - may be helpful.
As @Django wrote - you need VSC to edit and flash (or just build .hex and flash externally).

Hi @saurav,

please read the Software development tutorial on the docs page and let me know if it answered your questions.

Thank you all for the replies, they have been very helpful. @Django, I followed your instructions and flashed the relay firmware and tried the UI and looks like it worked. I can see ROS messages for relay1 turn true and false based on the toggle button in the UI. But the actual pin voltage is 0v (shunted to ground). I have tried with other pins as well without any success.
Thanks

@Blazej_Sowa I just noticed your tutorial example, I am going to try it soon. Thanks,