Skip to content

allow name mismatch when IAM_AllowRenaming is used#1188

Open
eisoku9618 wants to merge 2 commits intoproductionfrom
allow-name-with-empty
Open

allow name mismatch when IAM_AllowRenaming is used#1188
eisoku9618 wants to merge 2 commits intoproductionfrom
allow-name-with-empty

Conversation

@eisoku9618
Copy link
Copy Markdown
Collaborator

@eisoku9618 eisoku9618 commented Jan 11, 2023

{
  "name": "hello world file name",
  "keywords": [
    "part"
  ],
  "bodies": [
    {
      "name": "hello world body name",
      "links": [
        {
          "name": "hello world link name",
          "geometries": [
            {
              "type": "box",
              "halfExtents": [
                0.05,
                0.05,
                0.05
              ]
            }
          ]
        }
      ],
      "isRobot": false
    }
  ]
}

When I load this file to openrave environment, I get this error.

openravepy._openravepy_0_105.openravepy_int._OpenRAVEException: ('openrave (InvalidArguments): [virtual void Environment::UpdateFromInfo(const OpenRAVE::EnvironmentBase::EnvironmentBaseInfo&, std::vector<boost::shared_ptr<OpenRAVE::KinBody> >&, std::vector<boost::shared_ptr<OpenRAVE::KinBody> >&, std::vector<boost::shared_ptr<OpenRAVE::KinBody> >&, OpenRAVE::UpdateFromInfoMode):2987] pInitBody->GetName() == pKinBodyInfo->_name, (eval hello_world_body_name == hello world body name) names should be matching', 'InvalidArguments')

This is because when we add a kinbody in UpdateFromInfo() of environment-core.h, we use IAM_AllowRenaming for new body or robot, so name can be changed e.g. (white space) -> _ (underscore) but we compare the original name and the renamed name. For new body or robot, since we use IAM_AllowRenaming, we don't need to check name matching in that case.

@rdiankov
Copy link
Copy Markdown
Owner

not sure we should be supporting this case....
how about calling utils::ConvertToOpenRAVEName in UpdateFromInfo ?

@eisoku9618
Copy link
Copy Markdown
Collaborator Author

eisoku9618 commented Jan 11, 2023

@rdiankov Thank you for checking.

not sure we should be supporting this case....

There was a problem that a user used webapi to register an item with white spaces in the name and then our system does not start properly with that names should be matching exception. If openrave should not support this case, I think we should reject such a query in webapi side and change IAM_AllowRenaming to IAM_StrictNameChecking in UpdateFromInfo. Personally I prefer this (not supporting white spaces in openrave) because our registraion UI does not allow a user to input white spaces in bodies/name.

cc @woswos

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants