0
$\begingroup$

Gazebo Answers logo

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;
  };

Originally posted by hari1234 on Gazebo Answers with karma: 56 on 2016-08-31

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

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!


Originally posted by chapulina with karma: 7504 on 2016-08-31

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by hari1234 on 2016-08-31:
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.

Comment by hari1234 on 2016-09-01:
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.

Comment by chapulina on 2016-09-01:
Thanks for looking into it!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.