Home | Tutorials | Wiki | Issues
Ask Your Question
0

gazebo physics:: member function not found

asked 2016-08-31 20:19:19 -0600

hari1234 gravatar image

updated 2016-08-31 22:39:10 -0600

I was following velodyne control plugin tutorial but as i try to build the velodyne_plugin.cc file get this error:

/home/rob/velodyne_plugin/velodyne_plugin.cc:42:42: error: ‘class gazebo::physics::JointController’ has no member named ‘SetVelocityPID’
       this->model->GetJointController()->SetVelocityPID(
                                          ^
/home/rob/velodyne_plugin/velodyne_plugin.cc: In member function ‘void gazebo::VelodynePlugin::SetVelocity(const double&)’:
/home/rob/velodyne_plugin/velodyne_plugin.cc:71:42: error: ‘class gazebo::physics::JointController’ has no member named ‘SetVelocityTarget’
       this->model->GetJointController()->SetVelocityTarget(

When i saw the gazebo::physics::jointcontroller class reference here, i can clearly see that it contatins the member function named

SetVelocityTargt SetVelocityPID

and others, i have a doubt that because i am using gazebo2.2 which came with ros indigo, this is happening. Do i have to upgrade my gazebo to use all features? Till this step the code builds without error:

 class VelodynePlugin : public ModelPlugin
  {
    public: VelodynePlugin() {}
    public: virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
    {
      std::cerr << "\nThe velodyne plugin is attach to model[" <<
        _model->GetName() << "]\n";

      if(_model->GetJointCount() == 0)
      { std::cerr<<"Invalid joint count, Velodyne plugin not loaded/n"; return; }

      this->model = _model;
      this->joint = _model->GetJoints()[0];
      this->pid = common::PID(0.1,0,0);
    }
    private: physics::ModelPtr model;
    private: physics::JointPtr joint;
    private: common::PID pid;
  };
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2016-08-31 20:45:15 -0600

chapulina gravatar image

That tutorial is known to have a lot of problems. I made a few changes to fix it, but the changes need approvals before they can go on the live site. One of the problems I solved was the one you mention in this question.

If you're willing, you could try the changed tutorials here and report any problems you find on the comments section? Instead of using the usual gazebo tutorials website, you can click on the links numbered 1 - 6. If you don't find any problems, you can press the approve button. We need 2 approvals to get it live.

Thanks!

edit flag offensive delete link more

Comments

I still get the same error. It shows jointcontroller class has no member function called SetVelocity. until above lines it works fine but as i add other two, error comes. i'm using gazebo2.2.

hari1234 gravatar imagehari1234 ( 2016-08-31 22:22:27 -0600 )edit

Ok now after i upgraded the gazebo version from 2 to 7 with ros indigo it is working fine with the extra codes mentioned in answer. And i really like this new version, it is working very smoothly than previous one.

hari1234 gravatar imagehari1234 ( 2016-09-01 00:33:06 -0600 )edit

Thanks for looking into it!

chapulina gravatar imagechapulina ( 2016-09-01 11:14:29 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-08-31 20:19:19 -0600

Seen: 1,500 times

Last updated: Aug 31 '16