Hi Declan,
That function (and several more) should not be in the public API -- they implement the interface to so-called ChContactable objects (objects that can generate contacts). I will clean this up when I get a chance.
To report contact point locations use the contact reporting callback mechanism, by deriving your own reporter from ChContactContainer::ReportContactCallback.
See demo_python_2.py for an example and the documentation at (http://api.projectchrono.org/development/classchrono_1_1_ch_contact_container_1_1_report_contact_callback.html)
--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/d7d9b8c7-b4b8-47ab-a1b2-32a102c2beae%40googlegroups.com.
Hi Declan,
That function (and several more) should not be in the public API -- they implement the interface to so-called ChContactable objects (objects that can generate contacts). I will clean this up when I get a chance.
To report contact point locations use the contact reporting callback mechanism, by deriving your own reporter from ChContactContainer::ReportContactCallback.
See demo_python_2.py for an example and the documentation at (http://api.projectchrono.org/development/classchrono_1_1_ch_contact_container_1_1_report_contact_callback.html)
--Radu
On 11/15/2019 12:46 AM, Declan Mulroy wrote:
--
Hello,
Ive managed to collect and save Forces generated by collision however Im also trying to save the locations of those points of contact in the global frame using pychrono. I found this function in the core.py code but am not sure what it wants. Does it want the coordinate frame of the local object and global object or is this not even the correct function to use. I am also using EasyBodycylinders as well.
def GetContactPoint(self, loc_point, state_x):r"""GetContactPoint(ChBody self, ChVectorD loc_point, ChState state_x) -> ChVectorD"""return _core.ChBody_GetContactPoint(self, loc_point, state_x)
Thank you in advanced,
Declan Mulroy
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 projec...@googlegroups.com.
Hi Declan,
That function (and several more) should not be in the public API -- they implement the interface to so-called ChContactable objects (objects that can generate contacts). I will clean this up when I get a chance.
To report contact point locations use the contact reporting callback mechanism, by deriving your own reporter from ChContactContainer::ReportContactCallback.
See demo_python_2.py for an example and the documentation at (http://api.projectchrono.org/development/classchrono_1_1_ch_contact_container_1_1_report_contact_callback.html)
--Radu
On 11/15/2019 12:46 AM, Declan Mulroy wrote:
--
Hello,
Ive managed to collect and save Forces generated by collision however Im also trying to save the locations of those points of contact in the global frame using pychrono. I found this function in the core.py code but am not sure what it wants. Does it want the coordinate frame of the local object and global object or is this not even the correct function to use. I am also using EasyBodycylinders as well.
def GetContactPoint(self, loc_point, state_x):r"""GetContactPoint(ChBody self, ChVectorD loc_point, ChState state_x) -> ChVectorD"""return _core.ChBody_GetContactPoint(self, loc_point, state_x)
Thank you in advanced,
Declan Mulroy
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 projec...@googlegroups.com.
Hi Declan,
I am not perfectly clear on what you mean by being “able to call on the point vA”, but you cannot have OnReportContact return it. That method is called internally by ReportAllContacts and must return ‘true’ or ‘false’, informing the caller (ReportAllContacts) to continue processing the next contact or stop processing, respectively.
If you want to extract all vA points in a list, you can do something like:
class MyReportContactCallback(chrono.ReportContactCallback):
def __init__(self):
chrono.ReportContactCallback.__init__(self)
self.points = []
def OnReportContact(self,vA,vB,cA,dist,rad,force,torque,modA,modB):
self.points.append(vA)
return True # return False to stop reporting contacts
def ResetList(self):
self.points = []
def GetList(self):
return self.points
my_rep = MyReportContactCallback()
while (my_system.GetChTime() < 1.2) :
my_system.DoStepDynamics(0.01)
my_rep.ResetList()
my_system.GetContactContainer().ReportAllContacts(my_rep)
crt_list = my_rep.GetList()
print('time=', my_system.GetChTime(), ' num. contacts=', my_system.GetContactContainer().GetNcontacts())
print(*crt_list, sep='\n')
Is this what you need?
--Radu
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/dd9ef760-c56d-4ae0-8ced-89e1f15b0e17%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/DM5PR0601MB374995E3998B62D7B50543AEA7560%40DM5PR0601MB3749.namprd06.prod.outlook.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/dd9ef760-c56d-4ae0-8ced-89e1f15b0e17%40googlegroups.com.
Qihan,
Look at demo_IRR_callbackNSC (https://github.com/projectchrono/chrono/blob/develop/src/demos/irrlicht/demo_IRR_callbackNSC.cpp) and demo_IRR_callbackSMC (https://github.com/projectchrono/chrono/blob/develop/src/demos/irrlicht/demo_IRR_callbackSMC.cpp) for C++ examples of using contact reporting callbacks.
--Radu
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/809071a6-4065-4dda-a6e9-d40d543301fbo%40googlegroups.com.