Robotics StackExchange | Archived questions

Unable to run the 'Setting Velocity on Links And Joints' tutorial

I cloned the tutorial and made the build directory. After running the cmake .. command, when I try to execute the make command, the following error pops up. From the previous questions, I think it is because of the mismatch of the Gazebo versions, but I am not sure how to solve. Please help, thank you.

[ 25%] Building CXX object CMakeFiles/SetLinkVelocityPlugin.dir/src/SetLinkVelocityPlugin.cpp.o In file included from /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp:19:0: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectlinear.hh:32:41: error: ‘math’ has not been declared physics::LinkPtr link, math::Vector3 _vel, double _maxForce) ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectlinear.hh:32:55: error: expected ‘,’ or ‘...’ before ‘vel’ physics::LinkPtr link, math::Vector3 _vel, double _maxForce) ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectlinear.hh: In member function ‘void gazebo::OdePerfectLinearVelController::Start(gazebo::physics::LinkPtr, int)’: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectlinear.hh:38:51: error: ‘class gazebo::physics::World’ has no member named ‘GetPhysicsEngine’; did you mean ‘SetPhysicsEnabled’? physics::PhysicsEnginePtr engine = world->GetPhysicsEngine(); ^~~~~~~~~~~~~~~~ SetPhysicsEnabled /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectlinear.hh:42:20: error: ‘class gazebo::physics::World’ has no member named ‘GetByName’; did you mean ‘BaseByName’? world->GetByName("world")); ^~~~~~~~~ BaseByName /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectlinear.hh:43:9: error: ‘math’ has not been declared math::Pose jointOrigin; ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectlinear.hh:44:45: error: ‘jointOrigin’ was not declared in this scope this->joint->Load(worldLink, _link, jointOrigin); ^~~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectlinear.hh:46:28: error: ‘vel’ was not declared in this scope double magnitude = vel.GetLength(); ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectlinear.hh:48:42: error: ‘maxForce’ was not declared in this scope this->joint->SetParam("fmax", 0, maxForce); ^~~~~~~~~ In file included from /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp:20:0: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectangular.hh: At global scope: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectangular.hh:34:41: error: ‘math’ has not been declared physics::LinkPtr _link, math::Vector3 _vel, double _maxTorque) ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectangular.hh:34:55: error: expected ‘,’ or ‘...’ before ‘vel’ physics::LinkPtr link, math::Vector3 _vel, double _maxTorque) ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectangular.hh: In member function ‘void gazebo::OdePerfectAngularVelController::Start(gazebo::physics::LinkPtr, int)’: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectangular.hh:40:51: error: ‘class gazebo::physics::World’ has no member named ‘GetPhysicsEngine’; did you mean ‘SetPhysicsEnabled’? physics::PhysicsEnginePtr engine = world->GetPhysicsEngine(); ^~~~~~~~~~~~~~~~ SetPhysicsEnabled /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectangular.hh:44:61: error: ‘class gazebo::physics::World’ has no member named ‘GetByName’; did you mean ‘BaseByName’? boost::dynamicpointercastphysics::Link(world->GetByName("world")); ^~~~~~~~~ BaseByName /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectangular.hh:45:9: error: ‘math’ has not been declared math::Pose jointOrigin; ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectangular.hh:46:45: error: ‘jointOrigin’ was not declared in this scope this->joint->Load(worldLink, _link, jointOrigin); ^~~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectangular.hh:48:28: error: ‘vel’ was not declared in this scope double magnitude = vel.GetLength(); ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectangular.hh:50:42: error: ‘maxTorque’ was not declared in this scope this->joint->SetParam("fmax", 0, maxTorque); ^~~~~~~~~~ In file included from /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp:21:0: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh: At global scope: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh:27:46: error: ‘math’ has not been declared public: void Start(physics::LinkPtr _link, math::Vector3 _linearVel, ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh:27:60: error: expected ‘,’ or ‘...’ before ‘linearVel’ public: void Start(physics::LinkPtr link, math::Vector3 _linearVel, ^~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh: In member function ‘void gazebo::OdePerfectVelocityController::Start(gazebo::physics::LinkPtr, int)’: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh:33:51: error: ‘class gazebo::physics::World’ has no member named ‘GetPhysicsEngine’; did you mean ‘SetPhysicsEnabled’? physics::PhysicsEnginePtr engine = world->GetPhysicsEngine(); ^~~~~~~~~~~~~~~~ SetPhysicsEnabled /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh:61:20: error: ‘class gazebo::physics::World’ has no member named ‘GetByName’; did you mean ‘BaseByName’? world->GetByName("world")); ^~~~~~~~~ BaseByName /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh:62:9: error: ‘math’ has not been declared math::Pose prismaticJointOrigin; ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh:64:13: error: ‘prismaticJointOrigin’ was not declared in this scope prismaticJointOrigin); ^~~~~~~~~~~~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh:64:13: note: suggested alternative: ‘prismaticJoint’ prismaticJointOrigin); ^~~~~~~~~~~~~~~~~~~~ prismaticJoint /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh:66:34: error: ‘linearVel’ was not declared in this scope double linearMagnitude = linearVel.GetLength(); ^~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh:68:51: error: ‘maxForce’ was not declared in this scope this->prismaticJoint->SetParam("fmax", 0, maxForce); ^~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh:75:9: error: ‘math’ has not been declared math::Pose revoluteJointOrigin; ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh:77:13: error: ‘revoluteJointOrigin’ was not declared in this scope revoluteJointOrigin); ^~~~~~~~~~~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh:77:13: note: suggested alternative: ‘revoluteJoint’ revoluteJointOrigin); ^~~~~~~~~~~~~~~~~~~ revoluteJoint /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh:79:35: error: ‘angularVel’ was not declared in this scope double angularMagnitude = angularVel.GetLength(); ^~~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh:81:50: error: ‘maxTorque’ was not declared in this scope this->revoluteJoint->SetParam("fmax", 0, maxTorque); ^~~~~~~~~~ In file included from /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp:22:0: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh: At global scope: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:24:46: error: ‘math’ has not been declared public: void Start(physics::LinkPtr _link, math::Vector3 _linearVel, ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:24:60: error: expected ‘,’ or ‘...’ before ‘linearVel’ public: void Start(physics::LinkPtr _link, math::Vector3 _linearVel, ^~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:109:12: error: ‘math’ does not name a type; did you mean ‘tanh’? private: math::Vector3 targetLinearVel; ^~~~ tanh /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:110:12: error: ‘math’ does not name a type; did you mean ‘tanh’? private: math::Vector3 targetAngularVel; ^~~~ tanh /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh: In member function ‘void PIDLinkVelocityController::Start(gazebo::physics::LinkPtr, int)’: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:29:13: error: ‘class PIDLinkVelocityController’ has no member named ‘targetLinearVel’ this->targetLinearVel = _linearVel; ^~~~~~~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:29:31: error: ‘linearVel’ was not declared in this scope this->targetLinearVel = _linearVel; ^~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:30:13: error: ‘class PIDLinkVelocityController’ has no member named ‘targetAngularVel’ this->targetAngularVel = angularVel; ^~~~~~~~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:30:32: error: ‘angularVel’ was not declared in this scope this->targetAngularVel = _angularVel; ^~~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:46:40: error: ‘maxForce’ was not declared in this scope linearimax, -linearimax, _maxForce, -maxForce); ^~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:48:42: error: ‘maxTorque’ was not declared in this scope angularimax, -angularimax, maxTorque, -maxTorque); ^~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh: In member function ‘void PIDLinkVelocityController::Update(const gazebo::common::UpdateInfo&)’: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:84:7: error: ‘math’ has not been declared math::Vector3 curLinearVel = this->link->GetWorldLinearVel(); ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:85:7: error: ‘math’ has not been declared math::Vector3 curAngularVel = this->link->GetWorldAngularVel(); ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:86:7: error: ‘math’ has not been declared math::Vector3 linearError = curLinearVel - this->targetLinearVel; ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:87:7: error: ‘math’ has not been declared math::Vector3 angularError = curAngularVel - this->targetAngularVel; ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:90:7: error: ‘math’ has not been declared math::Vector3 worldForce; ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:91:7: error: ‘math’ has not been declared math::Vector3 worldTorque; ^~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:92:7: error: ‘worldForce’ was not declared in this scope worldForce.x = this->controllers[0].Update(linearError.x, dt); ^~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:92:50: error: ‘linearError’ was not declared in this scope worldForce.x = this->controllers[0].Update(linearError.x, dt); ^~~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:93:7: error: ‘worldTorque’ was not declared in this scope worldTorque.x = this->controllers[1].Update(angularError.x, dt); ^~~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:93:51: error: ‘angularError’ was not declared in this scope worldTorque.x = this->controllers[1].Update(angularError.x, dt); ^~~~~~~~~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:93:51: note: suggested alternative: ‘avstrerror’ worldTorque.x = this->controllers[1].Update(angularError.x, dt); ^~~~~~~~~~~~ avstrerror /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp: In member function ‘void gazebo::SetLinkVelocityPlugin::Update(const gazebo::common::UpdateInfo&)’: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp:57:78: error: no matching function for call to ‘gazebo::OdePerfectLinearVelController::Start(gazebo::physics::LinkPtr, , int)’ odePerfectLinear.Start(model->GetLink("redlink0"), {0, 1, 0}, 100); ^ In file included from /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp:19:0: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectlinear.hh:31:18: note: candidate: void gazebo::OdePerfectLinearVelController::Start(gazebo::physics::LinkPtr, int) public: void Start( ^~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectlinear.hh:31:18: note: candidate expects 2 arguments, 3 provided /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp:58:96: error: no matching function for call to ‘gazebo::OdePerfectVelocityController::Start(gazebo::physics::LinkPtr, , , int, int)’ ctVelocity.Start(model->GetLink("redlink1"), {0, 1, 0}, {1, 0, 0}, 100, 100); ^ In file included from /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp:21:0: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh:27:16: note: candidate: void gazebo::OdePerfectVelocityController::Start(gazebo::physics::LinkPtr, int) public: void Start(physics::LinkPtr link, math::Vector3 _linearVel, ^~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectvelocity.hh:27:16: note: candidate expects 2 arguments, 5 provided /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp:59:79: error: no matching function for call to ‘gazebo::OdePerfectAngularVelController::Start(gazebo::physics::LinkPtr, , int)’ odePerfectAngular.Start(model->GetLink("redlink2"), {1, 0, 0}, 100); ^ In file included from /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp:20:0: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectangular.hh:33:18: note: candidate: void gazebo::OdePerfectAngularVelController::Start(gazebo::physics::LinkPtr, int) public: void Start( ^~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/odeperfectangular.hh:33:18: note: candidate expects 2 arguments, 3 provided /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp:63:75: error: no matching function for call to ‘PIDLinkVelocityController::Start(gazebo::physics::LinkPtr, , , int, int)’ model->GetLink("greenlink0"), {0, 1, 0}, {0, 0, 0}, 100, 0); ^ In file included from /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp:22:0: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:24:16: note: candidate: void PIDLinkVelocityController::Start(gazebo::physics::LinkPtr, int) public: void Start(physics::LinkPtr link, math::Vector3 _linearVel, ^~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:24:16: note: candidate expects 2 arguments, 5 provided /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp:65:77: error: no matching function for call to ‘PIDLinkVelocityController::Start(gazebo::physics::LinkPtr, , , int, int)’ model->GetLink("greenlink1"), {0, 1, 0}, {1, 0, 0}, 100, 100); ^ In file included from /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp:22:0: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:24:16: note: candidate: void PIDLinkVelocityController::Start(gazebo::physics::LinkPtr, int) public: void Start(physics::LinkPtr _link, math::Vector3 _linearVel, ^~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:24:16: note: candidate expects 2 arguments, 5 provided /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp:67:75: error: no matching function for call to ‘PIDLinkVelocityController::Start(gazebo::physics::LinkPtr, , , int, int)’ model->GetLink("greenlink2"), {0, 0, 0}, {1, 0, 0}, 0, 100); ^ In file included from /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/src/SetLinkVelocityPlugin.cpp:22:0: /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:24:16: note: candidate: void PIDLinkVelocityController::Start(gazebo::physics::LinkPtr, int) public: void Start(physics::LinkPtr _link, math::Vector3 _linearVel, ^~~~~ /home/suyash/gazebotutorials/setvelocity/examples/setvelplugin/include/pidlink.hh:24:16: note: candidate expects 2 arguments, 5 provided 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:67: 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

Asked by Suyash on 2019-11-17 23:04:30 UTC

Comments

I got the same Error. Did you solve the Problem? I use GAZEBO 9. The tutorial is for GAZEBO 7.

Asked by saekeler on 2020-03-27 06:46:08 UTC

Answers