Skip to content

Commit

Permalink
validate link has parent
Browse files Browse the repository at this point in the history
  • Loading branch information
MarqRazz committed Jan 24, 2024
1 parent 3d1d0b1 commit bb6b86f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions moveit_core/robot_model/src/joint_model_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,9 @@ JointModelGroup::JointModelGroup(const std::string& group_name, const srdf::Mode
{
link_model_map_[link_model->getName()] = link_model;
link_model_name_vector_.push_back(link_model->getName());
// if this is the first link of the group with geometry (for example `base_link`) it should included
if (link_model_with_geometry_vector_.empty() && !link_model->getParentLinkModel()->getShapes().empty())
// if this is the first link of the group with a valid parent and includes geometry (for example `base_link`) it should included
if (link_model_with_geometry_vector_.empty() && link_model->getParentLinkModel() &&
!link_model->getParentLinkModel()->getShapes().empty())
{
link_model_with_geometry_vector_.push_back(link_model->getParentLinkModel());
link_model_with_geometry_name_vector_.push_back(link_model->getParentLinkModel()->getName());
Expand Down

0 comments on commit bb6b86f

Please sign in to comment.