Home | Tutorials | Wiki | Issues
Ask Your Question
0

pointer to joint_state doest works

asked 2016-09-07 07:30:57 -0500

hari1234 gravatar image

updated 2016-09-07 09:32:32 -0500

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;
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-09-07 09:19:38 -0500

nkoenig gravatar image

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.

edit flag offensive delete link more

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.

hari1234 gravatar imagehari1234 ( 2016-09-07 09:23:20 -0500 )edit
1

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.

nkoenig gravatar imagenkoenig ( 2016-09-07 09:31:51 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-09-07 07:30:57 -0500

Seen: 93 times

Last updated: Sep 07 '16