Creating a plugin with a neural network.

Typically: "How do I... ", "How can I... " questions
Post Reply
ArthurS
Posts: 28
Joined: 25 Jul 2021, 20:00

Creating a plugin with a neural network.

Post by ArthurS »

Hello. I plan to experiment with the method of potential fields. I want to add a neural network to this algorithm.
The neural network should:
1) On the basis of experience, indicate which side to bypass the obstacle
2) Calculate the minimum path when bypassing the pripyatstvii
3) Do not allow the robot to enter dead-end places (for example, in bulges and pits)
4) Any other improvements in the future
So far I have the usual method of potential fields with lidar on a wheeled robot. And I would like to develop in drones and drones.


My question is:
How to add a neural network to Coppeliasim (it would be cool not to write it in the program code, but to take an existing one and use it as a plugin in c++)?

When solving this issue, I faced the problem of installing and writing the plugins themselves. I don't understand how to link Coppeliasim and, for example, Visual Studia. I've seen many examples of such work, but I can't find step-by-step instructions with examples of how to get started..
Along the way, tell me how to make plugins anyway and embed them into the program (maybe there are manuals or videos with analysis or examples). Until this day, I wrote everything in the program code (I have a large project), combining the Lua and Sim. language. but now I understand that it would not be wise to write everything in the code of Coppelia itself.
It would be cool if you would show a couple of examples of projects with neural networks on Coppeliasim.

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Creating a plugin with a neural network.

Post by coppelia »

Hello,

next to writing a plugin, you can also simply use Lua libraries, and include them in your code via the require instruction, e.g.:

Code: Select all

require('myLuaLibrary')
As to CoppeliaSim plugins: you can two ways of creating a CoppeliaSim plugin: the first is maybe easier to understand, but requires a bit more code to write. The second is the newer method, and generates automatic boiler-plate code, which can be a bit confusing at first. Have a look at following two CoppeliaSim plugin skeletons:
Both of above projects should compile without change. The first is a Qt project, the second is a cmake project. But both can easily be ported to a Visual Studio project. I would probably first go with method 1, since it doesn't involve too many dependencies. You'll need in your programming folder include, common, and simExtPluginSkeleton repos. The simExtPluginSkeleton repo just adds a single new Lua function: simSkeleton.getData. In a similar way, you could have your neural network functionality in a simNeural namespace.

Have also a look at all the other CoppeliaSim plugins, which can be identified via their simExt-suffix.

Cheers

ArthurS
Posts: 28
Joined: 25 Jul 2021, 20:00

Re: Creating a plugin with a neural network.

Post by ArthurS »

THX very much!

Post Reply