-
Notifications
You must be signed in to change notification settings - Fork 103
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
Velocity seems to be set to 0 after detaching #26
Comments
It's quite possible I haven't considered this. Detachment is handled here - ignore the I don't have time this week to check up on this but will try as soon as I can, if you haven't solved it until then. |
Okay, so I've had no experience with Gazebo plugins before and naively tried to set the object link's velocity to its previous, without seeing a change in behavior:
Then, when checking the velocities of the link before and after Note, that I am using Gazebo9 with the plugin modifications from the open pull request in this repo, so the method names should be |
I'm not sure about In any case, you need to set the velocity to the link of your object (the root link of all the object parts). If it doesn't have an easy to recognize name in your SDF/URDF, then maybe give it one for testing, and make sure this is the link you are setting the velocity to. Another thing to consider is the object properties, like weight. Once the object is detached, it will be subject to gravity again. So if it's very heavy and the speed isn't that high, it would fall to the ground pretty quickly, maybe the linear velocity won't be noticed as much then, as the gravity force pulling it causes it to change too much? |
BTW, if you are using the open pull request, I guess you reverted the faulty commits at the end, which were done automatically by verifying the suggestions I wrote in the discussion (which were meant to be like pseudo code only, but then they were commited). I guess so, otherwise it probably wouldn't be compiling... |
Yes, it's the same object/scope and yes, it does have velocity before. My object is just a box, so there is only one link, which is the parent of I'm using an earlier commit of the PR, where everything version-related was enclosed by |
Ok, so unfortunately it also doesn't seem to work when restoring the velocity after this line. |
Hi, |
I tried setting an arbitrary velocity at the end of |
Hmmm... maybe the velocity of links which are attached to a moving joint are not updated, though I would have thought so. Sorry I'm being so slow on testing this, I had too much work to get done, and tomorrow I'm going away for a week. I still have this on my radar, and eventually I will get to test this. Meanwhile, let me know if you find out more. My first thought would be to check the links of the gripper while they are moving obviously fast, and see if they have a reasonable velocity. Just to confirm whether links attached to moving joints have a realistic world velocity. Next step would be to look up in the Gazebo code how exactly the velocity of Links is updated. I can't remember exactly how it worked, but a look at the code will tell the truth ;) One other random try would also be to try a different physics engine (e.g. |
I appreciate every bit of work and help that you put into this and right now this is also not my main work, so I'm also kinda slow on this. But I just plotted the velocity of the link of the object and of the gripper (inside Gazebo).
|
So for another simple test I printed out the velocities retrieved by |
Hi, so finally I got a spare hour to check this ;) I've just used my Jaco test setup to test this, and I printed the velocities. For me they actually make sense - only while the object is not moving, there is still a very small (insignificant) velocity. However I've so far only tested it on my current work computer with Indigo with the default install of Gazebo 2, which is ancient. I will test it with a newer Gazebo version and report back. Meanwhile, can you check if the velocities still remain insignificant for you, if possible with the Jaco arm. I've updated the code and you can use the same test prints in this line and here by just setting it to If you have also installed+compiled my grasp-execution-pkgs, then you can test easily on the Jaco like this:
and in another terminal, put all other commands to one line to save you some headaches ;) (you may need to adjust the sleep values if this doesn't go smooth for you):
You can release the cube with this:
although if the arm is still moving, it will stop to release the cube first, so you can't really throw it around with this test setup. However the velocities reported are exactly the same as before the detachment (even if small), so I think I wouldn't have the issue if the arm was moving. |
I just remembered my update will conflict with your settings because you're using the PR for melodic. I'm just processing that PR to finalise it actually, then you'll be able to use the new code on master directly. |
I have updated all my packages to support Melodic. You can now try again using all my master branches. |
I've just tested this again. The velocity values while the object is moving actually make sense (using the test setup with the Jaco mentioned above):
And just when detaching, it seems to go down a little bit when the object isn't touching the gripper any more, but still BEFORE it is detached (as said, unfortunately detaching while the arm is moving doesn't work with my simple test setup, so the velocity is already low before detaching).
and right afterwards it starts to fall down:
Can you confirm this is similar on your setup, using the new versions of all my packages? (all on master branches) |
Ok, I created a new workspace with your jaco packages and got similar, reasonable results:
After that I replaced the new version of the grasp plugin in my other workspace. While compiling I got the following warning, which I got rid of by pointing cmake to the right places. They also occured when using the Jaco packages but there I got no error while starting Gazebo/loading the plugin (see below). Just mentioning it in case it might have to do with the issue.
So it compiles, but when I try to start Gazebo with our Franka robot in that workspace, gazebo crashes and I get the following info:
Which seems to coincide with line 259 in
The error occurs with or without setting the cmake variables before (re)compilation. Also after cleaning the workspace or adding our packages to the new jaco workspace, it still remained. But weirdly, it doesn't occur when starting gazebo with the jaco packages. |
Hi, |
Yes, I did. Unfortunately it persists, I even tried it on another machine (I was using the older version of the plugin there before, too, though). What's really weird is that the error doesn't occur with the Jaco, even in the same workspace. After all, it should do the same call... |
Hm that's weird. Your Franka repositories aren't public by any chance, so I could try to reproduce it? So it doesn't happen if you comment out |
Yeah, they are: https://github.com/sven-hoek/franka_ros I compiled it again, leaving |
That's then because it is having trouble with the gazebo::physics::Physics type itself. I'm just cloning the repo and will try as well. |
Ah silly me, I am currently finishing other work on Trusty. Here I've had trouble building libfranka so I didn't build all the franka_ros packages. franka_gazebo was OK but I can't run the launch file because of the dependencies I removed. Anyway the whole issue probably doesn't come up on Trusty anyway, so I'd rather test on Bionic once I reboot into it again. Meanwhile, general thoughts. If you still keep having the error
after you remove all the calls to GetPhysics() then something is truly weird. Maybe take out the call in GazeboGraspGripper too, to make sure that gzserver throws the lookup error at runtime, when it loads the grasp fix plugin. That could mean that either libgazebo_grasp_fix.so isn't linked up properly with libgazebo_version_helpers.so (but I dont' think so otherwise you'd have the problem with the Jaco too), or libgazebo_version_helpers.so are not in the LD_LIBRARY_PATH, or something like that (and also then, it's weird that you don't get that with Jaco). If you do |
Also, what's the output of
|
Hmmmmm I think I may just have found something which I noticed with
which doesn't include gazebo_version_helpers ! Though that still wouldn't explain why it works with the Jaco, how puzzling... It was a minor change in the gazebo_grasp_plugin CMakeLists.txt which changed this. Can you please pull gazebo-pkgs again and try again? |
Ok, now it runs again, thanks. With your diagnostic print I realized 2 unusual things:
|
Yes I've noticed the same steep drop in velocity just before detaching (as posted above) with the Jaco, not sure why this happens. It's still when the object is attached, but the gripper would have opened and would not be touching the cube any more. It may be a while before I get around to reboot into Bionic and test again, so hopefully I can help you with some suggestions and guess work in the meantime ;) First I would try to reduce the release tolerance (parameter Also, can you set this and this from 0 to 1 and post the output of that as well? Thanks :) |
It persists when I reduce the release tolerance:(
|
Hmmmm ok that's something that needs closer looking into, seems very strange. If you increase the release tolerance (even if it's so high it will never be released) and fully open the hand, does this steep drop still happen at some point? I'll have to look into this more, unfortunately I will probably not have time for that this week. Meanwhile, I hope you can work with it despite the velocity reduction? Or maybe you end up finding the reason for that weird behaviour, that would be great too :) |
The drop seems to be smaller but it seems to persist:
It happens right when opening the gripper (the messages stop afterwards but the object is not being detached). Like I said, I'm also mostly working on a different project but trying to make a little progress on this issue from time to time. I'm trying to get this running for other users who want to do throwing experiments using reinforcement learning. |
Thanks for testing this! |
The plugin seems to work pretty well but I was checking what happened, when the gripper opens while in motion. It seems that the gripped object's velocity is reset and falls straight down by gravity.
For example in situations, where the simulated robot is supposed to throw an object, it would be important, that the gripped object keeps its velocity.
The text was updated successfully, but these errors were encountered: