-
Notifications
You must be signed in to change notification settings - Fork 12
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
Introduce kuka lwr4+ with shadow combination #333
Comments
I understood that I don't have permission to create branches in this repository, I will fork, and push my changes there. |
We are really interested in knowing how advanced is this kuka+shadow combination ? is this already done ? We worked on that too. |
There is a pretty complete ros package for kuka here: I hope to have it completely integrated it with Shadow (gazebo, ros_control, etc) mainly for simulation, pretty much similarly to what was done for ur10 and shadow hand. It is not already done, but I am working on it as a part of the RAMCIP project, where SHADOW is also involved. At what point did you reach? What was your approach? Do you have any code available? Cheers! |
@nrontsis Yes, I think a fork would be the best way. About our work with the UR10 just let me point out that we have been using a fork of universal_robot (https://github.com/shadow-robot/universal_robot) and we are using 2 different branches there:
The main reason to create these branches was to replace the transmissions in the arm robot description, so that they are children of Our real time loop and our sr_gazebo_plugin only work with |
I uploaded an initial attempt. You should install the following (careful at the branches) https://github.com/nrontsis/kuka-lwr/tree/adaptations_for_SHADOW Then you can execute: However, just to see how far this can go without a lot of changes, one can do the following: Running again Therefore, to my point of view, three issues should be solved:
Edit: @toliver, earlier this week @ugocupcic mentioned me these issues (https://github.com/shadow-robot/ramcip/issues/24), which I tried to incorporate in my fork https://github.com/nrontsis/kuka-lwr/tree/adaptations_for_SHADOW . Feel free to check them and comment if something doesn't seem correct to you :) |
Hi, @nrontsis we have seen this kuka package too (and might migrate to it, are you developing that or just using ?), but we currently rely only on a kuka URDF and some controllers from https://github.com/RCPRG-ros-pkg because we have orocos control for the kukas. The fact that shadow hand do not run run with a simulated ros_control (see previous message from @toliver) yet was a reason we did not switch to kuka with ros_control. So our solution for arm+hands is not on ros_control integration but cleaner and generic robot_description generation (and soon moveit generation). We wanted to avoid repeating the same robot_description for different setups everytime, and use templates and wrappers. This cleaner solution heavily relies on new features of xacro (handling python evaluation), which is released in jade-devel but perfectly compiles and runs on indigo-devel. If you and shadow are interested we will create and release a sample package deploying robot_description for an arm and hand robot. Then sr_multi_description could migrate to this new way of deploying combined arm and tools. |
@guihomework We are indeed interested in knowing more about your generic robot_description and moveit generation. Having a moveit configuration per robot combination is certainly not an easily maintainable solution. |
@guihomework No I am not developing it, I am just using it. |
@nrontsis , @iSaran and I might try to run your kuka+shadow in gazebo tomorrow. About the controllers, have you tried to define and launch a trajectory controller like the one in https://github.com/shadow-robot/sr-ros-interface/blob/indigo-devel/sr_robot_launch/config/gazebo/controller/ra_trajectory_controller.yaml That is what we use to control the simulated UR10. |
I have a new version: It launches the controllers, and removes the stiffness joints and dummy links that caused problems in the Running |
I am working on a manipulators_description package that will be uploaded soon on our github. Stay tuned |
@ugocupcic I currently avoid the problem by removing the stiffness joints. This, to my understanding, can work fine as a temporary solution, but only in simulation. However, it would be really nice to be able to use the original So currently I will wait for SHADOW to get rid of |
Spawning 2 robots, i.e. the arm, and then the hand on top of it, was almost impossible and not intuitive to me. So let me explain my solution (it does not avoid the joint state merging though). IMO, the best thing to do is to work with the So, I took the plugin code and added these lines (you can see it as well for the Pisa/IIT SoftHand here). This change required a small modification of the Another approach is to use a parameter to filter joints, as in the COB's plugins. At first I didn't like it, but actually, this is not a bad idea if you have joints that do not have a corresponding transmission specification, and it does not requires the change in the transmisison_interface package. It will require a modification of the Drawback of both (for now) is that you have a controller manager per robot, so commands are not synced (this happens with the real robot as well, but for the freqs. I'm using this is not a problem). You also get joint states for each robot that you need to merge for visualization, moveit, etc.. The sync issue can be solved either by writing one single HW interface for the composed robot, not easy to develop and maintain, or ideally, compose the HW interfaces (in real and sim). The latter is being discussed in multiple places, you can see one in ros-controls/ros_control#75 SO, apologies for the long post, final comment. For now, I think that having an |
@carlosjoserg thanks for the pointers. Upgrading our transmissions to the transmission interface is in our TODO list. We just haven't had time to start on this yet. Hoping to start on it this week. |
I woul like to add some comments to that topic too as we also use a kuka + shadow hand here. @ugocupcic you think (from the CentroEPiaggio/kuka-lwr#29) that merging the joint states is a nightmare. Commanding is also an issue, when joints you want to control for a group span across two robots, one of which is not on ros_control at least. Of course cleaning up the transmission format at the shadow side is a nice solution but might not be sufficient for other robot arms using a non-ros-control-compatible interface. Should we impose ros_control compatibility everywhere (is this still in beta ?) or find a way to make things cooperate without changing everything to that standard ? |
If you haven't read it, I think you will find this discussion interesting: https://groups.google.com/forum/#!topic/ros-sig-robot-control/qUAnF6enTUo In my case, the decision was clear before reading that (and after trying orocos to move the arm with existing open-source projects), but that confirmed that I made a good decision for my use cases. ros_control has not reached v1.0 yet, but it is active and very well supported, and despite some naming conventions due to inheritance from pr2 stuff that can be misleading, it is simple to understand... I need no more. |
@carlosjoserg thanks for the link to that discussion. I think from the comparison done there, it all depends the use case indeed. We need to do complex controller setup so orocos was the way to go and Shadow not being fully standard ros_control capable (gazebo plugin, and some transmission issues) led us to use two controller managers in two namespaces To come back to the question how to combine an arm with the shadow hand. There are currently good motivation to fix the shadow side, at least two arms (kuka and ur10) are using ros_control and proved to be incompatible if run in the same namespace.
|
Yes. If you manage to pass to the Shadow plugin only Shadow transmissions, and the third-party plugins focus only on third-party transmissions, the problem would be solved. The issue comes, I think, when both Shadow and third-party use the same tag name Perhaps the solution is in the answer to the last question in this comment.
I'm unaware of the ur10 plugin implementation, but very likely that the package uses the default gazebo_ros_control interface, which in turn uses transmissions to generate the handles, and reads from
I believe so, but I don't see any problem, you can wrap your transmission implementation with the ros_controls/transmission_interface if you want both to coexist, and select one or the other with xacro arguments.
I couldn't spawn the hand on top of the arm and keep them attached while the arm moved, can you? Besides, if you want to compensate gravity, the arm must know what's on top of it as well (unless you have adaptive controllers). Having a full robot_description is also useful for MoveIt!, and plan dual arm motions.
How do you generate the |
Dear @carlosjoserg, thanks for your comments. This is actually the only solution we found without modifying code. We would be happy to use a simpler solution. Your idea of parsing the full description is simpler in the robot_description to load but requires maybe more care on the plugins and at some point my break again on a fancy transmission or so. @nrontsis I will add a second robot to the example manipulators_description package to cover more case, and will upload that very soon. Probably also adding example launch files to show how we proceeded. |
Sorry for the delay, you went a little too far for me, and I postponed my reply until I had time to read your comments thoroughly. @carlosjoserg Thank you for the detailed comments. From my understanding, mounting shadow to kuka could work without the modification (removing stiffness joints, removing gazebo plugin, and changing transmissions) I did to kuka-lwr. Therefore, I will close this PR. However, as I am currently rushing to catch a deadline that includes some simulations with the kuka+shadow combination, I will continue working on my solution for the next week, and then I will possibly come back to ask you problems that concern the more proper way to integrate them. @guihomework Any example would be helpful. Currently I am struggling to understand your comments, (both yours @guihomework and @carlosjoserg) so having an example would definitely help me understand your point of view. |
The thing is that you modified the kuka description to use the SR transmission types so the SR plugin didn't crash, but it should be the opposite way, specially if SR is already working on porting thier transmissions to the ros control transmission package in #307. I don't know how the SR plugin is implemented but probably is doing similar to the IMHO, a good solution should look in the direction of composing hardware instead of modifying. So... What @guihomework suggests is to have a full robot description for moveit, rviz, gazebo spawn, etc. and then separate robot descriptions for each sub-robot, in this case kuka arm and shadow hand so the plugins focus on the joints they have to. This is achieved using xacro substitution args. What I'm doing in CentroEPiaggio/kuka-lwr#42 is to create a kuka plugin, that instantiate an object of the abstract class lwr_hw that takes care of recognizing the kuka joints given the robot name. The plugin actually uses the derived-class that has the hooks to gazebo lwr_hw_sim. So, the transmissions are selected within the hardware interface by using the joint names and not the opposite as done in the |
@nrontsis I was too busy to finish the manipulators_description package I would like to share, that would include both a nice way to generate multi robot description but also would provice launch files examples. as a summary :
I had to add files to instantiate right robots that do not exist in the original ur_description or sr_description to get the right prefixes also for the separate robot_description. In my future package this will be easier to implement with helper xacros. Had to do a very small change in moveit controllers.yaml to tell the controllers are now in namespaces ra/ and rh/ I could move both arm and hand via the rqt joint_trajectory_controller plugin and most of all this now works with the original unmodified ur_description (and surprizingly also with the modified one with sr_transmissions) I was almost sure it would work with gazebo_ros_control plugin the same ways it works for our FRI plugin but with this example I am 100% sure. I hope this clarifies our technique. |
I think I found one limitation of our method separating the plugins (robot_description) in namespaces. Now the arm plugin is not aware of the hand chain since it has its own separate robot_description containing the arm only, and hence has no information about the payload (mass, cog) it is handling. In the real kuka, everything is static as we had to give the tool mass and COG to get a nice gravity compensation at first and nice movements as well, so the simulation mode should have that too imho. Does this make sense ? |
Yep, I always thought the same.
No, it is not automatically handled, howoever, it is possible to do it because, yes, we have the whole chain in a single URDF. That's gravity compensation with a known model, that is, until the last link of the arm so far. If you know the model, you can add a dummy tip link without geometry and set its inertial properties according to the tool you mount in as you do in the teach pendant FRI. Or you can parse what's after the arm last link with KDL and compute mass, COG and even inertia, of the chain/tree upstream as a point-mass. If you don't know the model, you can use 3 static poses (as FRI does too) to determine mass&COG (inertia is much more complicate), or you can write an adaptive controller to estimate all dynamic parameters while the robot moves (including the robot itself) It's all in ideas, no code so far.
IMHO, it is really hard to have one single generic plugin that rules it all. I think that each piece of hardware should have a plugin that replicates the important details of it, and that's what I'm aiming for by not using the gazebo_ros_control plugin. The composability is another story, but happens also in reality.
The idea for our kuka package is that the dependency on the FRI setup be zero. In the impedance mode, there is a plan to cancel the gravity term (which uses the tool definition from FRI), and send it from ROS (using xacro, yaml, urdf, code, still to decide)
Yes, it is all about minimizing the efforts to sync simulation and reality, you will see it with the kuka after I merge CentroEPiaggio/kuka-lwr#42 |
Thanks @carlosjoserg for the detailed possible techniques, I already coded the reading of static parameters for payload mass&COG and it might probably suffice for now as we do not plan (yet) to do complex and fast movements with our kuka+shadow. At ISIR https://github.com/kuka-isir/rtt_lwr they use a F/T sensor at the end-effector to dynamically compensate for external forces of the payload and close the loop through OROCOS. Of course this requires exactly what you mention, namely cancel the gravity term from FRI to add your own. This is what they do there too. I will follow your work and the one at ISIR, but for the time being I will stay on the code I derived from RCPRG https://github.com/RCPRG-ros-pkg/lwr_robot (running orocos, and merging real and simulation behind FRI protocol) that runs nice in a separate namespace. I hope this discussion also helps the Shadow team (and others) to view the different techniques and their advantages/disadvantages |
I plan to extend sr_multi_description, sr_robot_launch in order to include a kuka+shadow combination.
The text was updated successfully, but these errors were encountered: