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

creating new elements end tag does not match #16

Open
BrentAChristensen opened this issue Apr 17, 2023 · 1 comment
Open

creating new elements end tag does not match #16

BrentAChristensen opened this issue Apr 17, 2023 · 1 comment

Comments

@BrentAChristensen
Copy link

When trying to create new elements the end tag sometimes does not match the start tag. If I create a new element named hardwareInterface, the end tag makes hardwareinterface. As you can see it made the entire word lower case. It appears the code is changing it to lower case. Also the transmission joint tag comes through as follows: <joint name="joint_1>. I tried a work around by creating my own elements, then I ran into the code making my end tag lower case.

@akhilsathuluri
Copy link

Hello, this issue is caused becuase of a small bug in the urdf generation where the explicitly named elements with element_name is overruled, for example in the case of a TransJoint. This line overrides the already mentioned name and simply reads the element name again, i.e., instead of reading it as joint, it reads it as transjoint, which causes the joint element to not close. This can be fixed by changing,

s +=" "*depth + "</" + type(self).__name__.lower() + ">\n"

to

s +=" "*depth + "</" + name + ">\n"

And to preserve the capitalisation of the tag of the hardwareInterface, youll need to simply make it into a named element by using the element_name argument.

Both of the issues are now fixed in the PR, which you can use if you still have the problem: a8df303

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

No branches or pull requests

2 participants