Skip to content
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

First set of proposed msgs for setting up Cartesian Impedance parameters #1

Closed
wants to merge 14 commits into from

Conversation

rkojcev
Copy link
Collaborator

@rkojcev rkojcev commented Jun 9, 2016

No description provided.

# [N/m]
geometry_msgs/Vector3 translational
# [Nm/rad]
geometry_msgs/Vector3 rotational
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this context, what does rotational damping mean? I assume it's dampening about the fixed frame axes? Is there any confusion/issues like those associated with euler angles (i.e. order of application)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right Shaun. Is dampening about the fixed frame axes. These values are usually consistent and each value during the motion is constant, so there are no singularities that come with Euler angles actually these are just constants which are used to define the properties of the Spring when the robot is in Cartesian Impedance Mode.

@gavanderhoorn
Copy link
Member

General comments:

  1. use SI units everywhere (REP-103). Conversion to whatever a particular controller/robot needs will need to be done in robot-specific code.
  2. follow naming conventions for msgs and fields: see wiki/msg and wiki/ROS/Patterns/Conventions. In particular, no camelcasing fieldnames.


# Real robot tests are performed on the KUKA IIWA 7 R800:

The ROS robot model is taken from [iiwa_stack](https://github.com/SalvoVirga/iiwa_stack)
Copy link
Member

@gavanderhoorn gavanderhoorn Jun 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor (as this pkg is meant to be as generic as possible): it'd be nice if we can use kuka_experimental for this. I know we don't support the 7 R800 at the moment, but that is fixable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gavanderhoorn any good model for the 7 R800 that you know about and satisfies ROS-I conventions or we need to modify some existing ones to meet the naming conventions requirements?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could adapt the 14 R820, or we could import the one from iiwa_stack, and then update it. I'm fine with either. Not sure which one is less work (haven't looked at the iiwa_stack one recently).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can take a look at this and see which one would be more straightforward to adopt. I'll then can make a pull request to the kuka_experimental

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever you do: make sure to get proper permission / ask the authors. Depending on the license it may not be really required, but I feel it's always a good thing to do.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remembered there is ros-industrial/kuka_experimental#31 open against kuka_experimental which adds the 7 R800. There are some things to fix, but perhaps that could also be a starting point.

@rkojcev
Copy link
Collaborator Author

rkojcev commented Jun 10, 2016

Thank you so much for your suggestions @shaun-edwards and @gavanderhoorn.

Just one general question regarding the definition of the damping parameters. For the KUKA they are unitless ( Lehr’s damping ratio). I suggest to go with this now and explicitly state this in the explanation of the message. If you have better idea how we can handle unitless msg let me know :)

@shaun-edwards
Copy link
Contributor

Unit-less damping ratio seems OK with me. Would the damping be limited 0-1 or is it possible to have an over-damped (>1) situation?

@rkojcev
Copy link
Collaborator Author

rkojcev commented Jun 11, 2016

Thank you @shaun-edwards . The damping ratio is set to be between the values: 0.1 - 1. In case of the iiwa is not allowed to be 0 nor to be >1

@gavanderhoorn
Copy link
Member

gavanderhoorn commented Jun 15, 2016

@rkojcev: do you have any examples of other robots that support setting damping in this way? What units (if any) do they use?

What other methods exist, and how do they specify damping parameters?

I just want to avoid modelling all of this on the way KUKA does things.

@gavanderhoorn
Copy link
Member

Also: general comment: I'd not put URLs in the comments of the messages, it seems redundant. Locally users can just do a rosmsg show .. if they want to know more about the structure of a particular field, and online the rosdoc generators will already make all types clickable links.

Besides being redundant, it's also adds maintenance overhead: you/we now have to make sure the links keep working.

@rkojcev
Copy link
Collaborator Author

rkojcev commented Jun 15, 2016

@gavanderhoorn I only have access to the kuka iiwa and kuka lbr 4+. However in the literature, even though most of the publications are from DLR regarding this topic, there are some publications that use custom-made robots and they use Ns/m. It would be a good idea to reach to other people who use Cartesian Impedance on industrial robots and maybe we could get some input from them on this matter.

It might be also good idea to make 2 types of damping messages, one could be called damping_ratio and will use unitless values (same as the ones KUKA is using) and other called just damping which will use Ns/m.

@gavanderhoorn
Copy link
Member

It would be a good idea to reach to other people who use Cartesian Impedance on industrial robots and maybe we could get some input from them on this matter.

That would be a very good idea.

@gavanderhoorn
Copy link
Member

Question after an internal review here:

the damping/stiffness of the end-effector need to be in some reference frame (while the null-space stiffness/damping is independent thereof). This is not explicit in any of the messages. So are those always in the current frame of the position/orientation control? What happens if you switch to a different frame for position/orientation control?

@rkojcev
Copy link
Collaborator Author

