Hello fellow Nimions,
I would like to announce the the robotics in nim initiative or as I have dubbed it nimbotics. Nim feels like a natural fit to be used in the realm of robotics as it is a fast language that allows for quick processing like C and C++ which are currently the dominate languages in robotics while also being expressive and more elegant than python which is another popular language in the field of robotics. That combined with the macro system which can allow libraries to make a simple and clear interface to produce most of the code for you. Now that we are passed the nim sales pitch for convincing the people in robotics
Currently there are a few projects I have seen a few projects in nim that deal with robotics here and there, but there is no complete or unified effort in this area and so it does not get much recognition. In order to rectify that I am putting this initiative here and also creating a github organization for this to collect the libraries all in one area. So now the question is what needs to be done to improve robotics in nim. The biggest thing that can be done would be the development of a few simple libraries that would allow nim to at least be introduced into the larger robotics community. The first library would be a library for interfacing with ROS akin to the rospy library in python and in order to do this we are actually missing a key library to get it to work which would probably be useful in other areas of nim would be an xml-rpc library. For both of these there are already existing C or C++ libraries for them that could be wrapped but it may be better to create them in pure nim that way we don't have to worry about dependencies for people that want to use these libraries as well as further optimizations that could be done such as potentially using CPS in the future for the asynchronous functions.
Currently I have added a few libraries of my own to the nimbotics organization on github the first being ModernRobotics which is a rewrite of a python library and NimboticsExperimental which is a collection of test files and WIP libaries that after fleshing out will hopefully become their own repositories in the future. I also have a fuzzy logic library that can be used after I work through improving the documentation.
Anyone that is interested in learning more, joining the github organization, or helping out can post a message here or reach out to me on discord where my username is InventorMatt. I'm in the normal nim channels there. Thanks for reading and I hope to see robotics grow in nim.
improvements to the opencv wrapper
this. Re-implementing algorithms already implemented in opencv would add little value and would likely represent a humongous (wasted) effort, with most likely outcome of abandoning the project half way or having a very incomplete (possibly less efficient) subset of algorithms. Instead we should leverage opencv and rely on automation as much as possible:
Algorithms can then be implemented in pure nim, but there'll be a larger ecosystem of other wrapped algorithms to support those.
Hello @inventormatt,
Thanks to use Nim to develop robotic libraries, it's great. As you say, the key of success is the compatibility with ROS. I use ROS in my work and It's the main robotic open source project and it is very popular. I read on Reddit a user that would want to make a wrapper (https://www.reddit.com/r/nim/comments/hvdehs/how_difficult_would_it_be_to_wrap_a_c_library_for/). A pure Nim version of ROS is better but takes a lot of work to develop and keep it functional with ROS evolves. Start with a very good binding with nimterop for example is may be better.
I will try your projects.
For xml-rpc, I'd recommend going native Nim and starting with copying the rpc macros in nim-json-rpc. It'll require a lot less code and results in a much more useable rpc with automatic type conversion and all. Converting the json-rpc macros to use message pack was trivial, though xml would be a bit trickier since there probably isn't a good xml serializer, but that shouldn't be too tricky depending on the serialization method (wsgl would suck).
Also doesn't ROS use a bus interface with a custom IDL? https://github.com/ros2/rosidl It seems interfacing with the idl would be trickier.
I've never used it but might be interested ROS in it for an upcoming project. Be excited to see where this goes!
Thanks for the suggestion for the creating the xml-rpc library. I'll have to dig into that library.
as for the custom IDL that is for ROS 2 while ROS 1would need the xml-rpc. they'll both need to be wrapped at some point. ROS 1 is still huge with tons of stuff for it while ROS 2 is new and is likely to eventually surpass ROS 1