Fix bug that allowed parent links of a joint to be automatically added, #4198
This commit is contained in:
parent
d99805a47c
commit
6c67fc7b04
|
@ -290,13 +290,8 @@ bool Model::initTree(std::map<std::string, std::string> &parent_link_tree)
|
||||||
this->getLink(parent_link_name, parent_link);
|
this->getLink(parent_link_name, parent_link);
|
||||||
if (!parent_link)
|
if (!parent_link)
|
||||||
{
|
{
|
||||||
ROS_DEBUG(" parent link '%s' of joint '%s' not found. Automatically adding it. This must be the root link",
|
ROS_ERROR(" parent link '%s' of joint '%s' not found. The Boxturtle urdf parser used to automatically add this link for you, but this is not valid according to the URDF spec. Every link you refer to from a joint needs to be explicitly defined in the robot description. To fix this problem you can either remove this joint from your urdf file, or add \"<link name=\"%s\" />\" to your urdf file.", parent_link_name.c_str(), joint->first.c_str(), parent_link_name.c_str() );
|
||||||
parent_link_name.c_str(), joint->first.c_str() );
|
return false;
|
||||||
|
|
||||||
parent_link.reset(new Link);
|
|
||||||
parent_link->name = parent_link_name;
|
|
||||||
this->links_.insert(make_pair(parent_link->name, parent_link));
|
|
||||||
ROS_DEBUG(" successfully added new link '%s'", parent_link->name.c_str());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//set parent link for child link
|
//set parent link for child link
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue