Develop plugin for Coppelia Sim using LibPlugin
Develop plugin for Coppelia Sim using LibPlugin
Hello,
I would like to develop a plugin for coppeliaSim but I have some problems. And several github pages are pointing to the ReadMe of the libPlugin but every links are 404 errors.
The link: https://github.com/CoppeliaRobotics/sim ... /README.md
Where can we find this ReadMe file. I think that there are precious informations inside it. For example, I am not able to compile the simExtSkeletonNG using cmake.
Thanks for your help,
Best regards
I would like to develop a plugin for coppeliaSim but I have some problems. And several github pages are pointing to the ReadMe of the libPlugin but every links are 404 errors.
The link: https://github.com/CoppeliaRobotics/sim ... /README.md
Where can we find this ReadMe file. I think that there are precious informations inside it. For example, I am not able to compile the simExtSkeletonNG using cmake.
Thanks for your help,
Best regards
Re: Develop plugin for Coppelia Sim using LibPlugin
If you are having some build issue you should post the relevant output, and provide additional details about your environment, OS, etc, in order to get some help.
libPlugin is a framework used by many plugins, consisting (currently) of three parts:
libPlugin is a framework used by many plugins, consisting (currently) of three parts:
- simPlusPlus: some C++ stuff to ease the writing of a plugin by providing an object-oriented interface to some parts of the CoppeliaSim C++ API. See README for more details.
- simStubsGen: a code generator that will generate html documentation and boilerplate code to read/write arguments of Lua callbacks, given an input XML file. See README for more details.
- a cmake module for finding CoppeliaSim stuff and performing build tasks required to build plugins.
Re: Develop plugin for Coppelia Sim using LibPlugin
For example, when I try to compile simExtSkeletonNG plugin using CMake, I get the error CoppeliaSim_DIR-NOTFOUND. Then I point to the cmake file at this path: C:\Program Files\CoppeliaRobotics\CoppeliaSimEdu\programming\libPlugin\cmake.
But still, the error remains. I don't know I should put the simExtPluginSkeletonNG folder before compiling it.
To be honest, I am a little bit lost on how to compile the source code using CMake. How should I use the file FindCoppeliaSim.cmake. And also how to use these 3 folders you pointed on Libplugin. This is why I wanted to compile the example simExtPluginSkeletonNG before starting writing code.
But still, the error remains. I don't know I should put the simExtPluginSkeletonNG folder before compiling it.
To be honest, I am a little bit lost on how to compile the source code using CMake. How should I use the file FindCoppeliaSim.cmake. And also how to use these 3 folders you pointed on Libplugin. This is why I wanted to compile the example simExtPluginSkeletonNG before starting writing code.
Re: Develop plugin for Coppelia Sim using LibPlugin
If you stick with the standard layout it should build without any extra settings: just put simExtPluginSkeletonNG and libPlugin in the CoppeliaSim's programming subdirectory.
Otherwise you need to specify the
Otherwise you need to specify the
LIBPLUGIN_DIR
CMake variable and/or the COPPELIASIM_ROOT_DIR
environment variable.Re: Develop plugin for Coppelia Sim using LibPlugin
I figured out how to go further, I had to define new entries and then define manually the paths of:
- LIBPLUGIN_DIR
- COPPELIASIM_ROOT_DIR
Which compiler do you use with Cmake? Do you use visual studio or something else?
Thank you,
- LIBPLUGIN_DIR
- COPPELIASIM_ROOT_DIR
Which compiler do you use with Cmake? Do you use visual studio or something else?
Thank you,
Re: Develop plugin for Coppelia Sim using LibPlugin
When I open the created visual studio project, there is a problem with the statement #py. I think that you created the PyCPP. Is there a way to integrate it in visual studio?
Thank you,
Thank you,
Re: Develop plugin for Coppelia Sim using LibPlugin
Nope. PyCPP is a custom preprocessor, and no IDE has support for its syntax. However it is integrated in the CMake build, and it will generate the .cpp files which can be compiled by your compiler.
PyCPP tempates should not (directly) be part of the project. Which file is that?
PyCPP tempates should not (directly) be part of the project. Which file is that?
Re: Develop plugin for Coppelia Sim using LibPlugin
The file stubs.h that the project included was the one inside
Inside the plugin I changed the
To sum up everything for the next, this is what I did:
- Add the Entry
- Change the
Edit: I am coding with visual studio. Afterward I compiled the project and get the dll. It worked fine into CoppeliaSim
Thanks for your help.
libPlugin\simStubsGen\cpp
. This one is the one containing the #pi
preprocessor statement.Inside the plugin I changed the
#include "simStubsGen/cpp/stubs.h"
path to #include "generated/stubs.h"
and it solved the problem. I was able to compile the plugin with Visual Studio.To sum up everything for the next, this is what I did:
- Add the Entry
LIBPLUGIN_DIR
to the path to the libplugin before configure with Cmake- Change the
#include "simStubsGen/cpp/stubs.h"
to #include "generated/stubs.h"
into plugin.cpp after generating the project with CmakeEdit: I am coding with visual studio. Afterward I compiled the project and get the dll. It worked fine into CoppeliaSim
Thanks for your help.
Re: Develop plugin for Coppelia Sim using LibPlugin
There's no such #include in simExtPluginSkeletonNG.
simExtPluginSkeletonNG #includes "stubs.h", and since $CMAKE_BINARY_DIR/generated is added to the include path, stubs.h is found there.
Re: Develop plugin for Coppelia Sim using LibPlugin
Hello Florent,
you can always try your hands with another approach to writing a CoppeliaSim plugin, without libPlugin (it is a little bit more verbose, but maybe easier to understand). There are several examples available, e.g. simExtPluginSkeleton, simExtVision, simExtRRS1, etc.
Cheers
you can always try your hands with another approach to writing a CoppeliaSim plugin, without libPlugin (it is a little bit more verbose, but maybe easier to understand). There are several examples available, e.g. simExtPluginSkeleton, simExtVision, simExtRRS1, etc.
Cheers