o3de / o3de-extras

Other
61 stars 61 forks source link

Effort sensor component for ROS2 Gem #208

Open michalpelka opened 1 year ago

michalpelka commented 1 year ago

Design a new component for ROS2 Gem that allows users to get a current measurement of reaction force inside joints. It is a necessary feature for robotic applications and a number of robots are equipped with such sensors or measure torque indirectly using electrical current measurements.

The candidate for a method to obtain torque/force information from PhysX Gem: https://github.com/o3de/o3de/pull/15024

Message type to be published : https://docs.ros2.org/galactic/api/geometry_msgs/msg/WrenchStamped.html

macmacal commented 7 months ago

Hello, is there any progress or plans regarding development of this sensor component?

michalpelka commented 7 months ago

Hello, @macmacal ! We have introduced a very similar mechanism that allows to measure torque/force generated in articulated link (with activated motor). It is publishing the generated torque/force according to the stiffness and damping values for the motor. The generated effort is published as part of the joint_state message.

Please take a look at the small test: Screencast from 03-04-2024 12:26:44 PM.webm

This test level is available here : https://gist.github.com/michalpelka/53fd1ff8c1fa65a4927873b8a978bf6b

The issue is still open since there is no effort sensor that can work without articulation. If you would like to discuss this issue in great detail, I invite you to sig-simulation issue triage on the o3de discord channel: https://github.com/o3de/sig-simulation?tab=readme-ov-file#how-to-engage-with-sig-simulation

macmacal commented 7 months ago

@michalpelka Thanks for highlighting this functionality! I have evaluated provided example and the effort data generated in my manipulation project. As far as I understand, the motor effort is associated with the force in a prism joint or with the torque in a hinge joint.

Since I would like to simulate all F/T readings in a particular link (modeled as the F/T sensor): image I wonder if it is possible to somehow obtain all 6 values (for instance, by adding auxiliary 3 prismatic and 3 hinge joints, just for enabling the motor options in the Articulation Link components).

I greatly appreciate the invitation for further discussion. I will try to reserve some time and join the discussion this or next week.

michalpelka commented 6 months ago

Hello @macmacal. I found some time to revisit this issue, and I came up with a code that exposes PhysX articulation sensor . It seems to be noisy and limited. Please take a look at the branch https://github.com/RobotecAI/o3de-extras/commits/mp/forec_sensor_wip/. I've developed it on the development branch, but it should run fine with the release.

usage

You need to add one sensor in PhysX Articulation Link component. Next, you need to add to the entity Draft Articulation Force Publisher component. This component will read data from PhysX sensor and send it to ROS. Screenshot from 2024-03-14 11-48-44 You can visualize message (WrenchStamped) in Rviz. Screenshot from 2024-03-14 11-53-04

I encourage you to test this and comment on its usability. I do not have a ton of experience with such sensors - it seems to be non-physical.

macmacal commented 6 months ago

Hi @michalpelka, thank you very much for preparing the branch for testing. In couple of days I will sit with it and try my best to validate it.