-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add support for modifying link parent-child relationships through the UI #26
Comments
in both cases validity of the tree will need to be maintained. Two possible cases:
Option 1 is relatively easy: parent becomes child. Option 2 is more difficult: we can insert the link (together with a new joint) in the tree at the place where it is dropped, but what should be done with the |
If I understand the last comment, option 2 seems to assume a different tree structure then what currently exists where things are listed as As it is implemented now, we have a list of The Changing the order of joints in the Am I interpreting this correctly? |
The enhancement would indeed be to allow re-arranging the actual structure of the urdf, ie: changing parent-child relationships. As you noticed, re-ordering the links under Links does not really do that (and it doesn't even really change the order of
I'm not sure I completely understand this: why do you think all downstream joints would need to be updated? I'd assume only immediate children of the changed joint would be affected? Or were you referring to those as downstream (and not all joints in the sub tree starting at the changed joint)? |
yes, sorry, that is what i meant: any downstream affected joints. So then the goal of this ticket is to be able to move/adjust the order of joints in the |
Yes, that is the idea of the ticket. It's essentially an alternative way to do the same as in #48, but now with drag-and-drop, instead of dropdowns in the property browser widget. |
So let's ground this in an example, cause it's not clear to me what the resultant urdf should look like when we move a joint. Let's say we have a chain that looks like this:
I'm not entirely sure what the desired/best resultant behavior is when doing this. 1) has the advantage of producing a valid chain, but the joints between where the joint was taken from and where it was inserted get affected in ways I don't think is appropriate (in the example, why should The other thing to consider is how we (could) drag and drop links. There isn't a way to do this right now cause the links in the tree view are just listed in isolation as mentioned in a previous comment. If the chains were displayed in terms of links instead of joints (which they arguably should be), then moving a link to a new location would require the user to set the requisite parent/child relationships of affected joints, but I also don't really see how to do this "automatically" unless the link takes its child joint with it. For example, consider moved Is what we ultimately want here a chain that has both joints and links and looks similar to the examples I wrote above? In this case, you could select some adjacent set of joints and links as a block and move them in their entirety to a new location, and then "rewiring" the parent and child relationships accordingly. Thoughts? |
There are indeed two options (conceptually):
Removing links or joints was never intended. Perhaps we can make the idea of this issue/requirement more clear if we describe it as "re-parenting sub trees of the urdf". Dragging a link (and I agree with you, the chain (if we keep it) should display This would be analogous to dragging and dropping directories in a file manager: all contents of the directory (files and any sub directories) will also be reparented (but basically because they only have one parent, namely the directory that was moved). Conceptually, this would also cover the use-case where we want to be able to import and then attach 'sub urdfs/xacros', as is requested in #34. |
Ok, this is much clearer now. However, as stated, this suggests that both 1 and 2 are not currently possible with chains of Also, thinking of it as a directory move mad this much clearer to me. Thanks |
This now good to go @swhart115. #73 fixed the tree. |
is there a preference for having up/down buttons for each |
I agree this doesn't look good. But the buttons weren't a requirement, it was just meant as an example of how parent-child relationships could be manipulated through the gui. From your earlier comments I understood that you wanted to go the drag-and-drop route. That would have my personal preference. Do you feel the buttons idea is better / more user-friendly? |
@swhart115 wrote:
It'd be nice to have multiple ways to interact with the tree, but it's really not a requirement. I only listed buttons and drag-and-drop as options. I certainly did not mean that both are required. Seeing your prototypes, I feel drag-and-drop will make for a more intuitive UI actually. |
Ok, no problem. I'll focus on that then. On Sun, Apr 24, 2016 at 7:46 AM G.A. vd. Hoorn notifications@github.com
|
I believe I have this working, with the exception of updating the Joint tree to reflect the new Link structure (post drag and drop). I'm still not convinced the Joints should be arranged in a tree structure, as we discussed above. I would think an arrangement where Links are arranged in a tree, Joints are listed flatly, and the parent/child joints are displayed as (text) properties of the Links might make more sense. Thoughts on this? |
yeah, I've been thinking about that as well, and I think Re-arranging parents/children should be done using the
I'm not sure I can picture this: "parent/child [..] displayed as (text) properties"? Is that different from what we have now (apart from the dropdowns)? Could you clarify? Updating the tree post drag-drop should be a matter of shuffling the parent-child relationships of the |
what i mean is to add attributes to LinkProperty for "Parent" (that lists its parent joint), and "Children" (that lists all of its children joints). Although this info is not stored in the URDF, it is stored in the urdf::Link, and is the dual of the parent/joint properties of the joints that are displayed in our program. I'm almost done with the re-shuffling (I have it working for updating the parent/child vars for the joints, and i'm working on updating the child_joint array and parent vars for the links, it's just nastier in terms of boost ptrs.) I hopefully will finish today and put in a PR for testing. |
I have this working with the exception of dealing with rearranging the root link, but I had a question on how to deal with this. Some background: currently, you can drag links However, when dealing with the root link, it gets trickier because valid URDFs only allow one such root link. So there are two behaviors to consider:
Note that if we don't allow 1), then 2) would be the only way to create a new root link. Alternatively, we could allow 1), but not 2), and therefore allow temporarily invalid trees. I would vote for the latter option cause its easier to implement, even if the URDF is not valid. Opinions? |
I think option 1 makes the most sense: we'd end up (temporarily) with a forest of two trees, but as you write, the user should rectify this by re-attaching one of the trees to the other. It would be nice if we could give an indication to the user that this is what he/she must do. Right now this would probably just result in some warning being printed on the console, but some kind of message in the UI that the current model is invalid (maybe a statusbar updated? Taking the error message from the parser?) would be really needed. An option would be to create a signal ( re: disallowing option 2: yes, I'd be in favour of that. Can we ignore the drop event if it is not on a child of |
actually, as i think about it more, i'm not sure the insertion option ( 2) in my last comment ) makes sense because of the case where the dragged subtree has multiple leaf node links. In this case it isnt clear where the old root link should be moved to. Given that this is the case, it really seems like allowing an invalid URDF structure (where there are multiple root links) is the most straight forward way of dealing with this, putting the impetus on the user to (then) fix the tree, or on the program to catch this on "save". |
sorry, didn't see your last post till after i posted my last post.... So i think we are in agreement. Is it alright if I finish with the implementation of 1) with just a command line output saying that the tree is invalid and push that through as a PR for the sake of the milestone 1 deadline? The embellishments could be further tickets/work. In my implementation I already filter out "bad" drops. Providing feedback during a drag is do-able is straightforward as well. |
@swhart115 wrote:
I wouldn't necessarily call them 'embellishments': without those a user may become rather confused as to why his visualisation isn't updating. Especially if they don't check the console. But let's leave the warning for later.
I wasn't necessarily referring to bad drops, but more real-time feedback showing whether a drop is allowed in a certain place in the tree. |
@gavanderhoorn Unfortunately, I can't reproduce the dropping of links outside the URDF tree issue you mentioned during the telecon. My mouse cursor changes to the "prohibited" icon when i leave the tree and won't register any of the (drop) events (and the links stay where they were). |
yes, it's the same for me, unless I try to drag outside the application window (so onto my desktop fi). I get a cursor which is essentially a 'plus sign', and after releasing the mouse button, the links are removed from the tree and disappear. |
yeah, this isn't happening for me when i hover over the desktop or folders on my desktop or other applications or anything. This is odd. I'm assuming you are using standard Ubuntu? Here is a quick video showing how I can't drop a link on my desktop: |
Just tried this again and can't reproduce it anymore, so let's ignore for now. If this becomes a problem we'll revisit it. I also had the tree not updating sometimes after a drop, so perhaps I got it into a weird state or something. |
Allow arbitrary re-ordering of links and joints using the property tree widget.
Options:
The text was updated successfully, but these errors were encountered: