Robotics StackExchange | Archived questions

pointer to joint_state doest works

I was trying to use the joint_state class of gazebo API, but when i try to declare it as physics::JointStatePtr jointstatep; It shows:

 error: ‘JointStatePtr’ in namespace ‘gazebo::physics’ does not name a type
     private: physics::JointStatePtr js;
 error: ‘class gazebo::VelodynePlugin’ has no member named ‘JointPointer()’
       std::cout<<"position="<<this->JointPointer()->GetAngles()<<std::endl;

How do i use the JointPointer state class, to read the joint states of any joint. I tried this one but doesn't works:

public: void SetVelocity(const double &_vel)
{ 
  std::cerr=this->model->js;
  // Set the joint's target velocity
  this->model->GetJointController()->SetJointPosition(
      this->joint->GetScopedName(), _vel,0);
}

private: physics::JointState_M js;

Asked by hari1234 on 2016-09-07 07:30:57 UTC

Comments

Answers

What version of Gazebo are you using? I don't think there is a JointStatePtr type.

I assume you followed the Velodyne tutorial. If this is true, then the VelodynePlugin does not have aJointPointer function.

Can you provide more information about what you are trying to accomplish. More code snippets will help as well.

Asked by nkoenig on 2016-09-07 09:19:38 UTC

Comments

i am using gazebo 7.23 with ros indigo, i also tried JointState_M, but no use. I am trying to understand the gazebo API this days, since i am working with API's first time i've few problems, although i am cs student i cant grab those things, for s/w dev purpose. I just want to access the JointState class functions, somehow.

Asked by hari1234 on 2016-09-07 09:23:20 UTC

Here is the gazebo API docs: http://gazebosim.org/api The JointState class is only used for state logging and playback log files. If you are looking for instantaneous joint information, you should use the functions provided in the Joint class.

Asked by nkoenig on 2016-09-07 09:31:51 UTC