Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:19:0: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_linear.hh:32:41: error: ‘math’ has not been declared physics::LinkPtr _link, math::Vector3 _vel, double _maxForce) ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_linear.hh:32:55: error: expected ‘,’ or ‘...’ before ‘_vel’ physics::LinkPtr _link, math::Vector3 _vel, double _maxForce) ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_linear.hh: In member function ‘void gazebo::OdePerfectLinearVelController::Start(gazebo::physics::LinkPtr, int)’: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_linear.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/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_linear.hh:42:20: error: ‘class gazebo::physics::World’ has no member named ‘GetByName’; did you mean ‘BaseByName’? world->GetByName("world")); ^~~~~~~~~ BaseByName /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_linear.hh:43:9: error: ‘math’ has not been declared math::Pose jointOrigin; ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_linear.hh:44:45: error: ‘jointOrigin’ was not declared in this scope this->joint->Load(worldLink, _link, jointOrigin); ^~~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_linear.hh:46:28: error: ‘_vel’ was not declared in this scope double magnitude = _vel.GetLength(); ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_linear.hh:48:42: error: ‘_maxForce’ was not declared in this scope this->joint->SetParam("fmax", 0, _maxForce); ^~~~~~~~~ In file included from /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:20:0: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_angular.hh: At global scope: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_angular.hh:34:41: error: ‘math’ has not been declared physics::LinkPtr _link, math::Vector3 _vel, double _maxTorque) ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_angular.hh:34:55: error: expected ‘,’ or ‘...’ before ‘_vel’ physics::LinkPtr _link, math::Vector3 _vel, double _maxTorque) ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_angular.hh: In member function ‘void gazebo::OdePerfectAngularVelController::Start(gazebo::physics::LinkPtr, int)’: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_angular.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/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_angular.hh:44:61: error: ‘class gazebo::physics::World’ has no member named ‘GetByName’; did you mean ‘BaseByName’? boost::dynamic_pointer_cast<physics::link>(world->GetByName("world")); ^~~~~~~~~ BaseByName /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_angular.hh:45:9: error: ‘math’ has not been declared math::Pose jointOrigin; ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_angular.hh:46:45: error: ‘jointOrigin’ was not declared in this scope this->joint->Load(worldLink, _link, jointOrigin); ^~~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_angular.hh:48:28: error: ‘_vel’ was not declared in this scope double magnitude = _vel.GetLength(); ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_angular.hh:50:42: error: ‘_maxTorque’ was not declared in this scope this->joint->SetParam("fmax", 0, _maxTorque); ^~~~~~~~~~ In file included from /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:21:0: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh: At global scope: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh:27:46: error: ‘math’ has not been declared public: void Start(physics::LinkPtr _link, math::Vector3 _linearVel, ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh:27:60: error: expected ‘,’ or ‘...’ before ‘_linearVel’ public: void Start(physics::LinkPtr _link, math::Vector3 _linearVel, ^~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh: In member function ‘void gazebo::OdePerfectVelocityController::Start(gazebo::physics::LinkPtr, int)’: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.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/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh:61:20: error: ‘class gazebo::physics::World’ has no member named ‘GetByName’; did you mean ‘BaseByName’? world->GetByName("world")); ^~~~~~~~~ BaseByName /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh:62:9: error: ‘math’ has not been declared math::Pose prismaticJointOrigin; ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh:64:13: error: ‘prismaticJointOrigin’ was not declared in this scope prismaticJointOrigin); ^~~~~~~~~~~~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh:64:13: note: suggested alternative: ‘prismaticJoint’ prismaticJointOrigin); ^~~~~~~~~~~~~~~~~~~~ prismaticJoint /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh:66:34: error: ‘_linearVel’ was not declared in this scope double linearMagnitude = _linearVel.GetLength(); ^~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh:68:51: error: ‘_maxForce’ was not declared in this scope this->prismaticJoint->SetParam("fmax", 0, _maxForce); ^~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh:75:9: error: ‘math’ has not been declared math::Pose revoluteJointOrigin; ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh:77:13: error: ‘revoluteJointOrigin’ was not declared in this scope revoluteJointOrigin); ^~~~~~~~~~~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh:77:13: note: suggested alternative: ‘revoluteJoint’ revoluteJointOrigin); ^~~~~~~~~~~~~~~~~~~ revoluteJoint /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh:79:35: error: ‘_angularVel’ was not declared in this scope double angularMagnitude = _angularVel.GetLength(); ^~~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh:81:50: error: ‘_maxTorque’ was not declared in this scope this->revoluteJoint->SetParam("fmax", 0, _maxTorque); ^~~~~~~~~~ In file included from /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:22:0: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh: At global scope: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:24:46: error: ‘math’ has not been declared public: void Start(physics::LinkPtr _link, math::Vector3 _linearVel, ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:24:60: error: expected ‘,’ or ‘...’ before ‘_linearVel’ public: void Start(physics::LinkPtr _link, math::Vector3 _linearVel, ^~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:109:12: error: ‘math’ does not name a type; did you mean ‘tanh’? private: math::Vector3 targetLinearVel; ^~~~ tanh /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:110:12: error: ‘math’ does not name a type; did you mean ‘tanh’? private: math::Vector3 targetAngularVel; ^~~~ tanh /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh: In member function ‘void PIDLinkVelocityController::Start(gazebo::physics::LinkPtr, int)’: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:29:13: error: ‘class PIDLinkVelocityController’ has no member named ‘targetLinearVel’ this->targetLinearVel = _linearVel; ^~~~~~~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:29:31: error: ‘_linearVel’ was not declared in this scope this->targetLinearVel = _linearVel; ^~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:30:13: error: ‘class PIDLinkVelocityController’ has no member named ‘targetAngularVel’ this->targetAngularVel = _angularVel; ^~~~~~~~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:30:32: error: ‘_angularVel’ was not declared in this scope this->targetAngularVel = _angularVel; ^~~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:46:40: error: ‘_maxForce’ was not declared in this scope linear_imax, -linear_imax, _maxForce, -_maxForce); ^~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:48:42: error: ‘_maxTorque’ was not declared in this scope angular_imax, -angular_imax, _maxTorque, -_maxTorque); ^~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh: In member function ‘void PIDLinkVelocityController::Update(const gazebo::common::UpdateInfo&)’: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:84:7: error: ‘math’ has not been declared math::Vector3 curLinearVel = this->link->GetWorldLinearVel(); ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:85:7: error: ‘math’ has not been declared math::Vector3 curAngularVel = this->link->GetWorldAngularVel(); ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:86:7: error: ‘math’ has not been declared math::Vector3 linearError = curLinearVel - this->targetLinearVel; ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:87:7: error: ‘math’ has not been declared math::Vector3 angularError = curAngularVel - this->targetAngularVel; ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:90:7: error: ‘math’ has not been declared math::Vector3 worldForce; ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:91:7: error: ‘math’ has not been declared math::Vector3 worldTorque; ^~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:92:7: error: ‘worldForce’ was not declared in this scope worldForce.x = this->controllers[0].Update(linearError.x, dt); ^~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:92:50: error: ‘linearError’ was not declared in this scope worldForce.x = this->controllers[0].Update(linearError.x, dt); ^~~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:93:7: error: ‘worldTorque’ was not declared in this scope worldTorque.x = this->controllers[1].Update(angularError.x, dt); ^~~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:93:51: error: ‘angularError’ was not declared in this scope worldTorque.x = this->controllers[1].Update(angularError.x, dt); ^~~~~~~~~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:93:51: note: suggested alternative: ‘av_strerror’ worldTorque.x = this->controllers[1].Update(angularError.x, dt); ^~~~~~~~~~~~ av_strerror /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp: In member function ‘void gazebo::SetLinkVelocityPlugin::Update(const gazebo::common::UpdateInfo&)’: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:57:78: error: no matching function for call to ‘gazebo::OdePerfectLinearVelController::Start(gazebo::physics::LinkPtr, <brace-enclosed initializer="" list="">, int)’ odePerfectLinear.Start(model->GetLink("red_link_0"), {0, 1, 0}, 100); ^ In file included from /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:19:0: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_linear.hh:31:18: note: candidate: void gazebo::OdePerfectLinearVelController::Start(gazebo::physics::LinkPtr, int) public: void Start( ^~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_linear.hh:31:18: note: candidate expects 2 arguments, 3 provided /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:58:96: error: no matching function for call to ‘gazebo::OdePerfectVelocityController::Start(gazebo::physics::LinkPtr, <brace-enclosed initializer="" list="">, <brace-enclosed initializer="" list="">, int, int)’ ctVelocity.Start(model->GetLink("red_link_1"), {0, 1, 0}, {1, 0, 0}, 100, 100); ^ In file included from /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:21:0: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh:27:16: note: candidate: void gazebo::OdePerfectVelocityController::Start(gazebo::physics::LinkPtr, int) public: void Start(physics::LinkPtr _link, math::Vector3 _linearVel, ^~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_velocity.hh:27:16: note: candidate expects 2 arguments, 5 provided /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:59:79: error: no matching function for call to ‘gazebo::OdePerfectAngularVelController::Start(gazebo::physics::LinkPtr, <brace-enclosed initializer="" list="">, int)’ odePerfectAngular.Start(model->GetLink("red_link_2"), {1, 0, 0}, 100); ^ In file included from /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:20:0: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_angular.hh:33:18: note: candidate: void gazebo::OdePerfectAngularVelController::Start(gazebo::physics::LinkPtr, int) public: void Start( ^~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/ode_perfect_angular.hh:33:18: note: candidate expects 2 arguments, 3 provided /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:63:75: error: no matching function for call to ‘PIDLinkVelocityController::Start(gazebo::physics::LinkPtr, <brace-enclosed initializer="" list="">, <brace-enclosed initializer="" list="">, int, int)’ model->GetLink("green_link_0"), {0, 1, 0}, {0, 0, 0}, 100, 0); ^ In file included from /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:22:0: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:24:16: note: candidate: void PIDLinkVelocityController::Start(gazebo::physics::LinkPtr, int) public: void Start(physics::LinkPtr _link, math::Vector3 _linearVel, ^~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:24:16: note: candidate expects 2 arguments, 5 provided /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:65:77: error: no matching function for call to ‘PIDLinkVelocityController::Start(gazebo::physics::LinkPtr, <brace-enclosed initializer="" list="">, <brace-enclosed initializer="" list="">, int, int)’ model->GetLink("green_link_1"), {0, 1, 0}, {1, 0, 0}, 100, 100); ^ In file included from /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:22:0: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:24:16: note: candidate: void PIDLinkVelocityController::Start(gazebo::physics::LinkPtr, int) public: void Start(physics::LinkPtr _link, math::Vector3 _linearVel, ^~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:24:16: note: candidate expects 2 arguments, 5 provided /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:67:75: error: no matching function for call to ‘PIDLinkVelocityController::Start(gazebo::physics::LinkPtr, <brace-enclosed initializer="" list="">, <brace-enclosed initializer="" list="">, int, int)’ model->GetLink("green_link_2"), {0, 0, 0}, {1, 0, 0}, 0, 100); ^ In file included from /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/src/SetLinkVelocityPlugin.cpp:22:0: /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.hh:24:16: note: candidate: void PIDLinkVelocityController::Start(gazebo::physics::LinkPtr, int) public: void Start(physics::LinkPtr _link, math::Vector3 _linearVel, ^~~~~ /home/suyash/gazebo_tutorials/set_velocity/examples/set_vel_plugin/include/pid_link.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