Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port basestate plugin functionality from gazebo-yarp-plugins #59

Closed
xela-95 opened this issue Jan 9, 2024 · 9 comments · Fixed by #65
Closed

Port basestate plugin functionality from gazebo-yarp-plugins #59

xela-95 opened this issue Jan 9, 2024 · 9 comments · Fixed by #65
Assignees

Comments

@xela-95
Copy link
Member Author

xela-95 commented Jan 12, 2024

As this plugin share the same structure of the forcetorque one, probably we can copy the forcetorque directory in basestate, and then modify the plugin to get the same functionality of https://github.com/robotology/gazebo-yarp-plugins/tree/master/plugins/basestate by copying the code in there.

@xela-95
Copy link
Member Author

xela-95 commented Jan 17, 2024

The basestate plugin for gazebo classic have been updated in PR robotology/gazebo-yarp-plugins#675

@xela-95
Copy link
Member Author

xela-95 commented Jan 17, 2024

@traversaro I am progressing with the porting of the plugin, but up to now I have encountered an issue: my code builds (both manually configuring and building from terminal and using the vscode cmake tools extension). But when I try to install I get the following error:

(gz7) acroci@IITICUBLAP218:~/repos/gz-sim-yarp-plugins/build$ ninja install
[0/1] Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/local/lib/libgz-sim-yarp-handler.so
CMake Error at libraries/singleton-devices/cmake_install.cmake:52 (file):
  file INSTALL cannot copy file
  "/home/acroci/repos/gz-sim-yarp-plugins/build/lib/libgz-sim-yarp-handler.so"
  to "/usr/local/lib/libgz-sim-yarp-handler.so": Permission denied.
Call Stack (most recent call first):
  libraries/cmake_install.cmake:47 (include)
  cmake_install.cmake:47 (include)

FAILED: CMakeFiles/install.util 
cd /home/acroci/repos/gz-sim-yarp-plugins/build && /home/acroci/mambaforge/envs/gz7/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.

Probably I'm missing something stupid but I cannot figure out what it is 🙃

@xela-95
Copy link
Member Author

xela-95 commented Jan 17, 2024

Another question: in order to ask code reviews about the work I'm doing, should I open a PR in draft mode (even if the code is not completed)?

@xela-95
Copy link
Member Author

xela-95 commented Jan 17, 2024

@traversaro I am progressing with the porting of the plugin, but up to now I have encountered an issue: my code builds (both manually configuring and building from terminal and using the vscode cmake tools extension). But when I try to install I get the following error:

(gz7) acroci@IITICUBLAP218:~/repos/gz-sim-yarp-plugins/build$ ninja install
[0/1] Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/local/lib/libgz-sim-yarp-handler.so
CMake Error at libraries/singleton-devices/cmake_install.cmake:52 (file):
  file INSTALL cannot copy file
  "/home/acroci/repos/gz-sim-yarp-plugins/build/lib/libgz-sim-yarp-handler.so"
  to "/usr/local/lib/libgz-sim-yarp-handler.so": Permission denied.
Call Stack (most recent call first):
  libraries/cmake_install.cmake:47 (include)
  cmake_install.cmake:47 (include)

FAILED: CMakeFiles/install.util 
cd /home/acroci/repos/gz-sim-yarp-plugins/build && /home/acroci/mambaforge/envs/gz7/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.

Probably I'm missing something stupid but I cannot figure out what it is 🙃

Ok the problem is solved by configuring the project (as written in the README) with:

cmake -GNinja -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_PREFIX_PATH=$CONDA_PREFIX ..

Then running:

ninja
ninja install

runs fine.

I'm a bit new with cmake, so as I can understand the problem was due to the fact that by default ninja tries to install the executables into the /usr/local/lib folder (for which it needs administrative privileges), while using the $CONDA_PREFIX location it is able to install.

@xela-95
Copy link
Member Author

xela-95 commented Jan 17, 2024

Ok the problem is solved by configuring the project (as written in the README) with:

cmake -GNinja -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_PREFIX_PATH=$CONDA_PREFIX ..

I will try to configure my vscode settings those arguments so that I can continue to use the build command from vscode.

@xela-95
Copy link
Member Author

xela-95 commented Jan 17, 2024

Done!

Documentation:

I added to the `.vscode/settings.json' file the following lines:

    "cmake.configureArgs": [
        "-DCMAKE_INSTALL_PREFIX=${env:CONDA_PREFIX}",
        "-DCMAKE_PREFIX_PATH=${env:CONDA_PREFIX}"
    ],
    "cmake.generator": "Ninja"

and now the configuration phase is the same as the one in the README and the install steps works also from inside vscode (I do it by opening the command palette with CTRL+SHIFT+P and then find CMake: install.

@traversaro
Copy link
Member

Another question: in order to ask code reviews about the work I'm doing, should I open a PR in draft mode (even if the code is not completed)?

Yes!

@xela-95
Copy link
Member Author

xela-95 commented Jan 18, 2024

Some documentation to understand messaging in Gazebo sim:

Interesting page aboud ECM:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants