shadow-robot / optoforce

ROS driver for the Optoforce sensor
GNU General Public License v2.0
21 stars 17 forks source link

Correctly convert to Newtons #6

Closed toliver closed 8 years ago

toliver commented 9 years ago

Read the information that comes in the Sensitivity report (e.g. from a yaml file) and use it to convert the raw data.

dogoepp commented 8 years ago

Hello,

I didn't do the YAML file reading but you might be interested in the commit 2f316e of our fork. It makes the node take the scaling from the parameter server.

Would it fix this issue ?

Regards, Dorian

armando-montalvo commented 8 years ago

Is somebody already working in this issue? I would gladly try to work on this.

toliver commented 8 years ago

@dogoepp Reading from the Parameter server is actually the preferred way to do it. I don't know how many parameters are in this Sensitivity Report. Is it only a scaling factor? If so, then https://github.com/resibots/optoforce/commit/2f316e9e79f2ff34b10901fc740229f9dcec02f2 could be a good fix. You would need to actually apply the factor to the measured force, though.

toliver commented 8 years ago

@armando-montalvo We're not working on it at the moment, so unless @dogoepp plans to do it as well, you are welcome to contribute.

dogoepp commented 8 years ago

The parameter given in the sensitivity report is indeed simply a scaling factor. At least it is so for our 3-axis force sensors. Besides, the scaling factor was already applied, see line 159 in master.

However, we only have 3-axis sensors and it might appear that for the 6-axis ones or for the 4 1-axis DAQs, there should be several scaling factors. Since we don't have any such thing, I didn't bother to write code for it. So of you wish to complete this functionality, @armando-montalvo, feel free to.

Just let me know, so that I can either make a pull request or update as soon as the change is made.

armando-montalvo commented 8 years ago

Our sensitivity report has a value for each axis, that is the reason I asked. I would like to add this functionality, hopefully I can upload it tomorrow.

dogoepp commented 8 years ago

Do you mean for each axis of each sensor ?

Le 22/03/2016 15:25, Armando Montalvo a écrit :

Our sensitivity report has a value for each axis, that is the reason I asked. I would like to add this functionality, hopefully I can upload it tomorrow.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/shadow-robot/optoforce/issues/6#issuecomment-199837957

armando-montalvo commented 8 years ago

Yes, actually what I want to make is just add the option to divide each axis for each Counts/N value, it is pretty much the same as what you did.

dogoepp commented 8 years ago

I'm a little bit surprised. The sensitivity reports provided by Optoforce give only a scaling factor in Fz for each of our force sensors.

Le 22/03/2016 15:43, Armando Montalvo a écrit :

Yes, actually what I want to make is just add the option to divide each axis for each Counts/N value, it is pretty much the same as what you did.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/shadow-robot/optoforce/issues/6#issuecomment-199845939

armando-montalvo commented 8 years ago

We have here an OMD-45-FE-1000N sensor, and it indicates Counts/N of Fx, Fy and Fz. Which model do you have?

toliver commented 8 years ago

Maybe posting a screenshot of the two different S. Reports on this issue might help.

armando-montalvo commented 8 years ago

sen_rep

dogoepp commented 8 years ago

OK, I get it. We have the simpler OMD-20-SEN (hemisphere).

Also, it would make sense to take into account that there can be up to four sensors per DAQ, making the parameter count possibly reach 12 for scaling.

Le 22/03/2016 15:54, Armando Montalvo a écrit :

sen_rep https://cloud.githubusercontent.com/assets/5733238/13955804/5bfec4fe-f046-11e5-8ac6-67a5936f9bdb.png

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/shadow-robot/optoforce/issues/6#issuecomment-199851751

armando-montalvo commented 8 years ago

But are the parameters between the sensors different? I already made the fix, but I took the dumbest approach possible. If you know if there is a different way to do it, I'd appreciate if you'd make it better.

armando-montalvo commented 8 years ago

Here is the link to my code, I forgot to post it, sorry: https://github.com/armando-montalvo/optoforce.git

dogoepp commented 8 years ago

I shall have a look at this tomorrow. I'm rather busy right now, sorry.

Le 22/03/2016 17:01, Armando Montalvo a écrit :

Here is the link to my code, I forgot to post it, sorry: https://github.com/armando-montalvo/optoforce.git

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/shadow-robot/optoforce/issues/6#issuecomment-199880788

dogoepp commented 8 years ago

Could you have a look at the comment on commit 834f6defb0e in your fork ?

I wonder if we should retrieve a dictionary of parameters, allowing to put them in a file. This file could then be loaded in the launch file.

<node ...>
  <!-- ... -->
  <rosparam command="load" file="$(arg scaling_file)"/>
</node>
dogoepp commented 8 years ago

I don't expect the parameters to be equal between any two sensors but I might be wrong.

Since we only have USB interfaces with one sensor each, I don't have the use case for the more complex case so I don't mind if it is not properly handled now.

Le 22/03/2016 16:57, Armando Montalvo a écrit :

But are the parameters between the sensors different? I already made the fix, but I took the dumbest approach possible. If you know if there is a different way to do it, I'd appreciate if you'd make it better.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/shadow-robot/optoforce/issues/6#issuecomment-199879688

armando-montalvo commented 8 years ago

That was my first idea, but to be honest I don't know how to make it. Can one ask for a vector in the launch file as an argument?

toliver commented 8 years ago

Just for completion, our 4 channel 3 axis sensor came with 4 sensitivity reports, one per channel. It was of the hemispherical type.

The answer we got from Optoforce is:

"The semispherical sensors we sent to you are calibrated only in the Z+ direction. Independent X and Y direction measurements (and Z- tension measurements) are not possible due to the sensor's (semispherical) shape.

You should use the indicated count/N value for each sensor to get a Newton value in Z direction."

Here you can see the first 2 sens. rep.

screenshot from 2016-03-23 10 35 14

screenshot from 2016-03-23 10 40 35

toliver commented 8 years ago

The scale parameter could be a vector of vectors. Something like this:

For a 6 axis single sensor:

scale:
    - [1000, 1000, 1000, 1000, 1000, 1000]

For a 3 axis multi-sensor (4 sensors):

scale:
    - [1000, 1000, 1000]
    - [1000, 1000, 1000]
    - [1000, 1000, 1000]
    - [1000, 1000, 1000]

When reading the parameter we could check the dimensions of the vector against the expected self._nb_sensors and self._nb_axis, and spit an error if they don't match.

It could be read as:

self._scale = rospy.get_param("~scale")
armando-montalvo commented 8 years ago

Ok, sounds good, I'll make a pull request when I'm done, thanks for the feedback!

dogoepp commented 8 years ago

This issue is solved by #17.

nafzal commented 6 years ago

Hi Can anyone please share the sensitivity report of OMD-20-FG-100N as I need to convert the values from counts to Newtons

toliver commented 6 years ago

@nafzal If I'm not mistaken your sensors should come with a USB stick that contains a pdf file with the sensitivity report.