Skip to content

Commit

Permalink
Merge pull request RobotLocomotion#1777 from liangfok/feature/fixRigi…
Browse files Browse the repository at this point in the history
…dBodySDFParser

Feature/fix rigid body sdf parser
  • Loading branch information
RussTedrake committed Mar 1, 2016
2 parents 0675426 + 3395ddd commit 120ae97
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions drake/systems/plants/RigidBodyTreeSDF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,20 @@ void parseSDFJoint(RigidBodyTree * model, std::string model_name, XMLElement* no
if (axis_node) {
setSDFDynamics(model, axis_node, fjoint);
setSDFLimits(axis_node, fjoint);

double effort_limit = std::numeric_limits<double>::infinity();

XMLElement* limit_node = axis_node->FirstChildElement("limit");
if (limit_node) parseScalarValue(limit_node,"effort",effort_limit);

if (effort_limit != 0.0) {
RigidBodyActuator actuator(name,child,1.0,-effort_limit,effort_limit);
model->actuators.push_back(actuator);
}
}

joint = fjoint;
double effort_limit = std::numeric_limits<double>::infinity();
XMLElement* limit_node = axis_node->FirstChildElement("limit");
if (limit_node) parseScalarValue(limit_node,"effort",effort_limit);
if (effort_limit != 0.0) {
RigidBodyActuator actuator(name,child,1.0,-effort_limit,effort_limit);
model->actuators.push_back(actuator);
}

} else if (type.compare("fixed") == 0) {
joint = new FixedJoint(name, transform_to_parent_body);
} else if (type.compare("prismatic") == 0) {
Expand Down

0 comments on commit 120ae97

Please sign in to comment.