Default axis field is (1,0,0) and not (0,0,0)

This commit is contained in:
wim 2010-06-22 21:42:35 +00:00
parent 6c67fc7b04
commit 2ee00304a3
1 changed files with 13 additions and 15 deletions

View File

@ -471,21 +471,20 @@ bool Joint::initXml(TiXmlElement* config)
}
// Get Joint Axis
if (this->type != FLOATING)
if (this->type != FLOATING && this->type != FIXED)
{
// axis
TiXmlElement *axis_xml = config->FirstChildElement("axis");
if (axis_xml)
{
if (!axis_xml->Attribute("xyz"))
ROS_INFO("no xyz attribute for axis element for Joint link '%s', using default values", this->name.c_str());
else
{
if (!axis_xml){
ROS_DEBUG("no axis elemement for Joint link '%s', defaulting to (1,0,0) axis", this->name.c_str());
this->axis = Vector3(1.0, 0.0, 0.0);
}
else{
if (!axis_xml->Attribute("xyz")){
ROS_ERROR("no xyz attribute for axis element for Joint link '%s'", this->name.c_str());
}
else {
if (!this->axis.init(axis_xml->Attribute("xyz")))
{
if (this->type == PLANAR)
ROS_DEBUG("PLANAR Joint '%s' will require an axis tag in the future which indicates the surface normal of the plane.", this->name.c_str());
else
{
ROS_ERROR("Malformed axis element for joint '%s'", this->name.c_str());
this->axis.clear();
@ -494,7 +493,6 @@ bool Joint::initXml(TiXmlElement* config)
}
}
}
}
// Get limit
TiXmlElement *limit_xml = config->FirstChildElement("limit");