0
$\begingroup$

Gazebo Answers logo

Hi everybody, In my plugin I want to set the angle of a revolute joint according with a particular dynamic. To do this I used the function

void gazebo::physics::Joint::SetAngle ( unsigned int  _index, math::Angle  _angle) 

This function in declared as GAZEBO_DEPRECATED(version). When I try to compile the code, I have this return :

warning: 'void gazebo::physics::Joint::SetAngle(unsigned int, gazebo::math::Angle)' is deprecated (declared at /usr/include/gazebo-5.2/gazebo/physics/joint.hh:396 [-Wdeprecated-declaretions].

I'm not able to understand why I can't use this function. Is there a method that enables the user to use this type of function?

I tried to add this piece of code :

 #if defined(__GNUC__)
 #define GAZEBO_DEPRECATED(version) __attribute__((deprecated))
 #define GAZEBO_FORCEINLINE __attribute__((always_inline))
 #elif defined(_WIN32)
 #define GAZEBO_DEPRECATED(version)
 #define GAZEBO_FORCEINLINE __forceinline
 #else
 #define GAZEBO_DEPRECATED(version) ()
 #define GAZEBO_FORCEINLINE
 #endif

But appears an error like:

may not appear in macro parameter list
#define GAZEBO_FORCEINLINE __attribute__((always_inline))

Otherwise, is there other functions that can make the same thing of SetAngle?

Thank you, bye!


Originally posted by gabri89 on Gazebo Answers with karma: 19 on 2016-02-29

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

I don't know how to use a deprecated function (maybe it depends on the gazebo version you use).

The new function should be SetPosition .

https://osrf-distributions.s3.amazonaws.com/gazebo/api/dev/classgazebo_1_1physics_1_1Joint.html


Originally posted by Brosseau.F with karma: 284 on 2016-02-29

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by gabri89 on 2016-02-29:
Thank you, the error disappears! I hope that the joint will behave as I want.

$\endgroup$

Your Answer

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