rkojcev commented Jun 16, 2016

@gavanderhoorn here things get interesting.
Compared to Cartesian Control w/o impedance usually you adjust just the position and orientation of the new frame (tool). When you want to perform a motion with Cartesian impedance you need to know the exact mass, center of mass and moments of inertia of the tool.

Once you set this values for the tool then the robot will know how to adjust its motor torques taking into account the new tool properties. Then when you set all the Cartesian Impedance parameters the new tool is taken into account.

From the user perspective the values he is setting for the Impedance Control do not have to be changed if you add a new tool, what is important is to properly define all the parameters of the tool to have desired Cartesian Impedance Motion, otherwise the robot might not behave as desired, and the spring properties of the Cartesian Impedance will not be correct. This leads to bad Force Control for example.
This is mostly visible if the robot is in gravity compensation mode. When the tool properties are not set correctly the robot will not be able to maintain its position or will jump up/down with its maximum speed.

In KUKA LBR4+ you are only able to set these parameters directly on the controller. On the iiwa you are able to send this parameters via messages. Usually these robots offer possibility to determine all of these properties via tool calibration steps directly on the controller and this is the desired procedure to do this.

In my plan I am also envisioning to have this set of messages for setting the tool properties as well. :) We can offer this possibility to the user to set the tool properties via messages even though I do not recommend it. If it was up to me I would go trough the painful calibration when adding new tool. In my experience the robot has better behavior if the tool is calibrated internally on the controller. At least that was the case for the KUKAs.

@rkojcev
Copy link
Collaborator Author

rkojcev commented Jun 16, 2016

@gavanderhoorn and @shaun-edwards I have addressed all of your comments.

Should we make a new PR or you can check the changes in this one?

@gavanderhoorn
Copy link
Member

So do I understand you correctly that you say that it doesn't make sense to include any reference frame because it is always relative to the currently defined / calibrated tool? I think the question I relayed was more about "in what frame are these damping parameters defined" (obviously not for null-space).

@rkojcev
Copy link
Collaborator Author

rkojcev commented Jun 16, 2016

Yes exactly @gavanderhoorn

Sorry for the long answer. I just wanted to elaborate little bit more on the differences when doing Cartesian Impedance Control

@shaun-edwards
Copy link
Contributor

Related to @gavanderhoorn's question. The rotational/translational elements are specified with respect to a particular frame. Assuming the tool frame? Should this message set make that assumption, or should we name the frame in which these elements are represented? If we name the frame, can we avoid the "tool setting" message set (i.e. the driver will set the tool if the message it receives specifies a different frame)?

@rkojcev
Copy link
Collaborator Author

rkojcev commented Jun 16, 2016

Sorry about my long answers.

The rotational/transnational elements are specified with respect to a particular frame. Assuming the tool frame?

Yes that is correct.

Should this message set make that assumption, or should we name the frame in which these elements are represented? If we name the frame, can we avoid the "tool setting" message set (i.e. the driver will set the tool if the message it receives specifies a different frame)?

In my opinion it has to make this assumption. Every time we set the robot into Cartesian Impedance a set of commands is loaded. The most important one is verifying the tool mass and center of mass. This usually happens before you can call set Cartesian Impedance Parameters and is when the robot is initialized. While the controller allows changing Cartesian Impedance parameters interactively I have never tried changing tool interactively (I am not sure this is feasible) but its worth trying.

Let us assume we go with the option where we name the frame in the msgs. Then on the controller side we have to look for all the calibrated frames, that are usually stored on the controller and see if any of them matches the one in the send msgs, once match is found we have to call the robot internal tool verification, and handle errors.

As I mentioned I would not recommend setting tool mass properties directly unless I have very good mechanical model of the tool where I have made all the necessary calculations of its properties and still in my experience that one is more prone to failure compared to the one where I calibrate the tool internally on the robot controller.

I would like to try this out and see what is practically feasible :) Sending and setting frame directly from the message would be a better idea compared to making new set of messages for loading the tool.

@gavanderhoorn
Copy link
Member

What you describe seems based on your experience with KUKA robots (which is fine!). While it is true that there are not many others that expose impedance controls, I feel it makes more sense to design this set of msgs for an abstract, 'ideal' and yet to be constructed robot. That way we at least try as much as possible to avoid (implicitly) encoding assumptions into the messages based on how KUKA does things.

