37 const std::string& actuator_name,
38 const std::string& transmission_name,
43 const TiXmlElement* reduction_el = parent_el.FirstChildElement(
"mechanicalReduction");
48 ROS_ERROR_STREAM_NAMED(
"parser",
"Actuator '" << actuator_name <<
"' of transmission '" << transmission_name <<
49 "' does not specify the required <mechanicalReduction> element.");
53 ROS_DEBUG_STREAM_NAMED(
"parser",
"Actuator '" << actuator_name <<
"' of transmission '" << transmission_name <<
54 "' does not specify the optional <mechanicalReduction> element.");
60 try {reduction = std::stod(reduction_el->GetText());}
61 catch (
const std::logic_error&)
63 ROS_ERROR_STREAM_NAMED(
"parser",
"Actuator '" << actuator_name <<
"' of transmission '" << transmission_name <<
64 "' specifies the <mechanicalReduction> element, but is not a valid number.");
72 const std::string& joint_name,
73 const std::string& transmission_name,
78 const TiXmlElement* reduction_el = parent_el.FirstChildElement(
"mechanicalReduction");
84 "' does not specify the required <mechanicalReduction> element.");
89 "' does not specify the optional <mechanicalReduction> element.");
95 try {reduction = std::stod(reduction_el->GetText());}
96 catch (
const std::logic_error&)
99 "' specifies the <mechanicalReduction> element, but is not a valid number.");
107 const std::string& joint_name,
108 const std::string& transmission_name,
113 const TiXmlElement* offset_el = parent_el.FirstChildElement(
"offset");
119 "' does not specify the required <offset> element.");
124 "' does not specify the optional <offset> element.");
130 try {offset = std::stod(offset_el->GetText());}
131 catch (
const std::logic_error&)
134 "' specifies the <offset> element, but is not a valid number.");
142 const std::string& actuator_name,
143 const std::string& transmission_name,
148 const TiXmlElement* role_el = parent_el.FirstChildElement(
"role");
153 ROS_ERROR_STREAM_NAMED(
"parser",
"Actuator '" << actuator_name <<
"' of transmission '" << transmission_name <<
154 "' does not specify the required <role> element.");
158 ROS_DEBUG_STREAM_NAMED(
"parser",
"Actuator '" << actuator_name <<
"' of transmission '" << transmission_name <<
159 "' does not specify the optional <offset> element.");
165 if (!role_el->GetText())
169 ROS_ERROR_STREAM_NAMED(
"parser",
"Actuator '" << actuator_name <<
"' of transmission '" << transmission_name <<
170 "' specifies an empty <role> element.");
174 ROS_DEBUG_STREAM_NAMED(
"parser",
"Actuator '" << actuator_name <<
"' of transmission '" << transmission_name <<
175 "' specifies an empty <role> element.");
179 role = role_el->GetText();
186 const std::string& joint_name,
187 const std::string& transmission_name,
192 const TiXmlElement* role_el = parent_el.FirstChildElement(
"role");
198 "' does not specify the required <role> element.");
203 "' does not specify the optional <offset> element.");
209 if (!role_el->GetText())
214 "' specifies an empty <role> element.");
219 "' specifies an empty <role> element.");
223 role = role_el->GetText();
#define ROS_DEBUG_STREAM_NAMED(name, args)
#define ROS_ERROR_STREAM_NAMED(name, args)
static ParseStatus getActuatorReduction(const TiXmlElement &parent_el, const std::string &actuator_name, const std::string &transmission_name, bool required, double &reduction)
static ParseStatus getActuatorRole(const TiXmlElement &parent_el, const std::string &actuator_name, const std::string &transmission_name, bool required, std::string &role)
static ParseStatus getJointRole(const TiXmlElement &parent_el, const std::string &joint_name, const std::string &transmission_name, bool required, std::string &role)
static ParseStatus getJointReduction(const TiXmlElement &parent_el, const std::string &joint_name, const std::string &transmission_name, bool required, double &reduction)
static ParseStatus getJointOffset(const TiXmlElement &parent_el, const std::string &joint_name, const std::string &transmission_name, bool required, double &offset)