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

When I use set_velocity plugin make error #108

Open
richardsanqi opened this issue Jun 2, 2020 · 3 comments
Open

When I use set_velocity plugin make error #108

richardsanqi opened this issue Jun 2, 2020 · 3 comments

Comments

@richardsanqi
Copy link

richardsanqi commented Jun 2, 2020

In file included from /home/lipi/Documents/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:21:0:
/home/lipi/Documents/set_vel_plugin/include/ode_perfect_velocity.hh: In member function ‘void gazebo::OdePerfectVelocityController::Start(gazebo::physics::LinkPtr, gazebo::math::Vector3, gazebo::math::Vector3, double, double)’:
/home/lipi/Documents/set_vel_plugin/include/ode_perfect_velocity.hh:36:36: error: ‘class gazebo::physics::Model’ has no member named ‘CreateLink’
         this->phantomLink = model->CreateLink("__perfect_phantom_link__");
                                    ^
CMakeFiles/SetLinkVelocityPlugin.dir/build.make:62: recipe for target 'CMakeFiles/SetLinkVelocityPlugin.dir/src/SetLinkVelocityPlugin.cpp.o' failed
make[2]: *** [CMakeFiles/SetLinkVelocityPlugin.dir/src/SetLinkVelocityPlugin.cpp.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/SetLinkVelocityPlugin.dir/all' failed
make[1]: *** [CMakeFiles/SetLinkVelocityPlugin.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

I follow the gazebo tutorials,and use gazebo7.It seems cmake works without error,but when i use make ,the terminal get this error,ubuntu 16.06+ros kinetic

@chapulina
Copy link
Contributor

I believe you're talking about this tutorial:

http://gazebosim.org/tutorials?tut=set_velocity

You may be using an old Gazebo 7 version. That function was added on 7.1.0. Update your version as explained on this tutorial.

@richardsanqi
Copy link
Author

richardsanqi commented Jun 2, 2020

I believe you're talking about this tutorial:

http://gazebosim.org/tutorials?tut=set_velocity

You may be using an old Gazebo 7 version. That function was added on 7.1.0. Update your version as explained on this tutorial.

Thanks a lot.I just reinstall the GAZEBO,and this problem is sloved.But I use this command GAZEBO_PLUGIN_PATH=. gazebo --pause --verbose ../set_velocity.world as tutorials,the model is loaded,but they don not move.In fact,I have no idea how to use this plugin.Although the tutorials give some code.I want to set my robot jointvelocity real-time by using this plugin.Do you have any program or example to set robot jointvelocity.Thanks!

@bai-ivan
Copy link

bai-ivan commented Mar 11, 2023

I have a bit of hacky way of fixing this. I know it's old issue, but here it is for everyone else that might be googling.
DISCLAIMER: The hacky part modifies configurations on your system, modify it only if you understand what can happen later.

Code in this repo is probably a bit old, and there's stuff in gazebo dependencies that changed. Since i need only joint velocity example, you can completely ignore all the errors from the link one. In case you need the link example - code is a bit too broken for me to fix it at the moment, so you're on your own.

To get the example to build, edit your gazebo's cmake config.

sudo nano /usr/lib/x86_64-linux-gnu/cmake/gazebo/gazebo-config.cmake

find the line (mine was 62, but i believe it may vary) where it says set (GAZEBO_HAS_SIMBODY TRUE) and change it to set (GAZEBO_HAS_SIMBODY FALSE)

then open the cmake-lists of the example (this repo)

nano /path/to/gazebo_tutorials/set_velocity/examples/set_vel_plugin/CMakeLists.txt

and remove the lines

add_library(SetLinkVelocityPlugin SHARED src/SetLinkVelocityPlugin.cpp)
target_link_libraries(SetLinkVelocityPlugin ${GAZEBO_LIBRARIES})

Save the CMakeLists.txt, clear the build cache from the build folder, and start the cmake command again. Voila.

EDIT: probably related to #151 and #145

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

No branches or pull requests

3 participants