Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove magic nrs from link/joint property 'loadData(..)' methods #83

Open
gavanderhoorn opened this issue Apr 25, 2016 · 1 comment
Open

Comments

@gavanderhoorn
Copy link
Member

Example: LinkGeometryProperty::loadData() (here):

        else if (geometry_->type == urdf::Geometry::MESH)
        {
          [..]
          if (name == "Scale")
          {
            //Remaining sub-properties are for Mesh
            QList<QtProperty *> sub_items =  top_item_ ->subProperties()[2]->subProperties();
            [..]
          }
        }

The assumption here is that mesh sub properties are always at index 3, which is not under this applications control, and may thus change at any time.

At a minimum, the magic number (2) should be removed and a named constant used. Ideally -- if possible -- the sub properties of top_item_ should be searched for the Mesh properties, and that index should be used.

@gavanderhoorn
Copy link
Member Author

Related: #79.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant