Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate the APIs that we think are unused. #191

Merged
merged 2 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions urdf_parser/include/urdf_parser/urdf_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,26 @@ namespace urdf{

URDFDOM_DLLAPI ModelInterfaceSharedPtr parseURDF(const std::string &xml_string);
URDFDOM_DLLAPI ModelInterfaceSharedPtr parseURDFFile(const std::string &path);

[[deprecated("File an issue at https://github.com/ros/urdfdom if you rely on this")]]
URDFDOM_DLLAPI tinyxml2::XMLDocument* exportURDF(ModelInterfaceSharedPtr &model);

[[deprecated("File an issue at https://github.com/ros/urdfdom if you rely on this")]]
URDFDOM_DLLAPI tinyxml2::XMLDocument* exportURDF(const ModelInterface &model);

[[deprecated("File an issue at https://github.com/ros/urdfdom if you rely on this")]]
URDFDOM_DLLAPI bool parsePose(Pose&, tinyxml2::XMLElement*);

[[deprecated("File an issue at https://github.com/ros/urdfdom if you rely on this")]]
URDFDOM_DLLAPI bool parseCamera(Camera&, tinyxml2::XMLElement*);

[[deprecated("File an issue at https://github.com/ros/urdfdom if you rely on this")]]
URDFDOM_DLLAPI bool parseRay(Ray&, tinyxml2::XMLElement*);

[[deprecated("File an issue at https://github.com/ros/urdfdom if you rely on this")]]
URDFDOM_DLLAPI bool parseSensor(Sensor&, tinyxml2::XMLElement*);

[[deprecated("File an issue at https://github.com/ros/urdfdom if you rely on this")]]
URDFDOM_DLLAPI bool parseModelState(ModelState&, tinyxml2::XMLElement*);
}

Expand Down
4 changes: 2 additions & 2 deletions urdf_parser/src/joint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

