{"action":"created","issue":{"url":"https://api.github.com/repos/CentroEPiaggio/kuka-lwr/issues/42","labels_url":"https://api.github.com/repos/CentroEPiaggio/kuka-lwr/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/CentroEPiaggio/kuka-lwr/issues/42/comments","events_url":"https://api.github.com/repos/CentroEPiaggio/kuka-lwr/issues/42/events","html_url":"https://github.com/CentroEPiaggio/kuka-lwr/pull/42","id":93115808,"number":42,"title":"[lwr_hw] enhancement","user":{"login":"carlosjoserg","id":4049053,"avatar_url":"https://avatars.githubusercontent.com/u/4049053?v=3","gravatar_id":"","url":"https://api.github.com/users/carlosjoserg","html_url":"https://github.com/carlosjoserg","followers_url":"https://api.github.com/users/carlosjoserg/followers","following_url":"https://api.github.com/users/carlosjoserg/following{/other_user}","gists_url":"https://api.github.com/users/carlosjoserg/gists{/gist_id}","starred_url":"https://api.github.com/users/carlosjoserg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlosjoserg/subscriptions","organizations_url":"https://api.github.com/users/carlosjoserg/orgs","repos_url":"https://api.github.com/users/carlosjoserg/repos","events_url":"https://api.github.com/users/carlosjoserg/events{/privacy}","received_events_url":"https://api.github.com/users/carlosjoserg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-05T14:25:06Z","updated_at":"2015-07-13T15:29:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CentroEPiaggio/kuka-lwr/pulls/42","html_url":"https://github.com/CentroEPiaggio/kuka-lwr/pull/42","diff_url":"https://github.com/CentroEPiaggio/kuka-lwr/pull/42.diff","patch_url":"https://github.com/CentroEPiaggio/kuka-lwr/pull/42.patch"},"body":":hammer: in progress...\r\n\r\nThe most important changes concern the [lwr_hw] package. The other ones are a consequence of those changes. \r\n\r\nA good consequence is that this does not depend in the fork of ros control, since the lwr_hw_sim plugin knows the urdf naming convention and the number of joints, so it only suffices to have the name of the robot, and all joint names are known for that instance of the arm, and the transmissions are filtered out according to that value, see [here](https://github.com/CentroEPiaggio/kuka-lwr/compare/master...carlosjoserg:lwr_hw_enhancement?expand=1#diff-0b05ab056722ad0c5feed41c5f8bd105R292).\r\n\r\nAs described in https://github.com/CentroEPiaggio/kuka-lwr/issues/19#issuecomment-115153852, the package uses the joint command interfaces as a (temporal) solution to switching control strategies. I think a more suitable way would be to develop either a ImpedanceJointInterface that expose the FRI command values and use a controller, or having Pos, Sitff and Damping as dynamic paramters of all controllers when switching to EffortJointInterface (hence JOINT_IMPEDANCE -> Strategy 30 in FRI) as the PID gains, or wait for something like a [joint_mode_controller](https://github.com/pal-robotics-forks/ros_controllers/pull/41).\r\n\r\nIn the meantime, the drawback is that I couldn't find a way to have more than one controller to act in a commanding interfaces, so the old `joint_position_controller` and `joint_stiffness_controller` can work simultaneously, since the first triggers the strategy 10 (in fact, the latter as well as it uses the `PositionJointInterface`, but it'll do nothing because those commands will not be written to the robot, real & sim)\r\n\r\nATTENTION: I haven't tried the new single script because I'm not in the lab, but I will tomorrow and come back, but in the meantime I thought you might be reviewing the changes.\r\n\r\nComments are very well welcome ! "},"comment":{"url":"https://api.github.com/repos/CentroEPiaggio/kuka-lwr/issues/comments/120968508","html_url":"https://github.com/CentroEPiaggio/kuka-lwr/pull/42#issuecomment-120968508","issue_url":"https://api.github.com/repos/CentroEPiaggio/kuka-lwr/issues/42","id":120968508,"user":{"login":"carlosjoserg","id":4049053,"avatar_url":"https://avatars.githubusercontent.com/u/4049053?v=3","gravatar_id":"","url":"https://api.github.com/users/carlosjoserg","html_url":"https://github.com/carlosjoserg","followers_url":"https://api.github.com/users/carlosjoserg/followers","following_url":"https://api.github.com/users/carlosjoserg/following{/other_user}","gists_url":"https://api.github.com/users/carlosjoserg/gists{/gist_id}","starred_url":"https://api.github.com/users/carlosjoserg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlosjoserg/subscriptions","organizations_url":"https://api.github.com/users/carlosjoserg/orgs","repos_url":"https://api.github.com/users/carlosjoserg/repos","events_url":"https://api.github.com/users/carlosjoserg/events{/privacy}","received_events_url":"https://api.github.com/users/carlosjoserg/received_events","type":"User","site_admin":false},"created_at":"2015-07-13T15:29:43Z","updated_at":"2015-07-13T15:29:43Z","body":"What remains, just need to think of how to deal with 3 things:\r\n\r\n- Control cycle: For controller switch, I couldn't do it under 20ms without errors. However, without switching, stuff can run at 2ms. Perhaps I can't escape from having two scripts!\r\n- The updated gravity compensation controller (I know it is useful to you right now) uses the EffortJointInterface that triggers the FRI joint impedance strategy with default values, see [here](https://github.com/carlosjoserg/kuka-lwr/blob/lwr_hw_enhancement/lwr_hw/include/lwr_hw/lwr_hw_fri.hpp#L120) and sends 0.0 torque  [here](https://github.com/carlosjoserg/kuka-lwr/blob/lwr_hw_enhancement/lwr_controllers/src/gravity_compensation.cpp#L44), but the behavior is not so smooth due to the 20ms I believe.\r\n- [Optional] The update allows to add very quickly other interfaces, for instance, I started working on the Stanford FRI, but there is an issue with sudoing, which is not good for ROS.\r\n\r\n---\r\nOne more thing, I like minimal interfaces in general, specially to the urdf model, but I'm thinking that, due to robot composability issues, it might be useful to have a flag to load or not the kuka plugin when you instantiate the model (default: true, of course), i.e. something like:\r\n```\r\n<xacro:kuka_lwr parent=\"box\" name=\"lwr\" loadGazeboPlugin=\"true\">\r\n\t<origin xyz=\"0 0 1\" rpy=\"0 0 0\"/>\r\n</xacro:kuka_lwr>\r\n```\r\n\r\nAny ideas?\r\n"}}