chiaki
chiaki copied to clipboard
Bindings to other Languages
What platform does your feature request apply to? Choose one or more: Desktop/Mac/Linux (I guess it would be universal)
Is your feature request related to a problem? Please describe. I want to be able to manipulate the video stream and send controller inputs via a programming language such as Python. I'm not sure how to go about this myself as I don't have knowledge coding in C or C++.
Describe the solution you'd like This solution kind of ties to the answer above.
Describe alternatives you've considered I've tried using a forked repo - peidaqi/chiaki which has a machine-learning branch. However seems that dev has a file missing called jsevent.h and I had a struggle of time trying to compile it with cmake and when I finally got to the end, it had a missing file.
Additional context If this could be implemented, would be great. Thank you.
zmq isn't needed if you only want to access the API from other languages such as Python. What you want is regular Python bindings, which can be generated by numerous methods such as swig, valabind or manually using the Python C API.
Oh right thank you, so I will be able to get the video stream etc through Python and send controller inputs?
Yes, bindings could give you access to the full C API of Chiaki which includes all of these things. But unless you have specific reasons why you would want to use Python, I can recommend you to do it directly in C. Here is a quick and dirty example of a bot I wrote using chiaki as a library: https://github.com/thestr4ng3r/tlou2-guitarbot/ and a video of what it does: https://twitter.com/thestr4ng3r/status/1281313888273862656
Oh okay, if I knew how to program well in C I would do so but unfortunately not but I guess I would need to write some sort of interface file to bind from python to c, I think this is why peidaqi did it with zeromq - https://github.com/peidaqi/chiaki/tree/machine-learning seems like a more straightforward way here but just it seems one of library files are missing. Thanks for the example though
@thestr4ng3r Hi, in terms of binding with python. Would the code work, by just having the Chiaki program running and the functions are called in python or does the setup have to be another way? thanks.
You can't simply call functions inside a running executable, you would have to use it as a library instead.