namespace urdf{

bool parsePose(Pose &pose, tinyxml2::XMLElement* xml);
bool parsePoseInternal(Pose &pose, tinyxml2::XMLElement* xml);

bool parseJointDynamics(JointDynamics &jd, tinyxml2::XMLElement* config)
{
Expand Down Expand Up @@ -356,7 +356,7 @@ bool parseJoint(Joint &joint, tinyxml2::XMLElement* config)
}
else
{
if (!parsePose(joint.parent_to_joint_origin_transform, origin_xml))
if (!parsePoseInternal(joint.parent_to_joint_origin_transform, origin_xml))
{
joint.parent_to_joint_origin_transform.clear();
CONSOLE_BRIDGE_logError("Malformed parent origin element for joint [%s]", joint.name.c_str());
Expand Down
8 changes: 4 additions & 4 deletions urdf_parser/src/link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

namespace urdf{

bool parsePose(Pose &pose, tinyxml2::XMLElement* xml);
bool parsePoseInternal(Pose &pose, tinyxml2::XMLElement* xml);

bool parseMaterial(Material &material, tinyxml2::XMLElement *config, bool only_name_is_ok)
{
Expand Down Expand Up @@ -274,7 +274,7 @@ bool parseInertial(Inertial &i, tinyxml2::XMLElement *config)
tinyxml2::XMLElement *o = config->FirstChildElement("origin");
if (o)
{
if (!parsePose(i.origin, o))
if (!parsePoseInternal(i.origin, o))
return false;
}

Expand Down Expand Up @@ -353,7 +353,7 @@ bool parseVisual(Visual &vis, tinyxml2::XMLElement *config)
// Origin
tinyxml2::XMLElement *o = config->FirstChildElement("origin");
if (o) {
if (!parsePose(vis.origin, o))
if (!parsePoseInternal(vis.origin, o))
return false;
}

Expand Down Expand Up @@ -395,7 +395,7 @@ bool parseCollision(Collision &col, tinyxml2::XMLElement* config)
// Origin
tinyxml2::XMLElement *o = config->FirstChildElement("origin");
if (o) {
if (!parsePose(col.origin, o))
if (!parsePoseInternal(col.origin, o))
return false;
}

Expand Down
10 changes: 8 additions & 2 deletions urdf_parser/src/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ ModelInterfaceSharedPtr parseURDF(const std::string &xml_string)
bool exportMaterial(Material &material, tinyxml2::XMLElement *config);
bool exportLink(Link &link, tinyxml2::XMLElement *config);
bool exportJoint(Joint &joint, tinyxml2::XMLElement *config);
tinyxml2::XMLDocument* exportURDF(const ModelInterface &model)

tinyxml2::XMLDocument* exportURDFInternal(const ModelInterface &model)
{
tinyxml2::XMLDocument *doc = new tinyxml2::XMLDocument();

Expand Down Expand Up @@ -303,9 +304,14 @@ tinyxml2::XMLDocument* exportURDF(const ModelInterface &model)
return doc;
}

tinyxml2::XMLDocument* exportURDF(const ModelInterface &model)
{
return exportURDFInternal(model);
}

tinyxml2::XMLDocument* exportURDF(ModelInterfaceSharedPtr &model)
{
return exportURDF(*model);
return exportURDFInternal(*model);
}


Expand Down
7 changes: 6 additions & 1 deletion urdf_parser/src/pose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ std::string values2str(double d)

namespace urdf{

bool parsePose(Pose &pose, tinyxml2::XMLElement* xml)
bool parsePoseInternal(Pose &pose, tinyxml2::XMLElement* xml)
{
pose.clear();
if (xml)
Expand Down Expand Up @@ -119,6 +119,11 @@ bool parsePose(Pose &pose, tinyxml2::XMLElement* xml)
return true;
}

bool parsePose(Pose &pose, tinyxml2::XMLElement* xml)
{
return parsePoseInternal(pose, xml);
}

bool exportPose(Pose &pose, tinyxml2::XMLElement* xml)
{
tinyxml2::XMLElement* origin = xml->GetDocument()->NewElement("origin");
Expand Down
22 changes: 16 additions & 6 deletions urdf_parser/src/urdf_sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@

namespace urdf{

bool parsePose(Pose &pose, tinyxml2::XMLElement* xml);
bool parsePoseInternal(Pose &pose, tinyxml2::XMLElement* xml);

bool parseCamera(Camera &camera, tinyxml2::XMLElement* config)
bool parseCameraInternal(Camera &camera, tinyxml2::XMLElement* config)
{
camera.clear();
camera.type = VisualSensor::CAMERA;
Expand Down Expand Up @@ -173,7 +173,12 @@ bool parseCamera(Camera &camera, tinyxml2::XMLElement* config)
return true;
}

bool parseRay(Ray &ray, tinyxml2::XMLElement* config)
bool parseCamera(Camera &camera, tinyxml2::XMLElement* config)
{
return parseCameraInternal(camera, config);
}

bool parseRayInternal(Ray &ray, tinyxml2::XMLElement* config)
{
ray.clear();
ray.type = VisualSensor::RAY;
Expand Down Expand Up @@ -292,6 +297,11 @@ bool parseRay(Ray &ray, tinyxml2::XMLElement* config)
return false;
}

bool parseRay(Ray &ray, tinyxml2::XMLElement* config)
{
return parseRayInternal(ray, config);
}

VisualSensorSharedPtr parseVisualSensor(tinyxml2::XMLElement *g)
{
VisualSensorSharedPtr visual_sensor;
Expand All @@ -303,15 +313,15 @@ VisualSensorSharedPtr parseVisualSensor(tinyxml2::XMLElement *g)
Camera *camera = new Camera();
visual_sensor.reset(camera);
sensor_xml = g->FirstChildElement("camera");
if (!parseCamera(*camera, sensor_xml))
if (!parseCameraInternal(*camera, sensor_xml))
visual_sensor.reset();
}
else if (g->FirstChildElement("ray"))
{
Ray *ray = new Ray();
visual_sensor.reset(ray);
sensor_xml = g->FirstChildElement("ray");
if (!parseRay(*ray, sensor_xml))
if (!parseRayInternal(*ray, sensor_xml))
visual_sensor.reset();
}
else
Expand Down Expand Up @@ -347,7 +357,7 @@ bool parseSensor(Sensor &sensor, tinyxml2::XMLElement* config)
tinyxml2::XMLElement *o = config->FirstChildElement("origin");
if (o)
{
if (!parsePose(sensor.origin, o))
if (!parsePoseInternal(sensor.origin, o))
return false;
}

Expand Down
Loading