There is no explicit support for this, also because this type of monitoring is quite application specific. A couple of suggestions:
i. If yes, process information as desired and return false (so that this particular collision is discarded and does not generate contact forces).
ii. If no, simply return true (so that contact forces are generated).
Of course, all the above are in C++, but it should be straightforward to recode in Python as needed. I don’t recall off the top of my head if we provided a Python wrapper for the NarrowphaseCallback mechanism; let us know if that is not in place and we can easily add it.
--Radu
--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
projectchron...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/projectchrono/c76dc9a0-f354-4341-bcb8-701673b21c81n%40googlegroups.com.
Another thing that can be tried is to simply use a camera sensor (from Chrono::Sensor) and do image processing on the video stream picked up by the camera sensor in Chrono.
This is if you are interested in automation, which seems to be the case from what you are saying. The purpose of C::Sensor is to enable this type of design (of automation, that is).
Dan
-------------------------------------------------
Mead Witter Foundation Professor
NVIDIA CUDA Fellow
Director, Wisconsin Applied Computing Center
Department of Mechanical Engineering
Department of Computer Science
University of Wisconsin - Madison
4150ME, 1513 University Avenue
Madison, WI 53706-1572
608 265 2316 (Fax)
http://homepages.cae.wisc.edu/~negrut
-------------------------------------------------
From: projec...@googlegroups.com <projec...@googlegroups.com>
Sent: Monday, December 13, 2021 1:20 AM
To: monox...@live.ca; ProjectChrono <projec...@googlegroups.com>
Subject: RE: [chrono] PyChrono: Methods For Presence Detection
There is no explicit support for this, also because this type of monitoring is quite application specific. A couple of suggestions:
1. If it is enough to monitor only a point on the object, you could implement your own “point in volume” check using the specific shape of your test volume. You may find some useful functions and algorithms in the chrono collision system (see ChCollisionUtilsPRIMS.cpp).
2. If you want to use the actual collision shape of the object to trigger the detection, you can use the `NarrowphaseCallback` mechanism provided in Chrono. See this example for an illustration. The idea is to:
a. Als create a collision shape for the “test volume” (you will need to create a body to carry that collision model – in your case likely the “ground” body).
b. Implement and register a custom object of type `NarrowphaseCallback`.
c. Intercept all reported collisions during the narrowphase (in the overridden OnNarrowphase() method of your narrowphase callback object). At each time step, this method is called for all current collision pairs identified by the narrowphase algorithm.
d. Identify if a particular collision involves the “test volume” and the desired object:
i. If yes, process information as desired and return false (so that this particular collision is discarded and does not generate contact forces).
ii. If no, simply return true (so that contact forces are generated).
Of course, all the above are in C++, but it should be straightforward to recode in Python as needed. I don’t recall off the top of my head if we provided a Python wrapper for the NarrowphaseCallback mechanism; let us know if that is not in place and we can easily add it.
--Radu
From:
projec...@googlegroups.com <projec...@googlegroups.com>
On Behalf Of monox...@live.ca
Sent: Monday, December 13, 2021 7:25 AM
To: ProjectChrono <projec...@googlegroups.com>
Subject: [chrono] PyChrono: Methods For Presence Detection
Good day,
Is there any PyChrono implementations for simple presence detection? For example whenever an object passes through a space the "detector" is set true, and when an object leaves the space it returns false.
A practical of this detection example would be a box moving along a conveyor and being seen by a photocell as it approaches the next conveyor.
Regards,
--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
projectchron...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/projectchrono/c76dc9a0-f354-4341-bcb8-701673b21c81n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/PH0PR06MB8237C77CA566B88623E9DADEA7749%40PH0PR06MB8237.namprd06.prod.outlook.com.
Kind request – please educate me on what PLC and OPC and Photocells are and do.
At that point, I’ll try to help if I can.
Thanks.
Dan
P.S. Please don’t call me Mr. Negrut – that makes me feel even older than I already am. Dan will do :-)
-------------------------------------------------
Bernard A. and Frances M. Weideman Professor
NVIDIA CUDA Fellow
Director, Wisconsin Applied Computing Center
Department of Mechanical Engineering
Department of Computer Science
University of Wisconsin - Madison
4150ME, 1513 University Avenue
Madison, WI 53706-1572
http://homepages.cae.wisc.edu/~negrut
-------------------------------------------------
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/56d2fb93-fcfa-429e-a7d8-c251c4d197fdn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/b42c91d5-16ee-4e8b-8c01-a7ca6311fef2n%40googlegroups.com.