-
Notifications
You must be signed in to change notification settings - Fork 16
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
Modernize / Modularize xacro #120
Modernize / Modularize xacro #120
Conversation
461f2c7
to
91c2ecb
Compare
@beatrizleon: How can I access the results of the failing CI jobs at AWS? |
0d69acb
to
929fac3
Compare
I added a series of commits fixing most compatibility-test issues. The only remaining issue are some lost The good news is that processing the new robot URDFs yields the same results as in a741b66. |
I think I traced the problem to the presence of the include of the full_hand (defining the macro shadowhand) within the definition of the macro shadowhand there https://github.com/shadow-robot/sr_common/pull/120/files#diff-d505b43845bf4e41bf9a24883f9c24aef30837e1f512253f29313889990ce805R14 I was first surprised a macro redefinition was possible, so I tried to rename one of the macro either the exterior, or the interior one, but it does not change anything as long the include is inside the outer macro redefinition I find this already too tricky for me, so cannot provide a fix. I hope this pin pointing suffices to guide to a possible true cause (within xacro itself I suppose) |
@rhaschke I think I am done looking at the code and answering your questions. Everything I found was bad understanding of the code. sorry for the noise. |
Thanks for tracing this down! I will have a look. |
Indeed, the culprit was an issue in xacro: namespaces imported within a macro were not lifted. Fixed via ros/xacro#285. |
I would never have generated such a case my self as I would never have attempt redefining a macro that has the same name that itself calls the macro name. |
The problem was actually more fundamental: Any namespaces imported by a |
Thanks a lot. Do you mind to also formally approve this PR if you are fine with it? |
I cannot test it easily immediately, I need to update my noetic/focal install first. I did not prepare my PR for noetic so cannot know what else can happen without testing. |
Not trivial to me, but probably fine for python developers. |
Note that the noetic-devel branches of this package as well as of |
@rhaschke We were working on refactoring this repo with the help of @guihomework with the following purposes:
I had a work in progress branch: https://github.com/shadow-robot/sr_common/tree/F_refactoring_meshes. It was based on the changes that @guihomework did on his proposed branch which were really helpful. With this new refactoring, I will create a new branch based on this one and show you what is the idea. It will be great to improve this as it has lots of deprecated code, unused meshes, etc Thanks both for you help with this. It is going slowly because of my lack of time to spend coding but hopefully with all your help, we will be able to finish this refactoring soon. |
I checked the CI error and the issue is: |
pi is available globally in xacro as python's math.pi
I will shortly rebase this PR onto the latest noetic-devel and apply the announced squashes. |
Using `'text' in variable` is a rather sloppy equivalence check. This commit attempts to harden these checks using the following regexp replacements: - More specific test of hand_type ('hand.+?') in ([a-z_]+) -> $2.startswith($1) - More specific variable tests ('.+') in ([a-z_]+) -> $2 == $1
Improve extensibility (adding more sensors) by emloying an exclusive-if-and-final-else strategy, utilizing a helper variable. This way we avoid augmenting the list in the 'sensor in [...]' tests.
Use python's None value as default to know whether old parameters were specified.
- hand_mt -> muscletrans - hand_m -> muscle, regexp: (["' ])hand_m -> $1muscle - hand_e_plus -> motor+ - hand_e -> motor
As xacro returns unicode objects from property evaluations we cannot apply str.lower to them in Python 2.x In Python 3.x str and unicode is essentially the same.
516c5d2
to
a8fecfa
Compare
I factored out the ubi tactile sensor definitions and merged ubi-agni#3 |
<bumperTopicName>contacts/${prefix}th/middle</bumperTopicName> | ||
</plugin> | ||
</sensor> | ||
<selfCollide>true</selfCollide> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guihomework: This selfCollide
tag is part of the unless
clause here, while in all other places it's outside.
Is this one wrong here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it makes no sense to remove the selfcollide here and not at other places, yet another mistake of mine.
side note : I am not convinced anymore by the current set of true/false on the self collide in the fingers, but I think it is a tricky matter (at least I remember it was not obvious) and if the current set works one should not try change it.
I don't know why this is necessary, since shadow robot company supports the ubi sensors, even in the driver. |
As you said yourself: they can only be used with our custom urdf repos, which will never merged into public. |
Not exactly what I said : I said that the taxels cannot be used without our tactile_toolbox, and could maybe be removed, but the visual/collision of the ubi could stay there as they do not need the tactile_toolbox. They were merged by shadow there shadow-robot/sr-ros-interface#253 and there was a distinction in the urdf for ubi that I had added already at shadow-robot/sr-ros-interface#147 and was also accepted upstream. We always wanted to have as maximum things merged upstream as possible. If this an effort to now clean up their repo from tip sensor they do not sell, sure, then this the reason, but it is not a problem to have our visual tips even without tactile_toolbox. EDIT: one advantage of having ubi remain in the possible sensors, is that when they upgrade the package, they will take care of keeping the ubi sensor as part of the list/future new way of handling sensors, when if they do not see it, we will have more issues to upgrade in the future. |
As a maintainer, I wouldn't like to have external sources in my repo that I cannot validate. |
Use textual sensor specifications: - tip_sensors=bio - tip_sensors='th=bio, ff=bio, mf=std, rf=std, lf=none' - tip_sensors='bio, bio, std, std, none' - Rename backward_compat.urdf.xacro -> process_sensor_parameters.xacro - Introduce macro validate_tokens
3b49c7f
to
42cb509
Compare
I am working now in a branch, so give me a few days to finish this. About the hand_type, what we would like to have is: I am modifying them in the process_hand_type_parameter.xacro file. I wanted to ask you if you are still using a muscle or muscletrans hand? As I said before, we have only few clients with that and we are not currently supporting any. Same for the shadow arm. I would like to know if you need that we keep support for those |
@beatrizleon in place of the team in Paris UPMC who has a ShadowArm and won't probably notice those discussions here, I would say, either they should fork to keep it (please announce it to the customers), or your company should create a legacy sr_description package, with things that you supported in the past, but won't anymore. This way it stays visible (and not hidden in history that is no easy to find), in the state they are now. Regarding the muscle hands in my current team, I think they were never used with ROS, but the same about the meshes and URDFs as for the Shadow Muscle arm applies IMHO. If for any reason someone would like to integrate the muscles hands in ROS on his own, finding the resources without digging in history would be nice. |
I confirm that we never used the muscle hands with ROS (and probably won't do it).
If hand_lite and extra_lite only differ in a finger less, there is no need for another hand type. Fingers can be added or removed in a modular fashion in the xacro. I think you just need to distinguish the two different forearms. |
Thanks both. I will create the legacy repo and delete arm and muscle hands as it will be easier for us to not keep this compatibility with things that nobody needs. |
Dear @beatrizleon, skimming through your changes in 417b7a0, I noticed the following potential issues:
In general, it was rather hard to review your single commit. It would be helpful if you could split commits into smaller units with a commit message clearly stating what has changed. |
This is the new PR replacing #109 / #113 already announced in #113 (review).
Summary
The key goal followed by the restructuring is a simple and scalable approach to specify different hand variants.
Until, for each variant essentially a separate xacro file was required. With this PR, we can essentially resolve everything using either
full_hand.urdf.xacro
orhand_lite.urdf.xacro
. Using the macro parameterfingers
one can specify which fingers are needed. With parameters[tip|mid|prox]_sensor(s)
one can choose individual (tactile) sensors. The already existing variablehand_type
can now also be used to specifymuscle
ormuscletrans
hands.Changes w.r.t. #109 / #113:
redefining global symbol: pi
ubi_tactiles
The test introduced in F#98 modular xacros #109 was just ensuring that the xacros can be processed at all.
TODOs:
xmlns
attributes (see Modernize / Modularize xacro #120 (comment)).Thanks to @guihomework analysis, I was able to fix the remaining problem with a fix in xacro:
TEMP
. They just illustrate the progress of the compatibility test.I kept the original, unsquashed version of this PR in https://github.com/ubi-agni/sr_common/tree/PR%23120-long.
One can easily validate the backward compatibility there by inspecting the history of
test/robots.urdf
tip_sensors[2]
becomestip_sensor.mf
. Argument would be passed astip_sensors=${dict(th='bio', mf='std', rf='eli')}
.To simplify for the common case of identical values, we could also think of some internal property re-assignment to allow for
tip_sensors=bio
.hand_type
naming: Modernize / Modularize xacro #120 (comment)