I'd like to see the frame made explicit for two reasons:

  1. future proofing: the fact that changing the tool on-line is not supported (or is difficult) right now (and then only on the robots that are part of the 'reference group') is not a good argument to not include it imo. Future robots / controllers might support it (or even depend on it), and by making the design decision to not include an explicit frame reference, the msgs will be less useful in those cases.

    I've not seen any / searched, but how does an IIWA interact with tool changers fi? I would assume it would need to update parameters in that case as well.

  2. 'safety' (I put this in quotes as it's a software / user-level thing (ie: convenience, saving you from dumb things), not a safety-rated feature): ROS applications are mostly autonomous, but still made by people. Having the frame explicit makes it possible for the receiving entity (ie: a controller) to check that whatever comes in actually corresponds to what it knows about / is configured for. For configuration type msgs / services, if the robot does support on-line configuration, it can perform checks and then update its configuration. For robots that don't, always return an error if a change is requested, otherwise, check specified frame corresponds to what is currently configured and update the corresponding parameters.

@gavanderhoorn
Copy link
Member

@rkojcev wrote:

As I mentioned I would not recommend setting tool mass properties directly unless I have very good mechanical model of the tool where I have made all the necessary calculations of its properties and still in my experience that one is more prone to failure compared to the one where I calibrate the tool internally on the robot controller.

While I understand what you're trying to say, I don't think this is something that should influence our decision on whether or not to include something in the messages. It would be the users responsibility to make sure that the messages are used properly. A geometry_msgs/Twist can also be a dangerous thing if I don't set it up correctly.

@rkojcev
Copy link
Collaborator Author

rkojcev commented Jun 17, 2016

What you describe seems based on your experience with KUKA robots (which is fine!). While it is true that there are not many others that expose impedance controls, I feel it makes more sense to design this set of msgs for an abstract, 'ideal' and yet to be constructed robot. That way we at least try as much as possible to avoid (implicitly) encoding assumptions into the messages based on how KUKA does things.

I definitely agree on this one. We should not constrain our design on any particular hardware.

I've not seen any / searched, but how does an IIWA interact with tool changers fi? I would assume it would need to update parameters in that case as well.

Yes, it needs to update all the necessary parameters. Changing tool interactively under Cartesian Impedance is something that I would like to try it out and see how the robot behaves. Then I can open an issue here where we can think of possible outcome if it supports or does not.

For configuration type msgs / services, if the robot does support on-line configuration, it can perform checks and then update its configuration. For robots that don't always return an error if a change is requested, otherwise, check specified frame corresponds to what is currently configured and update the corresponding parameters.

I also agree on this one. Checks need to be performed in any way.

I agree with you @gavanderhoorn on your points raised here. I know that for now I am testing everything on the iiwa and I might be biased in some of the arguments I am raising, but definitely having feedback from everyone will help us design a general msgs which could be used in any present or future hardware.

In general, I also think we should add frame to the msgs and I also would like to try out interactively changing the frame. I think this feature will be quite useful to have.

NullSpace null_space_params
string tool
CartesianStiffness stiffness
#use this if the damping is in Ns/m, Ns/rad
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does the receiving node know which type of Cartesian stiffness is used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean Cartesian Damping type?

For now the only difference is in the naming, and is up to the user to decide which one to choose. In fact there is not even difference of the variable definition.

Do you have any suggestions how we can differentiate this better, or we could just leave one msg type called damping and let the user either input ratio or Ns/m for the damping parameters. Having two types of damping msgs can be confusing and prone to errors

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I meant dampening.

From a usability perspective, any publisher and any subscriber should be able to talk and the semantic intent of the message should be clear. In other words, the messages sent should always mean the same thing regardless of who is producing/consuming it.

I think you should pick convention and then make sure subscribers can translate that convention into whatever is expected by the controller. For example, if you pick Ns/m, then the drive node for the iiwa will require a critical dampening parameter(s) in order to translate into a unit-less dampening. While this may seem like it makes the driver more complex, it does so for the sake of usability and consistent semantics.

Copy link
Member

@gavanderhoorn gavanderhoorn Jun 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I may make a suggestion, I think the choice for either ratio or Ns/m is something we should get as much input on as possible.

I've talked to multiple people internally (control engineers, mechanical engineers, ..) and have heard passionate arguments for and against both options. Some find ratios much more intuitive, others dislike the relativeness of them. Ns/m is regarded as difficult, and not as 'platform independent' (ie: 0.5 is always 0.5, but the effect of 1.0 Ns/m isn't immediately clear), even though it is something that actually has a unit (and is not a dimensionless nr, so is less ambiguous / depending on context).

Personally I agree with @shaun-edwards (and I think I've said it before), in that any message should be unambiguously interpretable. Making the semantics of fields dependent on implicit or invisible assumptions / knowledge seems like a bad idea.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also agree with @gavanderhoorn that we should definitely find consensus whether we should use ratio's or Ns/m, I think that this should highly depend on the units majority of the robots use as well. I am also looking at how to convert from Ns/m to ratios for example and it seems it is not very straight forward thing to do...

Maybe if we can get input from others who have robots who use Cartesian Impedance and the units they use would be great.

@rkojcev
Copy link
Collaborator Author

rkojcev commented Jun 24, 2016

closing this and opening new pull request with the changed msg after discussion above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants