Gazebo | Ignition | Community
Ask Your Question
0

How can I use the deprecated function SetAngle?

asked 2016-02-29 06:09:30 -0500

gabri89 gravatar image

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!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2016-02-29 06:53:53 -0500

Brosseau.F gravatar image

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.amazona...

edit flag offensive delete link more

Comments

Thank you, the error disappears! I hope that the joint will behave as I want.

gabri89 gravatar imagegabri89 ( 2016-02-29 07:10:24 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-02-29 06:09:30 -0500

Seen: 1,917 times

Last updated: Feb 29 '16