Home | Tutorials | Wiki | Issues
Ask Your Question
2

gazebo ros plugin getValueDouble deprecated

asked 2013-11-26 07:22:18 -0600

Andrea gravatar image

Hi, I am converting a model plugin written for old version to gazebo (1.2 I believe) for gazebo 2.1. I have converted the includes in my header, the new are:

#include <gazebo/gazebo.hh>
#include <sdf/Param.hh>
#include <sdf/sdf.hh>
#include <gazebo/common/common.hh>
#include <gazebo/physics/physics.hh>

//ros includes
#include <ros/ros.h>

#include <geometry_msgs/Twist.h>
#include <geometry_msgs/Quaternion.h>
#include <std_msgs/String.h>

However, I am getting the following warning:

warning: ‘double sdf::Element::GetValueDouble(const string&)’ is deprecated (declared at /usr/include/sdformat-1.4/sdf/SDFImpl.hh:220) [-Wdeprecated-declarations]

indicating the method deprecated. I checked and is deprecated since version 1.6. I tried to see what is the equivalent for the new version, but I cannot find it. The problem is that for the newest version is not documented (not even 2.0) and the wiki is poor (to be gentle). I tried to look in the api in v. 1.9.1 is said to be deprecated but no alternative is provided. In v. 2.0, instead, the sdf class does not exist at all (of course). Can anyone help me please?

P.s. Someone should really improve the documentation

edit retag flag offensive close merge delete

Comments

+1, I am also wondering until when we can use the deprecated versions, and with what should we change them

AndreiHaidu gravatar imageAndreiHaidu ( 2013-11-26 08:51:24 -0600 )edit

1 Answer

Sort by » oldest newest most voted
3

answered 2013-11-27 12:56:42 -0600

nkoenig gravatar image

All of the GetX have been replaced with Get<type>.

For example: Get<std::string>("name_of_sdf_element").

edit flag offensive delete link more

Comments

Thanks alot, may I ask you why it is not written anywhere?

Andrea gravatar imageAndrea ( 2013-11-28 04:38:30 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2013-11-26 07:22:18 -0600

Seen: 775 times

Last updated: Nov 27 '13