Unity-Technologies / Unity-Robotics-Hub

Central repository for tools, tutorials, resources, and documentation for robotics simulation in Unity.
Apache License 2.0
1.98k stars 410 forks source link

When will Force sensor be ready? #326

Closed WenqiangX closed 2 years ago

WenqiangX commented 2 years ago

Hi,

I read the README.md of this repo, it says "Force/Torque Sensor API" is comming soon.

Could you maybe give a rough time about when will it be ready? I guess it means making the ArticulationBody.getJointForces() actually work?

Thanks!

peifeng-unity commented 2 years ago

Hello @WenqiangX, thanks for asking for the feature of the force sensor. May I clarify if you are looking for the force that the actuators/drivers apply on the joints or the collision/contact forces when multiple objects collide with each other?

If it is the second one, Unity provides the APIs (e.g. Collision.GetContacts and Collision.impulse) that allows calculating the contact forces directly if you want to.

WenqiangX commented 2 years ago

Thanks for the reply @peifeng-unity, I meant for the former, as it is important for force control and dynamics related researches. Many robot research simulator like Pybullet, MuJoCo, and Omniverse have added such feature.

I gather currently the robot joints are driven by PD control (according to Section Joint drive effect in https://docs.unity3d.com/Manual/class-ArticulationBody.html).

To enable force-related control, I assume I can try to rewrite the control approach by AddForce/Torque API. But currently I cannot set drive target accelerations, so that I cannot implement impedance control. And I cannot get the joint force (though the API is there, but it returns 0 always), so that I cannot implement hybrid force control.

Since I see this force sensor feature has already in the roadmap, it is exciting, and thus I wonder when will this likely to be available.

Unity provides many features that other simulators cannot provide, and our projects have been heavily built upon it. Thus we really don't want to switch simulation environment at this moment.

peifeng-unity commented 2 years ago

Hi @WenqiangX, thanks for letting us know about your use case. Our physics team is actively working on releasing this feature, which is related to inverse dynamics. To my best knowledge, it is coming soon, probably in the next couple of weeks or so. We can keep you updated once it is publicly available.

WenqiangX commented 2 years ago

Thanks, looking forward to it!

peifeng-unity commented 2 years ago

Hello @WenqiangX, the inverse dynamics is released! Please find the force sensor feature here. Please let us know if you have any feedbacks for it.

WenqiangX commented 2 years ago

Thank for your hard working! That's great news! I think I can close the issue for now.